From 41b8b0e1142286363a79244c400c0c77d40644f9 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 14:54:38 +0100 Subject: [PATCH 01/40] feat: move to typescript & tidy up some code --- .eslintrc.js | 15 + .gitignore | 94 + .nojekyll | 0 .prettierrc | 8 + dist/sunsynk-power-flow-card.js | 1478 +--------- package.json | 55 + rollup.config.mjs | 64 + src/const.ts | 3 + src/index.ts | 1391 +++++++++ src/style.ts | 41 + src/types.ts | 29 + tsconfig.json | 25 + yarn.lock | 4757 +++++++++++++++++++++++++++++++ 13 files changed, 6522 insertions(+), 1438 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .nojekyll create mode 100644 .prettierrc create mode 100644 package.json create mode 100644 rollup.config.mjs create mode 100644 src/const.ts create mode 100644 src/index.ts create mode 100644 src/style.ts create mode 100644 src/types.ts create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..3b2f735e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + parser: '@typescript-eslint/parser', // Specifies the ESLint parser + //extends: [ + // 'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier + // 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. + //], + parserOptions: { + ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features + sourceType: 'module', // Allows for the use of imports + experimentalDecorators: true, + }, + rules: { + "@typescript-eslint/camelcase": 0 + } +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..89d52e6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,94 @@ +dist/* +!dist/sunsynk-power-flow-card.js + +.devcontainer/* +!.devcontainer/recommended-devcontainer.json +!.devcontainer/recommended-Dockerfile + +.vscode/* + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +*.map +package-lock.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache +undefined/ + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +docs/_build diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..96bf7a0b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + semi: true, + trailingComma: 'all', + singleQuote: true, + printWidth: 120, + useTabs: true, + tabWidth: 2 +} diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 7472b6e9..85b05894 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -1,1438 +1,40 @@ -import { LitElement, html, css, svg } from "https://unpkg.com/lit-element@2.0.1/lit-element.js?module"; -const SunsynkCardversion = '1.9.5'; -console.info( - `%c SUNSYNK-POWER-FLOW-CARD %c v${SunsynkCardversion} `, - 'color: orange; font-weight: bold; background: black', - 'color: white; font-weight: bold; background: dimgray', -); - -class SunsynkPowerFlowCardEditor extends LitElement { - setConfig(config) { - this._config = config; - } - - configChanged(newConfig) { - const event = new Event("config-changed", { - bubbles: true, - composed: true, - }); - event.detail = { config: newConfig }; - this.dispatchEvent(event); - } -} - -class SunsynkPowerFlowCard extends LitElement { - static get styles() { - return css` - .container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - padding: 5px; - } - - .card { - border-radius: var(--ha-card-border-radius, 10px); - box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12)); - background: var(--ha-card-background, var(--card-background-color, white)); - border-width: var(--ha-card-border-width); - padding: 0px; - } - - text { text-anchor: middle; alignment-baseline: middle; } - - .left-align {text-anchor: start;} - .right-align {text-anchor: end;} - .st1{fill:#ff9b30;} - .st2{fill:#f3b3ca;} - .st3{font-size:9px;} - .st4{font-size:14px;} - .st5{fill:#969696;} - .st6{fill:#5fb6ad;} - .st7{fill:#5490c2;} - .st8{font-weight:500} - .st9{fill:#959595;} - .st10{font-size:16px;} - .st11{fill:transparent;} - .st12{display:none;} - .st13{font-size:22px;} - .st14{font-size:12px;} - - `; - } - - static get properties() { - return { - hass: { type: Object }, - }; - } - - static getStubConfig() { - return { - cardstyle: 'lite', - show_solar: 'yes', - battery: { - energy: 15960, - shutdown_soc: 20, - show_daily: 'yes', - }, - solar: { - show_daily: 'yes', - mppts: 'two', - }, - load: { - show_daily: 'yes', - }, - grid:{ - show_daily_buy: 'yes', - show_daily_sell: 'no', - show_nonessential: 'yes', - }, - entities: { - use_timer_248: 'switch.sunsynk_toggle_system_timer', - priority_load_243: 'switch.sunsynk_toggle_priority_load', - inverter_voltage_154: 'sensor.sunsynk_inverter_voltage', - load_frequency_192: 'sensor.sunsynk_load_frequency', - inverter_current_164: 'sensor.sunsynk_inverter_current', - inverter_power_175: 'sensor.sunsynk_inverter_power', - grid_connected_status_194: 'binary_sensor.sunsynk_grid_connected_status', - inverter_status_59: 'sensor.sunsynk_overall_state', - day_battery_charge_70: 'sensor.sunsynk_day_battery_charge', - day_battery_discharge_71: 'sensor.sunsynk_day_battery_discharge', - battery_voltage_183: 'sensor.sunsynk_battery_voltage', - battery_soc_184: 'sensor.sunsynk_battery_soc', - battery_power_190: 'sensor.sunsynk_battery_power', - battery_current_191: 'sensor.sunsynk_battery_current', - grid_power_169: 'sensor.sunsynk_grid_power', - day_grid_import_76: 'sensor.sunsynk_day_grid_import', - day_grid_export_77: 'sensor.sunsynk_day_grid_export', - grid_ct_power_172: 'sensor.sunsynk_grid_ct_power', - day_load_energy_84: 'sensor.sunsynk_day_load_energy', - essential_power: 'none', - nonessential_power: 'none', - aux_power_166: 'sensor.sunsynk_aux_power', - day_pv_energy_108: 'sensor.sunsynk_day_pv_energy', - pv1_power_186: 'sensor.sunsynk_pv1_power', - pv2_power_187: 'sensor.sunsynk_pv2_power', - pv1_voltage_109: 'sensor.sunsynk_pv1_voltage', - pv1_current_110: 'sensor.sunsynk_pv1_current', - pv2_voltage_111: 'sensor.sunsynk_pv2_voltage', - pv2_current_112: 'sensor.sunsynk_pv2_current', - } - }; - } - - render() { - const config = this._config; - const stateObj = this.hass.states[config.entities.day_battery_discharge_71] || { state: '0' }; - const stateObj1 = this.hass.states[config.entities.day_battery_charge_70] || { state: '0' }; - const stateObj2 = this.hass.states[config.entities.day_load_energy_84] || { state: '0' }; - const stateObj3 = this.hass.states[config.entities.day_grid_import_76] || { state: '0' }; - const stateObj4 = this.hass.states[config.entities.day_pv_energy_108] || { state: '0' }; - const stateObj5 = this.hass.states[config.entities.inverter_voltage_154] || { state: '0' }; - const stateObj6 = this.hass.states[config.entities.load_frequency_192] || { state: '0' }; - const stateObj7 = this.hass.states[config.entities.inverter_current_164] || { state: '0' }; - const stateObj8 = this.hass.states[config.entities.pv2_power_187] || { state: '0' }; - const stateObj9 = this.hass.states[config.entities.pv1_power_186] || { state: '0' }; - const stateObj11 = this.hass.states[config.entities.battery_voltage_183] || { state: '0' }; - const stateObj12 = this.hass.states[config.entities.battery_soc_184] || { state: '0' }; - const stateObj13 = this.hass.states[config.entities.battery_power_190] || { state: '0' }; - const stateObj14 = this.hass.states[config.entities.essential_power] || { state: '0' }; - const stateObj15 = this.hass.states[config.entities.grid_ct_power_172] || { state: '0' }; - const stateObj16 = this.hass.states[config.entities.pv1_voltage_109] || { state: '0' }; - const stateObj17 = this.hass.states[config.entities.pv1_current_110] || { state: '0' }; - const stateObj18 = this.hass.states[config.entities.pv2_voltage_111] || { state: '0' }; - const stateObj19 = this.hass.states[config.entities.pv2_current_112] || { state: '0' }; - const stateObj20 = this.hass.states[config.entities.grid_connected_status_194] || { state: 'on' }; - const stateObj21 = this.hass.states[config.entities.inverter_status_59] || { state: '' }; - const stateObj22 = this.hass.states[config.entities.inverter_power_175] || { state: '0' }; - const stateObj23 = this.hass.states[config.entities.grid_power_169] || { state: '0' }; - const stateObj24 = this.hass.states[config.entities.aux_power_166] || { state: '0' }; - const stateObj25 = this.hass.states[config.entities.priority_load_243] || { state: 'undefined' }; - const stateObj26 = this.hass.states[config.entities.use_timer_248] || { state: 'undefined' }; - const stateObj27 = this.hass.states[config.entities.pv3_voltage_113] || { state: '0' }; - const stateObj28 = this.hass.states[config.entities.pv3_current_114] || { state: '0' }; - const stateObj29 = this.hass.states[config.entities.pv4_voltage_115] || { state: '0' }; - const stateObj30 = this.hass.states[config.entities.pv4_current_116] || { state: '0' }; - const stateObj31 = this.hass.states[config.entities.pv3_power_188] || { state: '0' }; - const stateObj32 = this.hass.states[config.entities.pv4_power_189] || { state: '0' }; - const stateObj33 = this.hass.states[config.entities.day_grid_export_77] || { state: '0' }; - const stateObj34 = this.hass.states[config.entities.nonessential_power] || { state: '0' }; - const stateObj35 = this.hass.states[config.entities.battery_current_191] || { state: '0' }; - const stateObj36 = this.hass.states[config.entities.remaining_solar] || { state: '0' }; - const stateObj37 = this.hass.states[config.entities.battery_temp_182] || { state: '' }; - const stateObj38 = this.hass.states[config.entities.dc_transformer_temp_90] || { state: '' }; - const stateObj39 = this.hass.states[config.entities.radiator_temp_91] || { state: '' }; - const stateObj40 = this.hass.states[config.entities.non_essential_load1] || { state: '0' }; - const stateObj41 = this.hass.states[config.entities.non_essential_load2] || { state: '0' }; - const stateObj42 = this.hass.states[config.entities.essential_load1] || { state: '0' }; - const stateObj43 = this.hass.states[config.entities.energy_cost] || { state: '' }; - const stateObj44 = this.hass.states[config.entities.solar_sell_247] || { state: 'undefined' }; - const stateObj45 = this.hass.states[config.entities.essential_load2] || { state: '0' }; - const stateObj46 = this.hass.states[config.entities.pv_total] || { state: '0' }; - const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; - - //Set defaults - let invert_aux = config?.load?.invert_aux || 'no'; - let aux_power = (invert_aux === 'yes') ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); - let invert_grid = config?.grid?.invert_grid || 'no'; - let grid_power = (invert_grid === 'yes') ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); - let inverter_modern = config?.inverter?.modern || 'yes'; - let load_colour = config?.load?.colour || '#5fb6ad'; - let aux_colour = config?.load?.aux_colour || load_colour; - let aux_off_colour = config?.load?.aux_off_colour || load_colour; - let load_showdaily = config?.load?.show_daily || 'no'; - let grid_colour = config?.grid?.colour || '#5490c2'; - let no_grid_colour = config?.grid?.no_grid_colour || '#a40013'; - let grid_show_noness = config?.grid?.show_nonessential || 'yes'; - let grid_status = config?.entities?.grid_connected_status_194 ? stateObj20.state : 'on'; - let aux_status = config?.entities?.aux_connected_status ? stateObj47.state : 'on'; - let load_frequency = config?.entities?.load_frequency_192 ? stateObj6.state : 0; - let inverter_voltage = config?.entities?.inverter_voltage_154 ? stateObj5.state : 0; - let inverter_current = config?.entities?.inverter_current_164 ? stateObj7.state : 0; - let battery_voltage = config?.entities?.battery_voltage_183 ? stateObj11.state : 0; - - let noness_dual_load = config?.grid?.additional_loads; - if (noness_dual_load !== 'no' && noness_dual_load !== 'one' && noness_dual_load !== 'two') { - noness_dual_load = 'no'; - } - - let grid_showdailybuy = config?.grid?.show_daily_buy || 'no'; - let grid_showdailysell = config?.grid?.show_daily_sell || 'no'; - let battery_colour = config?.battery?.colour || 'pink'; - let battery_showdaily = config?.battery?.show_daily || 'no'; - let solar_colour = config?.solar?.colour || 'orange'; - let solar_showdaily = config?.solar?.show_daily || 'no'; - - let show_aux = config?.load?.show_aux; - if (show_aux !== 'no' && show_aux !== 'yes') { - show_aux = 'no'; - } - - let additional_load = config?.load?.additional_loads; - if (additional_load !== 'no' && additional_load !== 'one' && additional_load !== 'two') { - additional_load = 'no'; - } - - let aux_type = config?.load?.aux_type || 'default'; //valid options are gen,inverter, default, gen, boiler, pump, aircon - let nonessential_icon = config?.grid?.nonessential_icon || 'default'; //valid options are default, oven, boiler, pump, aircon - let load1_icon = config?.grid?.load1_icon || 'default'; //valid options are default, oven, boiler, pump - let load2_icon = config?.grid?.load2_icon || 'default'; //valid options are default, oven, boiler, pump - let load1e_icon = config?.load?.load1_icon || 'default'; //valid options are boiler, aircon, pump - let load2e_icon = config?.load?.load2_icon || 'default'; //valid options are boiler, aircon, pump - let remaining_solar = config.entities.remaining_solar ? parseFloat(stateObj36.state).toFixed(1) : 'false'; - let font = config?.large_font || 'no'; - let panel = config?.panel_mode || 'no'; - let inverter_colour = config?.inverter?.colour || 'grey'; - let useautarky = config?.inverter?.autarky || 'power'; - let usetimer = (config?.entities.use_timer_248 === 'no' || !config?.entities.use_timer_248) ? 'no' : stateObj26.state; - let priority = (config?.entities.priority_load_243 === 'no' || !config?.entities.priority_load_243) ? 'no' : stateObj25.state; - let battery_power = (config?.battery?.invert_power === 'yes') ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); - let height = config?.card_height || '396px' - let bat_full = config?.battery?.full_capacity || '80' - let bat_empty = config?.battery?.empty_capacity || '30' - //let width = config?.card_width || '100%' - - //totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 - let totalsolar = ( - parseInt(parseFloat(stateObj8.state || 0).toFixed(0)) + - parseInt(parseFloat(stateObj9.state || 0).toFixed(0)) + - parseInt(parseFloat(stateObj31.state || 0).toFixed(0)) + - parseInt(parseFloat(stateObj32.state || 0).toFixed(0)) - ); - - let total_pv = config?.entities?.pv_total ? parseInt(stateObj46.state) : totalsolar; - - //essential = inverter_power_175 + grid_power_169 - aux_power_166 - let essential = (config?.entities.essential_power === 'none' || !config?.entities.essential_power) ? - parseInt(stateObj22.state) + parseInt(stateObj23.state) - parseInt(stateObj24.state) : - parseInt(stateObj14.state); - - //nonessential = grid_ct_power_172 - grid_power_169 - let nonessential = (config?.entities.nonessential_power === 'none' || !config?.entities.nonessential_power) ? - parseInt(stateObj15.state) - parseInt(stateObj23.state) : - parseInt(stateObj34.state); - - //Timer entities - const prog1 = { - time: this.hass.states[config.entities.prog1_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog1_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog1_charge] || { state: '' } - }; - const prog2 = { - time: this.hass.states[config.entities.prog2_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog2_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog2_charge] || { state: '' } - }; - const prog3 = { - time: this.hass.states[config.entities.prog3_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog3_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog3_charge] || { state: '' } - }; - const prog4 = { - time: this.hass.states[config.entities.prog4_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog4_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog4_charge] || { state: '' } - }; - const prog5 = { - time: this.hass.states[config.entities.prog5_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog5_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog5_charge] || { state: '' } - }; - const prog6 = { - time: this.hass.states[config.entities.prog6_time] || { state: '' }, - capacity: this.hass.states[config.entities.prog6_capacity] || { state: '' }, - charge: this.hass.states[config.entities.prog6_charge] || { state: '' } - }; - - let inverter_prog = {}; - if (!config.entities.use_timer_248 || config.entities.use_timer_248 === 'no' || stateObj26.state === 'off') { - inverter_prog.show = 'no'; - } else if (!config.entities.prog1_time - || !config.entities.prog2_time - || !config.entities.prog3_time - || !config.entities.prog4_time - || !config.entities.prog5_time - || !config.entities.prog6_time - ) { - inverter_prog.show = 'no'; - } else { - inverter_prog.show = 'yes'; - - const timer_now = new Date(); // Create a new Date object representing the current time - - const progTimes = [null, null, null, null, null, null]; - - [prog1, prog2, prog3, prog4, prog5, prog6].forEach((prog, index) => { - const [hours, minutes] = prog.time.state.split(":"); - progTimes[index] = new Date(timer_now.getTime()); - progTimes[index].setHours(hours); - progTimes[index].setMinutes(minutes); - }); - - const [prog_time1, prog_time2, prog_time3, prog_time4, prog_time5, prog_time6] = progTimes; - - if (timer_now >= prog_time6 || timer_now < prog_time1) { - assignInverterProgValues(prog6, config.entities.prog6_charge); - } else if (timer_now >= prog_time1 && timer_now < prog_time2) { - assignInverterProgValues(prog1, config.entities.prog1_charge); - } else if (timer_now >= prog_time2 && timer_now < prog_time3) { - assignInverterProgValues(prog2, config.entities.prog2_charge); - } else if (timer_now >= prog_time3 && timer_now < prog_time4) { - assignInverterProgValues(prog3, config.entities.prog3_charge); - } else if (timer_now >= prog_time4 && timer_now < prog_time5) { - assignInverterProgValues(prog4, config.entities.prog4_charge); - } else if (timer_now >= prog_time5 && timer_now < prog_time6) { - assignInverterProgValues(prog5, config.entities.prog5_charge); - } else { - inverter_prog.capacity = parseInt(config.battery.shutdown_soc); - inverter_prog.entityID = ''; - } - - function assignInverterProgValues(prog, entityID) { - if (prog.charge.state === 'No Grid or Gen' || prog.charge.state === '0' || prog.charge.state === 'off') { - inverter_prog.charge = 'none'; - } else { - inverter_prog.charge = 'both'; - } - inverter_prog.capacity = parseInt(prog.capacity.state); - inverter_prog.entityID = entityID; - } - } - - //calculate battery capacity - let battery_capacity = ""; - if (battery_power > 0) { - if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) <= inverter_prog.capacity) { - battery_capacity = parseInt(config.battery.shutdown_soc); - } else { - battery_capacity = parseInt(inverter_prog.capacity); - } - } else if (battery_power < 0) { - if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) >= inverter_prog.capacity) { - battery_capacity = 100; - } else if (parseInt(stateObj12.state) < inverter_prog.capacity) { - battery_capacity = parseInt(inverter_prog.capacity); - } - } - - //calculate remaining battery time to charge or discharge - let totalSeconds = 0; - let formattedResultTime = ""; - let duration = ""; - - if (config.battery.energy !== "hidden") { - if (battery_power === 0) { - totalSeconds = (((parseInt(stateObj12.state) - config.battery.shutdown_soc) / 100) * (config.battery.energy || 15960)) / 1 * 60 * 60; - } else if (battery_power > 0) { - totalSeconds = (((parseInt(stateObj12.state) - battery_capacity) / 100) * (config.battery.energy || 15960)) / battery_power * 60 * 60; - } else if (battery_power < 0) { - totalSeconds = ((((battery_capacity - parseInt(stateObj12.state)) / 100 ) * config.battery.energy) / battery_power) * 60 * 60 * -1; - } - const currentTime = new Date(); // Create a new Date object representing the current time - const durationMilliseconds = totalSeconds * 1000; // Convert the duration to milliseconds - const resultTime = new Date(currentTime.getTime() + durationMilliseconds); // Add the duration in milliseconds - const resultHours = resultTime.getHours(); // Get the hours component of the resulting time - const resultMinutes = resultTime.getMinutes(); // Get the minutes component of the resulting time - const formattedMinutes = resultMinutes.toString().padStart(2, "0"); - const formattedHours = resultHours.toString().padStart(2, "0"); - formattedResultTime = `${formattedHours}:${formattedMinutes}`; - - const days = Math.floor(totalSeconds / (60 * 60 * 24)); - const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60)); - const minutes = Math.floor((totalSeconds % (60 * 60)) / 60); - if (days > 0) { - duration += `${days} days, `; - } - if (hours > 0 || days > 0) { - duration += `${hours} hrs, `; - } - duration += `${minutes} min`; - } - - let float = (-2 <= parseInt(stateObj35.state)) && (parseInt(stateObj35.state) <= 2) && (parseInt(stateObj12.state) >= 99) ? "True" : "False"; - - //Set Inverter Status Message and dot - let inverterStateColour = ""; - let inverterStateMsg = ""; - - switch (stateObj21.state) { - case '0': - case 'standby': - inverterStateColour = 'blue'; - inverterStateMsg = 'Standby'; - break; - case '1': - case 'selftest': - inverterStateColour = 'yellow'; - inverterStateMsg = 'Selftest'; - break; - case '2': - case 'normal': - case 'ok': - inverterStateColour = 'green'; - inverterStateMsg = 'Normal'; - break; - case '3': - case 'alarm': - inverterStateColour = 'orange'; - inverterStateMsg = 'Alarm'; - break; - case '4': - case 'fault': - inverterStateColour = 'red'; - inverterStateMsg = 'Fault'; - break; - default: - if (config?.entities?.inverter_status_59 === 'none' || !config?.entities?.inverter_status_59) { - inverterStateColour = 'transparent'; - inverterStateMsg = ''; - } else { - inverterStateColour = 'transparent'; - inverterStateMsg = 'Status'; - } - break; - } - - //Autarky in Percent = Home Production / Home Consumption - //Ratio in Percent = Home Consumption / Home Production - //let production_e = parseFloat(stateObj4.state) + parseFloat(stateObj.state); - //let consumption_e = parseFloat(stateObj2.state) + parseFloat(stateObj1.state); - let production_e = ( - (isNaN(parseFloat(stateObj4.state)) ? 0 : parseFloat(stateObj4.state)) + - (isNaN(parseFloat(stateObj.state)) ? 0 : parseFloat(stateObj.state)) - ); - let consumption_e = ( - (isNaN(parseFloat(stateObj2.state)) ? 0 : parseFloat(stateObj2.state)) + - (isNaN(parseFloat(stateObj1.state)) ? 0 : parseFloat(stateObj1.state)) - ); - let Autarky = consumption_e != 0 ? Math.min(Math.round((production_e * 100) / consumption_e), 100) : 0; - let Ratio = production_e != 0 ? Math.min(Math.round((consumption_e * 100) / production_e), 100) : 0; - - let production_p = parseInt(totalsolar) + parseInt(`${battery_power > 0 ? battery_power : 0}`) + parseInt(`${aux_power < 0 ? aux_power * -1 : 0}`); - let consumption_p = parseInt(essential) + parseInt(nonessential) + parseInt(`${aux_power > 0 ? aux_power : 0}`) + parseInt(`${battery_power < 0 ? battery_power * -1 : 0}`); - let Autarkyp = consumption_p != 0 ? Math.min(Math.round((production_p * 100) / consumption_p), 100) : 0; - let Ratiop = production_p != 0 ? Math.min(Math.round((consumption_p * 100) / production_p), 100) : 0; - - //Calculate power use animation speeds depending on Inverter size - let solar_animation_speed = config?.solar?.animation_speed || "9"; - if (config && config.solar && config.solar.animation_speed) { - let speed = config.solar.animation_speed - ((config.solar.animation_speed - 1) * (totalsolar / (config.solar.max_power || totalsolar))); - solar_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - let battery_animation_speed = config?.battery?.animation_speed || "6"; - if (config && config.battery && config.battery.animation_speed) { - let speed = config.battery.animation_speed - ((config.battery.animation_speed - 1) * (`${battery_power < '0' ? battery_power * -1 : battery_power}` / (config.battery.max_power || `${battery_power < '0' ? battery_power * -1 : battery_power}`))); - battery_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - let load_animation_speed = config?.load?.animation_speed || "4"; - if (config && config.load && config.load.animation_speed) { - let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * (essential / (config.load.max_power || essential))); - load_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - let aux_animation_speed = config?.load?.animation_speed || "4"; - if (config && config.load && config.load.animation_speed) { - let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * (`${parseInt(stateObj24.state) < '0' ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state)}` / (config.load.max_power || `${parseInt(stateObj24.state) < '0' ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state)}`))); - aux_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - let grid_animation_speed = config?.grid?.animation_speed || "8"; - if (config && config.grid && config.grid.animation_speed) { - let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * (`${parseInt(stateObj15.state) < '0' ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state)}` / (config.grid.max_power || `${parseInt(stateObj15.state) < '0' ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state)}`))); - grid_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - let ne_animation_speed = config?.grid?.animation_speed || "4"; - if (config && config.grid && config.grid.animation_speed) { - let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * (nonessential / (config.grid.max_power || nonessential))); - ne_animation_speed = `${speed >= 1 ? speed : 1}`; - } - - if (config.cardstyle === 'full') { - return html` - - -
- - - - - - - - - - - - - - - - - - - - - - ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}`: 'PV1' } - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}`: 'PV2' } - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}`: 'PV3' } - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}`: 'PV4' } - Grid - ${inverterStateMsg} - Essential - Essential - ${config?.load?.load1_name ? `${config.load.load1_name}` : '' } - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : '' } - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : '' } - ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W - DAILY LOAD - DAILY LOAD - DAILY SOLAR - DAILY SOLAR / LEFT TODAY - DAILY CHARGE - DAILY DISCHARGE - DAILY GRID BUY - DAILY GRID SELL - ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary' } - ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential' } - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : '' } - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : '' } - ${config?.grid?.load2_name ? `${config.grid.load2_name}` : '' } - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W - ${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - Ratio - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this.handlePopup(e, config.entities.grid_connected_status_194)}> - - - - - - - - - - - - - - -
- -
- -
-
- - - - - - - - - - - - - - - - - -
- -
- -
-
- - - - -
- -
- -
-
- - - - - - - - - - -
- -
- -
-
- - - - - - - - this.handlePopup(e, config.entities.aux_connected_status)}> - - - - - - - - - - - -
- -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
- - - - -
- -
- -
-
- - - - -
- -
- -
-
- - this.handlePopup(e, config.entities.use_timer_248)}> - - - Timer On - Timer Off - - this.handlePopup(e, config.entities.solar_sell_247)}> - - - - this.handlePopup(e, config.entities.priority_load_243)}> - - - Priority Load - Priority Batt - - - - this.handlePopup(e, inverter_prog.entityID)}> - - - - this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh / ${remaining_solar} kWh - - this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) ? parseFloat(stateObj1.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) ? parseFloat(stateObj.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) ? parseFloat(stateObj3.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) ? parseFloat(stateObj33.state).toFixed(1) : '0'} kWh - - - ${config?.entities?.pv_total - ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv ? total_pv : '0'} W - ` - : svg` ${total_pv ? total_pv : '0'} W `} - - ${config.entities.essential_power !== 'none' - ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential ? essential : '0'} W - ` - : svg`${essential ? essential : '0'} W`} - ${config.entities.nonessential_power !== 'none' - ? svg` this.handlePopup(e, config.entities.nonessential_power)}> - ${nonessential ? nonessential : '0'} W - ` - : svg`${nonessential ? nonessential : '0'} W `} - this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power ? grid_power : '0'} W - - ${config.entities.aux_power_166 !== 'none' - ? svg` this.handlePopup(e, config.entities.aux_power_166)}> - ${aux_power < '0' ? aux_power *-1 : aux_power} W - ` - : svg`${aux_power < '0' ? aux_power *-1 : aux_power} W `} - ${config.entities.pv1_power_186 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W`} - ${config.entities.pv2_power_187 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W`} - ${config.entities.pv3_power_188 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W`} - ${config.entities.pv4_power_189 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W`} - this.handlePopup(e, config.entities.inverter_voltage_154)}> - ${inverter_voltage} V - - this.handlePopup(e, config.entities.load_frequency_192)}> - ${load_frequency} Hz - - this.handlePopup(e, config.entities.inverter_current_164)}> - ${inverter_current} A - - this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V - - this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) ? parseInt(stateObj12.state) : '0'} % - - this.handlePopup(e, config.entities.battery_soc_184)}> - | ${inverter_prog.capacity ? inverter_prog.capacity : '0'} % - - this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < '0' ? battery_power *-1 : battery_power} W - - this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state ? stateObj35.state : '0'} A - - this.handlePopup(e, config.entities.inverter_power_175)}> - ${stateObj22.state ? stateObj22.state : '0'} W - - this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state ? stateObj23.state : '0'} W - - this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state ? stateObj16.state : '0'} V - - this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state ? stateObj17.state : '0'} A - - this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state ? stateObj18.state : '0'} V - - this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state ? stateObj19.state : '0'} A - - this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state ? stateObj27.state : '0'} V - - this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state ? stateObj28.state : '0'} A - - this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state ? stateObj29.state : '0'} V - - this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state ? stateObj30.state : '0'} A - - this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state ? stateObj37.state : ''}° - - this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state ? stateObj39.state : ''}° - - this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state ? stateObj38.state : ''}° - - this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state ? stateObj43.state : ''} - -
-
-
- `; - } - - if (config.cardstyle === 'lite') { - return html` - - -
- - - - - - - - - - - - - - ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING - DAILY CHARGE - DAILY DISCHARGE - DAILY LOAD - DAILY GRID BUY - DAILY GRID SELL - DAILY SOLAR - DAILY SOLAR / LEFT TODAY - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}`: 'PV1' } - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}`: 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}`: 'PV3' } - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}`: 'PV4' } - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - Ratio - ${config?.load?.load1_name ? `${config.load.load1_name}` : '' } - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : '' } - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : '' } - ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
- - - - -
- -
- -
-
- - - - - - - this.handlePopup(e, config.entities.grid_connected_status_194)}> - - - - - - this.handlePopup(e, config.entities.use_timer_248)}> - - - Timer off - Timer on - - this.handlePopup(e, config.entities.priority_load_243)}> - - - Priority Batt - Priority Load - - this.handlePopup(e, config.entities.solar_sell_247)}> - - - - - this.handlePopup(e, inverter_prog.entityID)}> - - - - this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) ? parseFloat(stateObj1.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh / ${remaining_solar} kWh - - this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) ? parseFloat(stateObj.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) ? parseFloat(stateObj3.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) ? parseFloat(stateObj33.state).toFixed(1) : '0'} kWh - - this.handlePopup(e, config.entities.inverter_voltage_154)}> - ${inverter_voltage} V - - this.handlePopup(e, config.entities.load_frequency_192)}> - ${load_frequency} Hz - - this.handlePopup(e, config.entities.inverter_current_164)}> - ${inverter_current} A - - this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V - - this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) ? parseInt(stateObj12.state) : '0'} % - - this.handlePopup(e, config.entities.battery_soc_184)}> - | ${inverter_prog.capacity ? inverter_prog.capacity : '0'} % - - this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < '0' ? battery_power *-1 : battery_power} W - - this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state ? stateObj35.state : '0'} A - - this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power ? grid_power : '0'} W - - this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state ? stateObj16.state : '0'} V - - this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state ? stateObj17.state : '0'} A - - this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state ? stateObj18.state : '0'} V - - this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state ? stateObj19.state : '0'} A - - this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state ? stateObj27.state : '0'} V - - this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state ? stateObj28.state : '0'} A - - this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state ? stateObj29.state : '0'} V - - this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state ? stateObj30.state : '0'} A - - this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state ? stateObj37.state : ''}° - - this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state ? stateObj39.state : ''}° - - this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state ? stateObj38.state : ''}° - - this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state ? stateObj43.state : ''} - - ${config?.entities?.pv_total - ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv ? total_pv : '0'} W - ` - : svg`${total_pv ? total_pv : '0'} W`} - ${config.entities.pv1_power_186 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W`} - ${config.entities.pv2_power_187 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W`} - ${config.entities.pv3_power_188 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W`} - ${config.entities.pv4_power_189 !== 'none' - ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W - ` - : svg`${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W`} - ${config.entities.essential_power !== 'none' - ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential ? essential : '0'} W - ` - : svg`${essential ? essential : '0'} W`} -
-
-
- `; - } - } - - setConfig(config) { - if (!config.cardstyle) { - throw Error('Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple'); - } - if (!config.show_solar) { - throw Error('Please include the show_solar attribute e.g. show_solar: yes'); - } - if (!config.battery) { - throw Error('No battery attributes defined'); - } else { - if (!config.battery.energy) { - throw new Error('Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320'); - } - if (!config.battery.shutdown_soc) { - throw new Error('Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20'); - } - if (config.battery.full_capacity < 80) { - throw new Error('Full capacity needs to be between 80 and 100'); - } - if (config.battery.empty_capacity > 30) { - throw new Error('Empty capacity needs to be <= 30'); - } - if (config.battery.show_daily === 'yes' && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71) ) { - throw Error('Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs'); - } - } - if (config.show_solar === 'yes' && !config.solar ) { - throw Error('No solar attributes defined'); - } else { - if (config.show_solar === 'yes' && !config.solar.mppts) { - throw Error('Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two'); - } - if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.day_pv_energy_108 ) { - throw Error('Please include the day_pv_energy_108 attribute and entity ID'); - } - } - - if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.day_grid_export_77) ) { - throw Error('Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs'); - } - - if ((config && config.entities && config.entities.essential_power === 'none' && !config.entities.inverter_power_175) || (config && config.entities && config.entities.essential_power === 'none' && config.entities.inverter_power_175 === 'none') ) { - throw Error('The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.'); - } - - if ((config && config.entities && config.entities.nonessential_power === 'none' && !config.entities.grid_power_169)) { - throw Error('The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.'); - } - - const all_attributes = [ - 'battery_soc_184', 'battery_power_190', 'battery_current_191', 'grid_ct_power_172' - ]; - - for (const attr of all_attributes) { - if (!config.entities[attr]) { - throw new Error(`Please include the ${attr} attribute and entity ID e.g. ${attr}: sensor.example`); - } - } - - const solar_attributes = [ - 'pv1_power_186' - ]; - - for (const attr1 of solar_attributes) { - if (config.show_solar === 'yes' && !config.entities[attr1]) { - throw new Error(`Please include the ${attr1} attribute and entity ID e.g. ${attr1}: sensor.example`); - } - } - - this._config = config; - } - - handlePopup(e, entity) { - e.stopPropagation(); - const entityId = entity; - //console.log(entity); - this._handleClick(this, this.hass, this._config, { action: "more-info" }, entityId); - } - - _handleClick(node, hass, config, actionConfig, entityId) { - let e; - // eslint-disable-next-line default-case - switch (actionConfig.action) { - case "more-info": { - e = new Event("hass-more-info", { composed: true }); - e.detail = { entityId }; - node.dispatchEvent(e); - break; - } - } - } - - - getCardSize() { - return 2; - } -} - -customElements.define('sunsynk-power-flow-card', SunsynkPowerFlowCard); -customElements.define("sunsynk-power-flow-card-editor", SunsynkPowerFlowCardEditor); -window.customCards = window.customCards || []; -window.customCards.push({ - type: "sunsynk-power-flow-card", - name: "Sunsynk Power Flow Card", - preview: false, // Optional - defaults to false - description: "A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen", // Optional -}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function n(t,e,n,s){var i,o=arguments.length,l=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(l=(o<3?i(l):o>3?i(e,n,l):i(e,n))||l);return o>3&&l&&Object.defineProperty(e,n,l),l}"function"==typeof SuppressedError&&SuppressedError; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const s=window,i=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),l=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=l.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&l.set(e,t))}return t}toString(){return this.cssText}};const r=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,o))(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),w={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},g="finalized";let x=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const s=this._$Ep(n,e);void 0!==s&&(this._$Ev.set(s,n),t.push(s))})),t}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,n,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty(g))return!1;this[g]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=s.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=w){var s;const i=this.constructor._$Ep(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null===(s=n.converter)||void 0===s?void 0:s.toAttribute)?n.converter:_).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(t,e){var n;const s=this.constructor,i=s._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:_;this._$El=i,this[i]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let s=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var m;x[g]=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:x}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=R(1),N=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[O(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(O(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;l{var s,i;const o=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:e;let l=o._$litPart$;if(void 0===l){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=l=new X(e.insertBefore(b(),t),t,void 0,null!=n?n:{})}return l._$AI(t),l})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}at.finalized=!0,at._$litElement$=!0,null===(ot=globalThis.litElementHydrateSupport)||void 0===ot||ot.call(globalThis,{LitElement:at});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:at}),(null!==(lt=globalThis.litElementVersions)&&void 0!==lt?lt:globalThis.litElementVersions=[]).push("3.3.3"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function dt(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):ht(t,e) +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t,yt,wt,gt,xt,mt,ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Dt,Nt,$t,Yt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v".concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:15960,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:"two"},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,w,g,x,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,Ut,zt,Ot,Qt,jt,Wt,Gt,Xt,Kt,Jt,te;const ee=this._config,ne=this.hass.states[ee.entities.day_battery_discharge_71]||{state:"0"},se=this.hass.states[ee.entities.day_battery_charge_70]||{state:"0"},ie=this.hass.states[ee.entities.day_load_energy_84]||{state:"0"},oe=this.hass.states[ee.entities.day_grid_import_76]||{state:"0"},le=this.hass.states[ee.entities.day_pv_energy_108]||{state:"0"},ae=this.hass.states[ee.entities.inverter_voltage_154]||{state:"0"},re=this.hass.states[ee.entities.load_frequency_192]||{state:"0"},he=this.hass.states[ee.entities.inverter_current_164]||{state:"0"},de=this.hass.states[ee.entities.pv2_power_187]||{state:"0"},pe=this.hass.states[ee.entities.pv1_power_186]||{state:"0"},ce=this.hass.states[ee.entities.battery_voltage_183]||{state:"0"},ve=this.hass.states[ee.entities.battery_soc_184]||{state:"0"},_e=this.hass.states[ee.entities.battery_power_190]||{state:"0"},ye=this.hass.states[ee.entities.essential_power]||{state:"0"},we=this.hass.states[ee.entities.grid_ct_power_172]||{state:"0"},ge=this.hass.states[ee.entities.pv1_voltage_109]||{state:"0"},xe=this.hass.states[ee.entities.pv1_current_110]||{state:"0"},me=this.hass.states[ee.entities.pv2_voltage_111]||{state:"0"},fe=this.hass.states[ee.entities.pv2_current_112]||{state:"0"},ue=this.hass.states[ee.entities.grid_connected_status_194]||{state:"on"},qe=this.hass.states[ee.entities.inverter_status_59]||{state:""},Te=this.hass.states[ee.entities.inverter_power_175]||{state:"0"},ke=this.hass.states[ee.entities.grid_power_169]||{state:"0"},Me=this.hass.states[ee.entities.aux_power_166]||{state:"0"},Ae=this.hass.states[ee.entities.priority_load_243]||{state:"undefined"},He=this.hass.states[ee.entities.use_timer_248]||{state:"undefined"},be=this.hass.states[ee.entities.pv3_voltage_113]||{state:"0"},Ze=this.hass.states[ee.entities.pv3_current_114]||{state:"0"},Le=this.hass.states[ee.entities.pv4_voltage_115]||{state:"0"},Ee=this.hass.states[ee.entities.pv4_current_116]||{state:"0"},Pe=this.hass.states[ee.entities.pv3_power_188]||{state:"0"},Ve=this.hass.states[ee.entities.pv4_power_189]||{state:"0"},Ie=this.hass.states[ee.entities.day_grid_export_77]||{state:"0"},Ce=this.hass.states[ee.entities.nonessential_power]||{state:"0"},Be=this.hass.states[ee.entities.battery_current_191]||{state:"0"},Fe=this.hass.states[ee.entities.remaining_solar]||{state:"0"},Se=this.hass.states[ee.entities.battery_temp_182]||{state:""},Re=this.hass.states[ee.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ee.entities.radiator_temp_91]||{state:""},Ne=this.hass.states[ee.entities.non_essential_load1]||{state:"0"},$e=this.hass.states[ee.entities.non_essential_load2]||{state:"0"},Ye=this.hass.states[ee.entities.essential_load1]||{state:"0"},Ue=this.hass.states[ee.entities.energy_cost]||{state:""},ze=this.hass.states[ee.entities.solar_sell_247]||{state:"undefined"},Oe=this.hass.states[ee.entities.essential_load2]||{state:"0"},Qe=this.hass.states[ee.entities.pv_total]||{state:"0"},je=this.hass.states[ee.entities.aux_connected_status]||{state:"on"};let We="yes"===((null===(t=null==ee?void 0:ee.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Me.state):parseInt(Me.state),Ge="yes"===((null===(n=null==ee?void 0:ee.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(we.state):parseInt(we.state),Xe=(null===(s=null==ee?void 0:ee.inverter)||void 0===s?void 0:s.modern)||"yes",Ke=(null===(i=null==ee?void 0:ee.load)||void 0===i?void 0:i.colour)||"#5fb6ad",Je=(null===(o=null==ee?void 0:ee.load)||void 0===o?void 0:o.aux_colour)||Ke,tn=(null===(l=null==ee?void 0:ee.load)||void 0===l?void 0:l.aux_off_colour)||Ke,en=(null===(a=null==ee?void 0:ee.load)||void 0===a?void 0:a.show_daily)||"no",nn=(null===(r=null==ee?void 0:ee.grid)||void 0===r?void 0:r.colour)||"#5490c2",sn=(null===(h=null==ee?void 0:ee.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",on=(null===(d=null==ee?void 0:ee.grid)||void 0===d?void 0:d.show_nonessential)||"yes",ln=(null===(p=null==ee?void 0:ee.entities)||void 0===p?void 0:p.grid_connected_status_194)?ue.state:"on",an=(null===(c=null==ee?void 0:ee.entities)||void 0===c?void 0:c.aux_connected_status)?je.state:"on",rn=(null===(v=null==ee?void 0:ee.entities)||void 0===v?void 0:v.load_frequency_192)?re.state:0,hn=(null===(_=null==ee?void 0:ee.entities)||void 0===_?void 0:_.inverter_voltage_154)?ae.state:0,dn=(null===(y=null==ee?void 0:ee.entities)||void 0===y?void 0:y.inverter_current_164)?he.state:0,pn=(null===(w=null==ee?void 0:ee.entities)||void 0===w?void 0:w.battery_voltage_183)?ce.state:0,cn=null===(g=null==ee?void 0:ee.grid)||void 0===g?void 0:g.additional_loads;"no"!==cn&&"one"!==cn&&"two"!==cn&&(cn="no");let vn=(null===(x=null==ee?void 0:ee.grid)||void 0===x?void 0:x.show_daily_buy)||"no",_n=(null===(m=null==ee?void 0:ee.grid)||void 0===m?void 0:m.show_daily_sell)||"no",yn=(null===(f=null==ee?void 0:ee.battery)||void 0===f?void 0:f.colour)||"pink",wn=(null===(u=null==ee?void 0:ee.battery)||void 0===u?void 0:u.show_daily)||"no",gn=(null===(q=null==ee?void 0:ee.solar)||void 0===q?void 0:q.colour)||"orange",xn=(null===(T=null==ee?void 0:ee.solar)||void 0===T?void 0:T.show_daily)||"no",mn=null===(k=null==ee?void 0:ee.load)||void 0===k?void 0:k.show_aux;"no"!==mn&&"yes"!==mn&&(mn="no");let fn=null===(M=null==ee?void 0:ee.load)||void 0===M?void 0:M.additional_loads;"no"!==fn&&"one"!==fn&&"two"!==fn&&(fn="no");let un=(null===(A=null==ee?void 0:ee.load)||void 0===A?void 0:A.aux_type)||"default",qn=(null===(H=null==ee?void 0:ee.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Tn=(null===(b=null==ee?void 0:ee.grid)||void 0===b?void 0:b.load1_icon)||"default",kn=(null===(Z=null==ee?void 0:ee.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Mn=(null===(L=null==ee?void 0:ee.load)||void 0===L?void 0:L.load1_icon)||"default",An=(null===(E=null==ee?void 0:ee.load)||void 0===E?void 0:E.load2_icon)||"default",Hn=ee.entities.remaining_solar?parseFloat(Fe.state).toFixed(1):"false",bn=(null==ee?void 0:ee.large_font)||"no",Zn=(null==ee?void 0:ee.panel_mode)||"no",Ln=(null===(P=null==ee?void 0:ee.inverter)||void 0===P?void 0:P.colour)||"grey",En=(null===(V=null==ee?void 0:ee.inverter)||void 0===V?void 0:V.autarky)||"power",Pn="no"!==(null==ee?void 0:ee.entities.use_timer_248)&&(null==ee?void 0:ee.entities.use_timer_248)?He.state:"no",Vn="no"!==(null==ee?void 0:ee.entities.priority_load_243)&&(null==ee?void 0:ee.entities.priority_load_243)?Ae.state:"no",In="yes"===(null===(I=null==ee?void 0:ee.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(_e.state):parseInt(_e.state),Cn=(null==ee?void 0:ee.card_height)||"396px",Bn=(null===(C=null==ee?void 0:ee.battery)||void 0===C?void 0:C.full_capacity)||80,Fn=(null===(B=null==ee?void 0:ee.battery)||void 0===B?void 0:B.empty_capacity)||30,Sn=parseInt(parseFloat(de.state||"0").toFixed(0))+parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(Pe.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0)),Rn=(null===(F=null==ee?void 0:ee.entities)||void 0===F?void 0:F.pv_total)?parseInt(Qe.state):Sn,Dn="none"!==(null==ee?void 0:ee.entities.essential_power)&&(null==ee?void 0:ee.entities.essential_power)?parseInt(ye.state):parseInt(Te.state)+parseInt(ke.state)-parseInt(Me.state),Nn="none"!==(null==ee?void 0:ee.entities.nonessential_power)&&(null==ee?void 0:ee.entities.nonessential_power)?parseInt(Ce.state):parseInt(we.state)-parseInt(ke.state);const $n={time:this.hass.states[ee.entities.prog1_time]||{state:""},capacity:this.hass.states[ee.entities.prog1_capacity]||{state:""},charge:this.hass.states[ee.entities.prog1_charge]||{state:""}},Yn={time:this.hass.states[ee.entities.prog2_time]||{state:""},capacity:this.hass.states[ee.entities.prog2_capacity]||{state:""},charge:this.hass.states[ee.entities.prog2_charge]||{state:""}},Un={time:this.hass.states[ee.entities.prog3_time]||{state:""},capacity:this.hass.states[ee.entities.prog3_capacity]||{state:""},charge:this.hass.states[ee.entities.prog3_charge]||{state:""}},zn={time:this.hass.states[ee.entities.prog4_time]||{state:""},capacity:this.hass.states[ee.entities.prog4_capacity]||{state:""},charge:this.hass.states[ee.entities.prog4_charge]||{state:""}},On={time:this.hass.states[ee.entities.prog5_time]||{state:""},capacity:this.hass.states[ee.entities.prog5_capacity]||{state:""},charge:this.hass.states[ee.entities.prog5_charge]||{state:""}},Qn={time:this.hass.states[ee.entities.prog6_time]||{state:""},capacity:this.hass.states[ee.entities.prog6_capacity]||{state:""},charge:this.hass.states[ee.entities.prog6_charge]||{state:""}};let jn={capacity:ee.battery.shutdown_soc,entityID:""};if(ee.entities.use_timer_248&&"no"!==ee.entities.use_timer_248&&"off"!==He.state)if(ee.entities.prog1_time&&ee.entities.prog2_time&&ee.entities.prog3_time&&ee.entities.prog4_time&&ee.entities.prog5_time&&ee.entities.prog6_time){jn.show="yes";const ws=new Date,gs=[];[$n,Yn,Un,zn,On,Qn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));gs[e]=new Date(ws.getTime()),gs[e].setHours(n),gs[e].setMinutes(s)}));const[xs,ms,fs,us,qs,Ts]=gs;function ks(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?jn.charge="none":jn.charge="both",jn.capacity=parseInt(t.capacity.state),jn.entityID=e}ws>=Ts||ws=xs&&ws=ms&&ws=fs&&ws=us&&ws=qs&&ws0?Wn="off"===ue.state||"no"===jn.show||parseInt(ve.state)<=jn.capacity?ee.battery.shutdown_soc:jn.capacity:In<0&&("off"===ue.state||"no"===jn.show||parseInt(ve.state)>=jn.capacity?Wn=100:parseInt(ve.state)0?Gn=(parseInt(ve.state)-Wn)/100*(ee.battery.energy||15960)/In*60*60:In<0&&(Gn=(Wn-parseInt(ve.state))/100*ee.battery.energy/In*60*60*-1);const Ms=new Date,As=1e3*Gn,Hs=new Date(Ms.getTime()+As),bs=Hs.getHours(),Zs=Hs.getMinutes().toString().padStart(2,"0"),Ls=bs.toString().padStart(2,"0");Xn="".concat(Ls,":").concat(Zs);const Es=Math.floor(Gn/86400),Ps=Math.floor(Gn%86400/3600),Vs=Math.floor(Gn%3600/60);Es>0&&(Kn+="".concat(Es," days, ")),(Ps>0||Es>0)&&(Kn+="".concat(Ps," hrs, ")),Kn+="".concat(Vs," min")}let Jn=-2<=parseInt(Be.state)&&parseInt(Be.state)<=2&&parseInt(ve.state)>=99?"True":"False",ts="",es="";switch(qe.state){case"0":case"standby":ts="blue",es="Standby";break;case"1":case"selftest":ts="yellow",es="Selftest";break;case"2":case"normal":case"ok":ts="green",es="Normal";break;case"3":case"alarm":ts="orange",es="Alarm";break;case"4":case"fault":ts="red",es="Fault";break;default:"none"!==(null===(S=null==ee?void 0:ee.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ee?void 0:ee.entities)||void 0===R?void 0:R.inverter_status_59)?(ts="transparent",es="Status"):(ts="transparent",es="")}let ns=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ss=(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=0!=ss?Math.min(Math.round(100*ns/ss),100):0,os=0!=ns?Math.min(Math.round(100*ss/ns),100):0,ls=Sn+parseInt("".concat(In>0?In:0))+parseInt("".concat(We<0?-1*We:0)),as=Dn+Nn+parseInt("".concat(We>0?We:0))+parseInt("".concat(In<0?-1*In:0)),rs=0!=as?Math.min(Math.round(100*ls/as),100):0,hs=0!=ls?Math.min(Math.round(100*as/ls),100):0,ds=(null===($=null==ee?void 0:ee.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ee&&ee.solar&&ee.solar.animation_speed){let Is=ee.solar.animation_speed-(ee.solar.animation_speed-1)*(Sn/(ee.solar.max_power||Sn));ds="".concat(Is>=1?Is:1)}let ps=(null===(Y=null==ee?void 0:ee.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ee&&ee.battery&&ee.battery.animation_speed){let Cs=ee.battery.animation_speed-(ee.battery.animation_speed-1)*((In<0?-1*In:In)/(ee.battery.max_power||(In<0?-1*In:In)));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(U=null==ee?void 0:ee.load)||void 0===U?void 0:U.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Bs=ee.load.animation_speed-(ee.load.animation_speed-1)*(Dn/(ee.load.max_power||Dn));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(z=null==ee?void 0:ee.load)||void 0===z?void 0:z.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Fs=ee.load.animation_speed-(ee.load.animation_speed-1)*((parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))/(ee.load.max_power||(parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(O=null==ee?void 0:ee.grid)||void 0===O?void 0:O.animation_speed)||"8";if(ee&&ee.grid&&ee.grid.animation_speed){let Ss=ee.grid.animation_speed-(ee.grid.animation_speed-1)*((parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))/(ee.grid.max_power||(parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(Q=null==ee?void 0:ee.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ee&&ee.grid&&ee.grid.animation_speed){let Rs=ee.grid.animation_speed-(ee.grid.animation_speed-1)*(Nn/(ee.grid.max_power||Nn));ys="".concat(Rs>=1?Rs:1)}return"full"===ee.cardstyle?D(_t||(_t=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n DAILY LOAD\n DAILY LOAD\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY GRID BUY\n DAILY GRID SELL\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ke,Ke,Je,tn,nn,nn,"no"===Zn?"".concat(Cn):"100%",gn,"no"===ee.show_solar?"st12":"",yn,nn,nn,Je,"no"===mn?"st12":"",Ke,Ln,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",nn,"no"===on?"st12":"","one"===cn?"":"none",nn,"no"===on?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","no"===mn?"30":"143",Ke,"one"===fn?"":"none","no"===mn?"376":"373","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===mn?"413":"410","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===bn?"st14":"st4",!1===ee.battery.show||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,!1===ee.battery.show||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||"False"===Jn?"transparent":"".concat(yn),"no"===ee.show_solar?"none":"",gn,(null===(j=null==ee?void 0:ee.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(W=null==ee?void 0:ee.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(G=null==ee?void 0:ee.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(X=null==ee?void 0:ee.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ee.solar.pv4_name):"PV4",nn,Ln,es,"one"!==fn&&"two"!==fn||"yes"!==mn?"":"none",Ke,"no"===fn||"no"===mn?"none":"",Ke,"no"===mn?"70":"181","one"===fn?"":"none",Ke,(null===(K=null==ee?void 0:ee.load)||void 0===K?void 0:K.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"47":"158","one"===fn?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"393":"390","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(J=null==ee?void 0:ee.load)||void 0===J?void 0:J.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"394":"391","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"429":"426","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(tt=null==ee?void 0:ee.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ee.load.load2_name):"","no"===mn?"430":"427","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),"no"===en||"no"===mn?"transparent":"".concat(Ke),"no"===fn?"83%":"67%","no"===fn?"18.5%":"24.25%","no"===en||"yes"===mn?"transparent":"".concat(Ke),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===on?"68%":"76%","no"===on?"96%":"66%","no"===vn?"transparent":"".concat(nn),"no"===on?"68%":"76%","no"===on?"88%":"58%","no"===_n?"transparent":"".concat(nn),"no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),(null===(et=null==ee?void 0:ee.load)||void 0===et?void 0:et.aux_name)?"".concat(ee.load.aux_name):"Auxiliary","no"===on?"none":"",nn,(null===(nt=null==ee?void 0:ee.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ee.grid.nonessential_name):"Non Essential","no"===on||"no"===cn||"two"===cn?"none":"",nn,(null===(st=null==ee?void 0:ee.grid)||void 0===st?void 0:st.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(it=null==ee?void 0:ee.grid)||void 0===it?void 0:it.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(ot=null==ee?void 0:ee.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ee.grid.load2_name):"","no"===on||"no"===cn||"two"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,ts,"yes"===mn?"":"none","one"===fn||"two"===fn?"":"st12",Ke,"no"===mn?"":"none","one"===fn?"":"st12",Ke,"no"===mn?"":"none","two"===fn?"":"st12",Ke,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s/2,Ge>0||0===Ge?"transparent":"".concat(nn),_s/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys,"no"===mn?"st12":"",Je,"no"===mn||0===We?"st12":"",We<0?"transparent":"".concat(Je),vs,"no"===mn||0===We?"st12":"",We>0?"transparent":"".concat(Je),vs,"no"===mn?"st12":"",Je,nn,Ln,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,Ln,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?"1":"0",yn,parseInt(ve.state)<=Fn?1:0,yn,"no"===ee.show_solar?"st12":"",gn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,"default"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"oven"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"boiler"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"pump"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"aircon"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"no"===on||"two"===cn||"one"===cn?"none":"",qn,"default"===Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"===Tn&&"default"!=kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"!=Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"no"===on||"no"===cn||"one"===cn?"none":"",Tn,"no"===on||"no"===cn||"one"===cn?"none":"",kn,"default"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"no"===on||"no"===cn||"two"===cn?"none":"",Tn,"one"!==fn&&"two"!==fn||"no"!==mn?"none":"",Ke,"one"!==fn&&"two"!==fn||"yes"!==mn?"none":"",Ke,"one"===fn||"two"===fn?"none":"",Ke,(t=>this.handlePopup(t,ee.entities.aux_connected_status)),"default"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"gen"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"inverter"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"oven"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"boiler"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"aircon"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"pump"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"no"===mn?"none":"",un,"on"===an||"1"===an?"aux-icon":"aux-off-icon","boiler"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"no"===fn||"one"===fn?"none":"","yes"===mn?"350":"383","yes"===mn?"140":"5",Mn,"no"===fn||"one"===fn?"none":"","yes"===mn?"446":"420","yes"===mn?"140":"5",An,"no"===fn||"two"===fn?"none":"","336","yes"===mn?"140":"27",Mn,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"no"!=En?"60.5%":"65%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"60.5%":"65%","off"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","off"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"off"!==ze.state&&"0"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"on"!==ze.state&&"1"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"no"!=En?"65.5%":"70%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"65.5%":"70%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===en||"no"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===fn?"83%":"67%","no"===fn?"15%":"21%","no"===en||"yes"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===on?"68%":"76%","no"===on?"92.5%":"62.5%","no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===on?"68%":"76%","no"===on?"84.25%":"54.5%","no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(null===(lt=null==ee?void 0:ee.entities)||void 0===lt?void 0:lt.pv_total)?N(yt||(yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(wt||(wt=e([' '," W "])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.essential_power?N(gt||(gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||"0"):N(xt||(xt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0),"none"!==ee.entities.nonessential_power?N(mt||(mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.nonessential_power)),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0):N(ft||(ft=e([''," W "])),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0),(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,"none"!==ee.entities.aux_power_166?N(ut||(ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.aux_power_166)),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We):N(qt||(qt=e([''," W "])),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We),"none"!==ee.entities.pv1_power_186?N(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(kt||(kt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(At||(At=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(bt||(bt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Lt||(Lt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none","no"===bn?"st14":"st4",nn,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none","no"===bn?"st14":"st4",nn,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none","no"===bn?"st14":"st4",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.inverter_power_175)),"none"===ee.entities.inverter_power_175?"none":"","no"===bn?"st14":"st4",Ln,Te.state||0,(t=>this.handlePopup(t,ee.entities.grid_power_169)),"none"===ee.entities.grid_power_169?"none":"","no"===bn?"st14":"st4",nn,ke.state||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(at=null==ee?void 0:ee.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"four"===(null===(rt=null==ee?void 0:ee.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%","four"===(null===(ht=null==ee?void 0:ee.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(dt=null==ee?void 0:ee.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(pt=null==ee?void 0:ee.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(ct=null==ee?void 0:ee.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",Ue.state||""):"lite"===ee.cardstyle?D(Et||(Et=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY LOAD\n DAILY GRID BUY\n DAILY GRID SELL\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ke,"no"===ee.show_solar?145.33:-.5,"no"===ee.show_solar?270.67:406,"".concat("no"===Zn?"no"===ee.show_solar?"246px":"".concat(Cn):"no"===ee.show_solar?"75%":"100%"),Ke,gn,"no"===ee.show_solar?"st12":"",yn,nn,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",Ke,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",!1===ee.battery.show||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,!1===ee.battery.show||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||"False"===Jn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"two"===fn?"365":"400.4","two"===fn?"182.2":"282.1","no"===en?"transparent":"".concat(Ke),"no"===vn?"transparent":"".concat(nn),"no"===_n?"transparent":"".concat(nn),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===ee.show_solar?"none":"",gn,(null===(vt=null==ee?void 0:ee.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(Ut=null==ee?void 0:ee.solar)||void 0===Ut?void 0:Ut.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(zt=null==ee?void 0:ee.solar)||void 0===zt?void 0:zt.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(Ot=null==ee?void 0:ee.solar)||void 0===Ot?void 0:Ot.pv4_name)?"".concat(ee.solar.pv4_name):"PV4","no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Qt=null==ee?void 0:ee.load)||void 0===Qt?void 0:Qt.load1_name)?"".concat(ee.load.load1_name):"","one"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(jt=null==ee?void 0:ee.load)||void 0===jt?void 0:jt.load1_name)?"".concat(ee.load.load1_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Wt=null==ee?void 0:ee.load)||void 0===Wt?void 0:Wt.load2_name)?"".concat(ee.load.load2_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),ts,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,0===Dn?"transparent":"".concat(Ke),cs,"one"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"oven"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"no"===fn||"no"===ee.show_solar?"none":"",Mn,"no"===fn||"one"===fn||"no"===ee.show_solar?"none":"",An,"no"===ee.show_solar?"st12":"",gn,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?1:0,yn,parseInt(ve.state)<=Fn?1:0,yn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,Ke,Ln,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"on"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"on"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"off"!==ze.state&&"0"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"on"!==ze.state&&"1"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"two"===fn?"365":"400.4","two"===fn?"168":"267.9","no"===en?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none",Ln,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none",Ln,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(Gt=null==ee?void 0:ee.entities)||void 0===Gt?void 0:Gt.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(Xt=null==ee?void 0:ee.entities)||void 0===Xt?void 0:Xt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(Kt=null==ee?void 0:ee.entities)||void 0===Kt?void 0:Kt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(Jt=null==ee?void 0:ee.entities)||void 0===Jt?void 0:Jt.energy_cost)?"":"none",Ue.state||"",(null===(te=null==ee?void 0:ee.entities)||void 0===te?void 0:te.pv_total)?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(Vt||(Vt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ee.entities.essential_power?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||0):N(Yt||(Yt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error("Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple");if(!t.show_solar)throw Error("Please include the show_solar attribute e.g. show_solar: yes");if(!t.battery)throw Error("No battery attributes defined");if(!t.battery.energy)throw new Error("Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320");if(!t.battery.shutdown_soc)throw new Error("Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20");if(t.battery.full_capacity<80)throw new Error("Full capacity needs to be between 80 and 100");if(t.battery.empty_capacity>30)throw new Error("Empty capacity needs to be <= 30");if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error("Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs");if("yes"===t.show_solar&&!t.solar)throw Error("No solar attributes defined");if("yes"===t.show_solar&&!t.solar.mppts)throw Error("Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two");if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error("Please include the day_pv_energy_108 attribute and entity ID");if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error("Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs");if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error("The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.");if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error("The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.");const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));this._config=t}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen"})})); diff --git a/package.json b/package.json new file mode 100644 index 00000000..8a6959cb --- /dev/null +++ b/package.json @@ -0,0 +1,55 @@ +{ + "name": "sunsynk-power-flow-card", + "version": "2.0.0", + "description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.", + "main": "sunsynk-power-flow-card.js", + "scripts": { + "lint": "eslint src/*.ts | more ", + "lintindex": "eslint src/index.ts | more", + "lintindexfix": "eslint src/index.ts --fix", + "lintfixall": "eslint src/*.ts --fix", + "rollup": "rollup -c", + "build": "rollup -c --bundleConfigAsCjs", + "watch": "rollup -c --watch --config rollup-dev.config.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/slipx06/sunsynk-power-flow-card.git" + }, + "author": "marksie1988 ", + "license": "MIT", + "bugs": { + "url": "https://github.com/slipx06/sunsynk-power-flow-card/issues" + }, + "homepage": "https://github.com/slipx06/sunsynk-power-flow-card#readme", + "dependencies": { + "custom-card-helpers": "^1.9.0", + "lit": "^2.8.0", + "npm": "^9.8.1", + "typescript": "^5.1.6" + }, + "devDependencies": { + "@babel/cli": "^7.22.10", + "@babel/core": "^7.22.10", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-proposal-decorators": "^7.22.10", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/preset-env": "^7.22.10", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-commonjs": "^25.0.4", + "@rollup/plugin-eslint": "^9.0.4", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-node-resolve": "^15.1.0", + "@rollup/plugin-terser": "^0.4.3", + "@typescript-eslint/eslint-plugin": "^6.3.0", + "@typescript-eslint/parser": "^6.3.0", + "babel-preset-minify": "^0.5.2", + "eslint": "^8.47.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0", + "prettier": "^3.0.1", + "rollup": "^3.28.0", + "rollup-plugin-serve": "^2.0.2", + "rollup-plugin-typescript2": "^0.35.0" + } +} diff --git a/rollup.config.mjs b/rollup.config.mjs new file mode 100644 index 00000000..300cddf6 --- /dev/null +++ b/rollup.config.mjs @@ -0,0 +1,64 @@ +import typescript from 'rollup-plugin-typescript2'; +import commonjs from '@rollup/plugin-commonjs'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import babel from '@rollup/plugin-babel'; +import terser from "@rollup/plugin-terser"; +import json from '@rollup/plugin-json'; +import eslint from '@rollup/plugin-eslint'; + +const plugins = [ + nodeResolve({ + jsnext: true, + main: true, + }), + eslint(), + commonjs(), + typescript(), + json(), + babel({ + exclude: 'node_modules/**', + babelHelpers: 'bundled', + compact: true, + extensions: [ + '.js', + '.ts', + ], + presets: [ + [ + '@babel/env', + { + "modules": false, + "targets": "> 2.5%, not dead" + } + ], + ], + plugins: [ + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + [ + "@babel/plugin-proposal-class-properties" + ], + [ + "@babel/plugin-transform-template-literals" + ] + ] + }), + terser() +]; + +export default { + input: ['./src/index.ts'], + output: { + file: 'dist/sunsynk-power-flow-card.js', + format: 'umd', + name: 'SunsynkPowerFlowCard', + }, + watch: { + clearScreen: false, + }, + plugins: [...plugins], +}; diff --git a/src/const.ts b/src/const.ts new file mode 100644 index 00000000..fb4f0736 --- /dev/null +++ b/src/const.ts @@ -0,0 +1,3 @@ +import { version } from '../package.json'; + +export const CARD_VERSION = version; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..50ee7011 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,1391 @@ +import { LitElement, html, TemplateResult, CSSResultGroup, svg } from 'lit'; +import { customElement, property } from 'lit/decorators.js'; +import { HomeAssistant } from 'custom-card-helpers'; +import { styles } from './style'; +import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; +import { CARD_VERSION } from './const'; + + +console.groupCollapsed( + `%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v${CARD_VERSION} `, + 'color: orange; font-weight: bold; background: black', + 'color: white; font-weight: bold; background: dimgray', +); +console.log("Readme:", "https://github.com/slipx06/sunsynk-power-flow-card"), +console.groupEnd(); + +@customElement('sunsynk-power-flow-card') +export class SunsynkPowerFlowCard extends LitElement { + @property() public hass!: HomeAssistant; + @property() private _config!: sunsynkPowerFlowCardConfig; + + static get styles(): CSSResultGroup { + return styles; + } + + static getStubConfig() { + return { + cardstyle: 'lite', + show_solar: 'yes', + battery: { + energy: 15960, + shutdown_soc: 20, + show_daily: 'yes', + }, + solar: { + show_daily: 'yes', + mppts: 'two', + }, + load: { + show_daily: 'yes', + }, + grid: { + show_daily_buy: 'yes', + show_daily_sell: 'no', + show_nonessential: 'yes', + }, + entities: { + use_timer_248: 'switch.sunsynk_toggle_system_timer', + priority_load_243: 'switch.sunsynk_toggle_priority_load', + inverter_voltage_154: 'sensor.sunsynk_inverter_voltage', + load_frequency_192: 'sensor.sunsynk_load_frequency', + inverter_current_164: 'sensor.sunsynk_inverter_current', + inverter_power_175: 'sensor.sunsynk_inverter_power', + grid_connected_status_194: 'binary_sensor.sunsynk_grid_connected_status', + inverter_status_59: 'sensor.sunsynk_overall_state', + day_battery_charge_70: 'sensor.sunsynk_day_battery_charge', + day_battery_discharge_71: 'sensor.sunsynk_day_battery_discharge', + battery_voltage_183: 'sensor.sunsynk_battery_voltage', + battery_soc_184: 'sensor.sunsynk_battery_soc', + battery_power_190: 'sensor.sunsynk_battery_power', + battery_current_191: 'sensor.sunsynk_battery_current', + grid_power_169: 'sensor.sunsynk_grid_power', + day_grid_import_76: 'sensor.sunsynk_day_grid_import', + day_grid_export_77: 'sensor.sunsynk_day_grid_export', + grid_ct_power_172: 'sensor.sunsynk_grid_ct_power', + day_load_energy_84: 'sensor.sunsynk_day_load_energy', + essential_power: 'none', + nonessential_power: 'none', + aux_power_166: 'sensor.sunsynk_aux_power', + day_pv_energy_108: 'sensor.sunsynk_day_pv_energy', + pv1_power_186: 'sensor.sunsynk_pv1_power', + pv2_power_187: 'sensor.sunsynk_pv2_power', + pv1_voltage_109: 'sensor.sunsynk_pv1_voltage', + pv1_current_110: 'sensor.sunsynk_pv1_current', + pv2_voltage_111: 'sensor.sunsynk_pv2_voltage', + pv2_current_112: 'sensor.sunsynk_pv2_current', + } + }; + } + + render() { + const config = this._config; + const stateObj = this.hass.states[config.entities.day_battery_discharge_71] || { state: '0' }; + const stateObj1 = this.hass.states[config.entities.day_battery_charge_70] || { state: '0' }; + const stateObj2 = this.hass.states[config.entities.day_load_energy_84] || { state: '0' }; + const stateObj3 = this.hass.states[config.entities.day_grid_import_76] || { state: '0' }; + const stateObj4 = this.hass.states[config.entities.day_pv_energy_108] || { state: '0' }; + const stateObj5 = this.hass.states[config.entities.inverter_voltage_154] || { state: '0' }; + const stateObj6 = this.hass.states[config.entities.load_frequency_192] || { state: '0' }; + const stateObj7 = this.hass.states[config.entities.inverter_current_164] || { state: '0' }; + const stateObj8 = this.hass.states[config.entities.pv2_power_187] || { state: '0' }; + const stateObj9 = this.hass.states[config.entities.pv1_power_186] || { state: '0' }; + const stateObj11 = this.hass.states[config.entities.battery_voltage_183] || { state: '0' }; + const stateObj12 = this.hass.states[config.entities.battery_soc_184] || { state: '0' }; + const stateObj13 = this.hass.states[config.entities.battery_power_190] || { state: '0' }; + const stateObj14 = this.hass.states[config.entities.essential_power] || { state: '0' }; + const stateObj15 = this.hass.states[config.entities.grid_ct_power_172] || { state: '0' }; + const stateObj16 = this.hass.states[config.entities.pv1_voltage_109] || { state: '0' }; + const stateObj17 = this.hass.states[config.entities.pv1_current_110] || { state: '0' }; + const stateObj18 = this.hass.states[config.entities.pv2_voltage_111] || { state: '0' }; + const stateObj19 = this.hass.states[config.entities.pv2_current_112] || { state: '0' }; + const stateObj20 = this.hass.states[config.entities.grid_connected_status_194] || { state: 'on' }; + const stateObj21 = this.hass.states[config.entities.inverter_status_59] || { state: '' }; + const stateObj22 = this.hass.states[config.entities.inverter_power_175] || { state: '0' }; + const stateObj23 = this.hass.states[config.entities.grid_power_169] || { state: '0' }; + const stateObj24 = this.hass.states[config.entities.aux_power_166] || { state: '0' }; + const stateObj25 = this.hass.states[config.entities.priority_load_243] || { state: 'undefined' }; + const stateObj26 = this.hass.states[config.entities.use_timer_248] || { state: 'undefined' }; + const stateObj27 = this.hass.states[config.entities.pv3_voltage_113] || { state: '0' }; + const stateObj28 = this.hass.states[config.entities.pv3_current_114] || { state: '0' }; + const stateObj29 = this.hass.states[config.entities.pv4_voltage_115] || { state: '0' }; + const stateObj30 = this.hass.states[config.entities.pv4_current_116] || { state: '0' }; + const stateObj31 = this.hass.states[config.entities.pv3_power_188] || { state: '0' }; + const stateObj32 = this.hass.states[config.entities.pv4_power_189] || { state: '0' }; + const stateObj33 = this.hass.states[config.entities.day_grid_export_77] || { state: '0' }; + const stateObj34 = this.hass.states[config.entities.nonessential_power] || { state: '0' }; + const stateObj35 = this.hass.states[config.entities.battery_current_191] || { state: '0' }; + const stateObj36 = this.hass.states[config.entities.remaining_solar] || { state: '0' }; + const stateObj37 = this.hass.states[config.entities.battery_temp_182] || { state: '' }; + const stateObj38 = this.hass.states[config.entities.dc_transformer_temp_90] || { state: '' }; + const stateObj39 = this.hass.states[config.entities.radiator_temp_91] || { state: '' }; + const stateObj40 = this.hass.states[config.entities.non_essential_load1] || { state: '0' }; + const stateObj41 = this.hass.states[config.entities.non_essential_load2] || { state: '0' }; + const stateObj42 = this.hass.states[config.entities.essential_load1] || { state: '0' }; + const stateObj43 = this.hass.states[config.entities.energy_cost] || { state: '' }; + const stateObj44 = this.hass.states[config.entities.solar_sell_247] || { state: 'undefined' }; + const stateObj45 = this.hass.states[config.entities.essential_load2] || { state: '0' }; + const stateObj46 = this.hass.states[config.entities.pv_total] || { state: '0' }; + const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; + + //Set defaults + let invert_aux = config?.load?.invert_aux || 'no'; + let aux_power = (invert_aux === 'yes') ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); + let invert_grid = config?.grid?.invert_grid || 'no'; + let grid_power = (invert_grid === 'yes') ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); + let inverter_modern = config?.inverter?.modern || 'yes'; + let load_colour = config?.load?.colour || '#5fb6ad'; + let aux_colour = config?.load?.aux_colour || load_colour; + let aux_off_colour = config?.load?.aux_off_colour || load_colour; + let load_showdaily = config?.load?.show_daily || 'no'; + let grid_colour = config?.grid?.colour || '#5490c2'; + let no_grid_colour = config?.grid?.no_grid_colour || '#a40013'; + let grid_show_noness = config?.grid?.show_nonessential || 'yes'; + let grid_status = config?.entities?.grid_connected_status_194 ? stateObj20.state : 'on'; + let aux_status = config?.entities?.aux_connected_status ? stateObj47.state : 'on'; + let load_frequency = config?.entities?.load_frequency_192 ? stateObj6.state : 0; + let inverter_voltage = config?.entities?.inverter_voltage_154 ? stateObj5.state : 0; + let inverter_current = config?.entities?.inverter_current_164 ? stateObj7.state : 0; + let battery_voltage = config?.entities?.battery_voltage_183 ? stateObj11.state : 0; + + let noness_dual_load = config?.grid?.additional_loads; + if (noness_dual_load !== 'no' && noness_dual_load !== 'one' && noness_dual_load !== 'two') { + noness_dual_load = 'no'; + } + + let grid_showdailybuy = config?.grid?.show_daily_buy || 'no'; + let grid_showdailysell = config?.grid?.show_daily_sell || 'no'; + let battery_colour = config?.battery?.colour || 'pink'; + let battery_showdaily = config?.battery?.show_daily || 'no'; + let solar_colour = config?.solar?.colour || 'orange'; + let solar_showdaily = config?.solar?.show_daily || 'no'; + + let show_aux = config?.load?.show_aux; + if (show_aux !== 'no' && show_aux !== 'yes') { + show_aux = 'no'; + } + + let additional_load = config?.load?.additional_loads; + if (additional_load !== 'no' && additional_load !== 'one' && additional_load !== 'two') { + additional_load = 'no'; + } + + let aux_type = config?.load?.aux_type || 'default'; //valid options are gen,inverter, default, gen, boiler, pump, aircon + let nonessential_icon = config?.grid?.nonessential_icon || 'default'; //valid options are default, oven, boiler, pump, aircon + let load1_icon = config?.grid?.load1_icon || 'default'; //valid options are default, oven, boiler, pump + let load2_icon = config?.grid?.load2_icon || 'default'; //valid options are default, oven, boiler, pump + let load1e_icon = config?.load?.load1_icon || 'default'; //valid options are boiler, aircon, pump + let load2e_icon = config?.load?.load2_icon || 'default'; //valid options are boiler, aircon, pump + let remaining_solar = config.entities.remaining_solar ? parseFloat(stateObj36.state).toFixed(1) : 'false'; + let font = config?.large_font || 'no'; + let panel = config?.panel_mode || 'no'; + let inverter_colour = config?.inverter?.colour || 'grey'; + let useautarky = config?.inverter?.autarky || 'power'; + let usetimer = (config?.entities.use_timer_248 === 'no' || !config?.entities.use_timer_248) ? 'no' : stateObj26.state; + let priority = (config?.entities.priority_load_243 === 'no' || !config?.entities.priority_load_243) ? 'no' : stateObj25.state; + let battery_power = (config?.battery?.invert_power === 'yes') ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); + let height = config?.card_height || '396px' + let bat_full = config?.battery?.full_capacity || 80 + let bat_empty = config?.battery?.empty_capacity || 30 + //let width = config?.card_width || '100%' + + //totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + let totalsolar = ( + parseInt(parseFloat(stateObj8.state || '0').toFixed(0)) + + parseInt(parseFloat(stateObj9.state || '0').toFixed(0)) + + parseInt(parseFloat(stateObj31.state || '0').toFixed(0)) + + parseInt(parseFloat(stateObj32.state || '0').toFixed(0)) + ); + + let total_pv = config?.entities?.pv_total ? parseInt(stateObj46.state) : totalsolar; + + //essential = inverter_power_175 + grid_power_169 - aux_power_166 + let essential = (config?.entities.essential_power === 'none' || !config?.entities.essential_power) ? + parseInt(stateObj22.state) + parseInt(stateObj23.state) - parseInt(stateObj24.state) : + parseInt(stateObj14.state); + + //nonessential = grid_ct_power_172 - grid_power_169 + let nonessential = (config?.entities.nonessential_power === 'none' || !config?.entities.nonessential_power) ? + parseInt(stateObj15.state) - parseInt(stateObj23.state) : + parseInt(stateObj34.state); + + //Timer entities + const prog1 = { + time: this.hass.states[config.entities.prog1_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog1_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog1_charge] || { state: '' } + }; + const prog2 = { + time: this.hass.states[config.entities.prog2_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog2_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog2_charge] || { state: '' } + }; + const prog3 = { + time: this.hass.states[config.entities.prog3_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog3_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog3_charge] || { state: '' } + }; + const prog4 = { + time: this.hass.states[config.entities.prog4_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog4_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog4_charge] || { state: '' } + }; + const prog5 = { + time: this.hass.states[config.entities.prog5_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog5_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog5_charge] || { state: '' } + }; + const prog6 = { + time: this.hass.states[config.entities.prog6_time] || { state: '' }, + capacity: this.hass.states[config.entities.prog6_capacity] || { state: '' }, + charge: this.hass.states[config.entities.prog6_charge] || { state: '' } + }; + + let inverter_prog: inverterProg = { + capacity: config.battery.shutdown_soc, + entityID: '' + }; + if (!config.entities.use_timer_248 || config.entities.use_timer_248 === 'no' || stateObj26.state === 'off') { + inverter_prog.show = 'no'; + } else if (!config.entities.prog1_time + || !config.entities.prog2_time + || !config.entities.prog3_time + || !config.entities.prog4_time + || !config.entities.prog5_time + || !config.entities.prog6_time + ) { + inverter_prog.show = 'no'; + } else { + inverter_prog.show = 'yes'; + + const timer_now = new Date(); // Create a new Date object representing the current time + + const progTimes: Date[] = []; + + [prog1, prog2, prog3, prog4, prog5, prog6].forEach((prog, index) => { + const [hours, minutes] = prog.time.state.split(":").map(function (item) { + return parseInt(item, 10); + }); + progTimes[index] = new Date(timer_now.getTime()); + progTimes[index].setHours(hours); + progTimes[index].setMinutes(minutes); + }); + + const [prog_time1, prog_time2, prog_time3, prog_time4, prog_time5, prog_time6] = progTimes; + + if (timer_now >= prog_time6 || timer_now < prog_time1) { + assignInverterProgValues(prog6, config.entities.prog6_charge); + } else if (timer_now >= prog_time1 && timer_now < prog_time2) { + assignInverterProgValues(prog1, config.entities.prog1_charge); + } else if (timer_now >= prog_time2 && timer_now < prog_time3) { + assignInverterProgValues(prog2, config.entities.prog2_charge); + } else if (timer_now >= prog_time3 && timer_now < prog_time4) { + assignInverterProgValues(prog3, config.entities.prog3_charge); + } else if (timer_now >= prog_time4 && timer_now < prog_time5) { + assignInverterProgValues(prog4, config.entities.prog4_charge); + } else if (timer_now >= prog_time5 && timer_now < prog_time6) { + assignInverterProgValues(prog5, config.entities.prog5_charge); + } + + function assignInverterProgValues(prog, entityID) { + if (prog.charge.state === 'No Grid or Gen' || prog.charge.state === '0' || prog.charge.state === 'off') { + inverter_prog.charge = 'none'; + } else { + inverter_prog.charge = 'both'; + } + inverter_prog.capacity = parseInt(prog.capacity.state); + inverter_prog.entityID = entityID; + } + } + + //calculate battery capacity + let battery_capacity: number = 0; + if (battery_power > 0) { + if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) <= inverter_prog.capacity) { + battery_capacity = config.battery.shutdown_soc; + } else { + battery_capacity = inverter_prog.capacity; + } + } else if (battery_power < 0) { + if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) >= inverter_prog.capacity) { + battery_capacity = 100; + } else if (parseInt(stateObj12.state) < inverter_prog.capacity) { + battery_capacity = inverter_prog.capacity; + } + } + + //calculate remaining battery time to charge or discharge + let totalSeconds = 0; + let formattedResultTime = ""; + let duration = ""; + + if (config.battery.show === true) { + if (battery_power === 0) { + totalSeconds = (((parseInt(stateObj12.state) - config.battery.shutdown_soc) / 100) * (config.battery.energy || 15960)) / 1 * 60 * 60; + } else if (battery_power > 0) { + totalSeconds = (((parseInt(stateObj12.state) - battery_capacity) / 100) * (config.battery.energy || 15960)) / battery_power * 60 * 60; + } else if (battery_power < 0) { + totalSeconds = ((((battery_capacity - parseInt(stateObj12.state)) / 100) * config.battery.energy) / battery_power) * 60 * 60 * -1; + } + const currentTime = new Date(); // Create a new Date object representing the current time + const durationMilliseconds = totalSeconds * 1000; // Convert the duration to milliseconds + const resultTime = new Date(currentTime.getTime() + durationMilliseconds); // Add the duration in milliseconds + const resultHours = resultTime.getHours(); // Get the hours component of the resulting time + const resultMinutes = resultTime.getMinutes(); // Get the minutes component of the resulting time + const formattedMinutes = resultMinutes.toString().padStart(2, "0"); + const formattedHours = resultHours.toString().padStart(2, "0"); + formattedResultTime = `${formattedHours}:${formattedMinutes}`; + + const days = Math.floor(totalSeconds / (60 * 60 * 24)); + const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60)); + const minutes = Math.floor((totalSeconds % (60 * 60)) / 60); + if (days > 0) { + duration += `${days} days, `; + } + if (hours > 0 || days > 0) { + duration += `${hours} hrs, `; + } + duration += `${minutes} min`; + } + + let float = (-2 <= parseInt(stateObj35.state)) && (parseInt(stateObj35.state) <= 2) && (parseInt(stateObj12.state) >= 99) ? "True" : "False"; + + //Set Inverter Status Message and dot + let inverterStateColour = ""; + let inverterStateMsg = ""; + + switch (stateObj21.state) { + case '0': + case 'standby': + inverterStateColour = 'blue'; + inverterStateMsg = 'Standby'; + break; + case '1': + case 'selftest': + inverterStateColour = 'yellow'; + inverterStateMsg = 'Selftest'; + break; + case '2': + case 'normal': + case 'ok': + inverterStateColour = 'green'; + inverterStateMsg = 'Normal'; + break; + case '3': + case 'alarm': + inverterStateColour = 'orange'; + inverterStateMsg = 'Alarm'; + break; + case '4': + case 'fault': + inverterStateColour = 'red'; + inverterStateMsg = 'Fault'; + break; + default: + if (config?.entities?.inverter_status_59 === 'none' || !config?.entities?.inverter_status_59) { + inverterStateColour = 'transparent'; + inverterStateMsg = ''; + } else { + inverterStateColour = 'transparent'; + inverterStateMsg = 'Status'; + } + break; + } + + //Autarky in Percent = Home Production / Home Consumption + //Ratio in Percent = Home Consumption / Home Production + //let production_e = parseFloat(stateObj4.state) + parseFloat(stateObj.state); + //let consumption_e = parseFloat(stateObj2.state) + parseFloat(stateObj1.state); + let production_e = ( + (isNaN(parseFloat(stateObj4.state)) ? 0 : parseFloat(stateObj4.state)) + + (isNaN(parseFloat(stateObj.state)) ? 0 : parseFloat(stateObj.state)) + ); + let consumption_e = ( + (isNaN(parseFloat(stateObj2.state)) ? 0 : parseFloat(stateObj2.state)) + + (isNaN(parseFloat(stateObj1.state)) ? 0 : parseFloat(stateObj1.state)) + ); + let Autarky = consumption_e != 0 ? Math.min(Math.round((production_e * 100) / consumption_e), 100) : 0; + let Ratio = production_e != 0 ? Math.min(Math.round((consumption_e * 100) / production_e), 100) : 0; + + let production_p = totalsolar + parseInt(`${battery_power > 0 ? battery_power : 0}`) + parseInt(`${aux_power < 0 ? aux_power * -1 : 0}`); + let consumption_p = essential + nonessential + parseInt(`${aux_power > 0 ? aux_power : 0}`) + parseInt(`${battery_power < 0 ? battery_power * -1 : 0}`); + let Autarkyp = consumption_p != 0 ? Math.min(Math.round((production_p * 100) / consumption_p), 100) : 0; + let Ratiop = production_p != 0 ? Math.min(Math.round((consumption_p * 100) / production_p), 100) : 0; + + //Calculate power use animation speeds depending on Inverter size + let solar_animation_speed = config?.solar?.animation_speed || "9"; + if (config && config.solar && config.solar.animation_speed) { + let speed = config.solar.animation_speed - ((config.solar.animation_speed - 1) * (totalsolar / (config.solar.max_power || totalsolar))); + solar_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + let battery_animation_speed = config?.battery?.animation_speed || "6"; + if (config && config.battery && config.battery.animation_speed) { + let speed = config.battery.animation_speed - ((config.battery.animation_speed - 1) * ((battery_power < 0 ? battery_power * -1 : battery_power) / (config.battery.max_power || (battery_power < 0 ? battery_power * -1 : battery_power)))); + battery_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + let load_animation_speed = config?.load?.animation_speed || "4"; + if (config && config.load && config.load.animation_speed) { + let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * (essential / (config.load.max_power || essential))); + load_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + let aux_animation_speed = config?.load?.animation_speed || "4"; + if (config && config.load && config.load.animation_speed) { + let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * ((parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state)) / (config.load.max_power || (parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state))))); + aux_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + let grid_animation_speed = config?.grid?.animation_speed || "8"; + if (config && config.grid && config.grid.animation_speed) { + let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * ((parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state)) / (config.grid.max_power || (parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state))))); + grid_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + let ne_animation_speed = config?.grid?.animation_speed || "4"; + if (config && config.grid && config.grid.animation_speed) { + let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * (nonessential / (config.grid.max_power || nonessential))); + ne_animation_speed = `${speed >= 1 ? speed : 1}`; + } + + if (config.cardstyle === 'full') { + return html` + + +
+ + + + + + + + + + + + + + + + + + + + + + ${duration} + RUNTIME TO ${battery_capacity}% @${formattedResultTime} + TO ${battery_capacity}% CHARGE @${formattedResultTime} + BATTERY FLOATING + ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + Grid + ${inverterStateMsg} + Essential + Essential + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + DAILY LOAD + DAILY LOAD + DAILY SOLAR + DAILY SOLAR / LEFT TODAY + DAILY CHARGE + DAILY DISCHARGE + DAILY GRID BUY + DAILY GRID SELL + ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} + ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + Ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this.handlePopup(e, config.entities.grid_connected_status_194)}> + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + +
+ +
+ +
+
+ + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + this.handlePopup(e, config.entities.aux_connected_status)}> + + + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + +
+ +
+ +
+
+ + + + +
+ +
+ +
+
+ + this.handlePopup(e, config.entities.use_timer_248)}> + + + Timer On + Timer Off + + this.handlePopup(e, config.entities.solar_sell_247)}> + + + + this.handlePopup(e, config.entities.priority_load_243)}> + + + Priority Load + Priority Batt + + + + this.handlePopup(e, inverter_prog.entityID)}> + + + + this.handlePopup(e, config.entities.day_pv_energy_108)}> + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_pv_energy_108)}> + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + + this.handlePopup(e, config.entities.day_load_energy_84)}> + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_load_energy_84)}> + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_battery_charge_70)}> + ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_battery_discharge_71)}> + ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_grid_import_76)}> + ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_grid_export_77)}> + ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + + + ${config?.entities?.pv_total + ? svg` this.handlePopup(e, config.entities.pv_total)}> + ${total_pv || 0} W + ` + : svg` ${total_pv || 0} W `} + + ${config.entities.essential_power !== 'none' + ? svg` this.handlePopup(e, config.entities.essential_power)}> + ${essential || '0'} W + ` + : svg`${essential || 0} W`} + ${config.entities.nonessential_power !== 'none' + ? svg` this.handlePopup(e, config.entities.nonessential_power)}> + ${nonessential || 0} W + ` + : svg`${nonessential || 0} W `} + this.handlePopup(e, config.entities.grid_ct_power_172)}> + ${grid_power || 0} W + + ${config.entities.aux_power_166 !== 'none' + ? svg` this.handlePopup(e, config.entities.aux_power_166)}> + ${aux_power < 0 ? aux_power * -1 : aux_power} W + ` + : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} + ${config.entities.pv1_power_186 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> + ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + ${config.entities.pv2_power_187 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> + ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + ${config.entities.pv3_power_188 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> + ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + ${config.entities.pv4_power_189 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> + ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + this.handlePopup(e, config.entities.inverter_voltage_154)}> + ${inverter_voltage} V + + this.handlePopup(e, config.entities.load_frequency_192)}> + ${load_frequency} Hz + + this.handlePopup(e, config.entities.inverter_current_164)}> + ${inverter_current} A + + this.handlePopup(e, config.entities.battery_voltage_183)}> + ${battery_voltage} V + + this.handlePopup(e, config.entities.battery_soc_184)}> + ${parseInt(stateObj12.state) || 0} % + + this.handlePopup(e, config.entities.battery_soc_184)}> + | ${inverter_prog.capacity || 0} % + + this.handlePopup(e, config.entities.battery_power_190)}> + ${battery_power < 0 ? battery_power * -1 : battery_power} W + + this.handlePopup(e, config.entities.battery_current_191)}> + ${stateObj35.state || 0} A + + this.handlePopup(e, config.entities.inverter_power_175)}> + ${stateObj22.state || 0} W + + this.handlePopup(e, config.entities.grid_power_169)}> + ${stateObj23.state || 0} W + + this.handlePopup(e, config.entities.pv1_voltage_109)}> + ${stateObj16.state || 0} V + + this.handlePopup(e, config.entities.pv1_current_110)}> + ${stateObj17.state || 0} A + + this.handlePopup(e, config.entities.pv2_voltage_111)}> + ${stateObj18.state || 0} V + + this.handlePopup(e, config.entities.pv2_current_112)}> + ${stateObj19.state || 0} A + + this.handlePopup(e, config.entities.pv3_voltage_113)}> + ${stateObj27.state || 0} V + + this.handlePopup(e, config.entities.pv3_current_114)}> + ${stateObj28.state || 0} A + + this.handlePopup(e, config.entities.pv4_voltage_115)}> + ${stateObj29.state || 0} V + + this.handlePopup(e, config.entities.pv4_current_116)}> + ${stateObj30.state || 0} A + + this.handlePopup(e, config.entities.battery_temp_182)}> + ${stateObj37.state || ''}° + + this.handlePopup(e, config.entities.radiator_temp_91)}> + AC: ${stateObj39.state || ''}° + + this.handlePopup(e, config.entities.dc_transformer_temp_90)}> + DC: ${stateObj38.state || ''}° + + this.handlePopup(e, config.entities.energy_cost)}> + ${stateObj43.state || ''} + +
+
+
+ `; + } + + if (config.cardstyle === 'lite') { + return html` + + +
+ + + + + + + + + + + + + + ${duration} + RUNTIME TO ${battery_capacity}% @${formattedResultTime} + TO ${battery_capacity}% CHARGE @${formattedResultTime} + BATTERY FLOATING + DAILY CHARGE + DAILY DISCHARGE + DAILY LOAD + DAILY GRID BUY + DAILY GRID SELL + DAILY SOLAR + DAILY SOLAR / LEFT TODAY + ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + Ratio + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + +
+ +
+ +
+
+ + + + + + + this.handlePopup(e, config.entities.grid_connected_status_194)}> + + + + + + this.handlePopup(e, config.entities.use_timer_248)}> + + + Timer off + Timer on + + this.handlePopup(e, config.entities.priority_load_243)}> + + + Priority Batt + Priority Load + + this.handlePopup(e, config.entities.solar_sell_247)}> + + + + + this.handlePopup(e, inverter_prog.entityID)}> + + + + this.handlePopup(e, config.entities.day_battery_charge_70)}> + ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_pv_energy_108)}> + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_pv_energy_108)}> + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + + this.handlePopup(e, config.entities.day_battery_discharge_71)}> + ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_load_energy_84)}> + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_grid_import_76)}> + ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.day_grid_export_77)}> + ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + + this.handlePopup(e, config.entities.inverter_voltage_154)}> + ${inverter_voltage} V + + this.handlePopup(e, config.entities.load_frequency_192)}> + ${load_frequency} Hz + + this.handlePopup(e, config.entities.inverter_current_164)}> + ${inverter_current} A + + this.handlePopup(e, config.entities.battery_voltage_183)}> + ${battery_voltage} V + + this.handlePopup(e, config.entities.battery_soc_184)}> + ${parseInt(stateObj12.state) || 0} % + + this.handlePopup(e, config.entities.battery_soc_184)}> + | ${inverter_prog.capacity || 0} % + + this.handlePopup(e, config.entities.battery_power_190)}> + ${battery_power < 0 ? battery_power * -1 : battery_power} W + + this.handlePopup(e, config.entities.battery_current_191)}> + ${stateObj35.state || 0} A + + this.handlePopup(e, config.entities.grid_ct_power_172)}> + ${grid_power || 0} W + + this.handlePopup(e, config.entities.pv1_voltage_109)}> + ${stateObj16.state || 0} V + + this.handlePopup(e, config.entities.pv1_current_110)}> + ${stateObj17.state || 0} A + + this.handlePopup(e, config.entities.pv2_voltage_111)}> + ${stateObj18.state || 0} V + + this.handlePopup(e, config.entities.pv2_current_112)}> + ${stateObj19.state || 0} A + + this.handlePopup(e, config.entities.pv3_voltage_113)}> + ${stateObj27.state || 0} V + + this.handlePopup(e, config.entities.pv3_current_114)}> + ${stateObj28.state || 0} A + + this.handlePopup(e, config.entities.pv4_voltage_115)}> + ${stateObj29.state || 0} V + + this.handlePopup(e, config.entities.pv4_current_116)}> + ${stateObj30.state || 0} A + + this.handlePopup(e, config.entities.battery_temp_182)}> + ${stateObj37.state || ''}° + + this.handlePopup(e, config.entities.radiator_temp_91)}> + AC: ${stateObj39.state || ''}° + + this.handlePopup(e, config.entities.dc_transformer_temp_90)}> + DC: ${stateObj38.state || ''}° + + this.handlePopup(e, config.entities.energy_cost)}> + ${stateObj43.state || ''} + + ${config?.entities?.pv_total + ? svg` this.handlePopup(e, config.entities.pv_total)}> + ${total_pv || 0} W + ` + : svg`${total_pv || 0} W`} + ${config.entities.pv1_power_186 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> + ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + ${config.entities.pv2_power_187 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> + ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + ${config.entities.pv3_power_188 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> + ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + ${config.entities.pv4_power_189 !== 'none' + ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> + ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ` + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + ${config.entities.essential_power !== 'none' + ? svg` this.handlePopup(e, config.entities.essential_power)}> + ${essential || 0} W + ` + : svg`${essential || 0} W`} +
+
+
+ `; + } + } + + setConfig(config) { + if (!config.cardstyle) { + throw Error('Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple'); + } + if (!config.show_solar) { + throw Error('Please include the show_solar attribute e.g. show_solar: yes'); + } + if (!config.battery) { + throw Error('No battery attributes defined'); + } else { + if (!config.battery.energy) { + throw new Error('Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320'); + } + if (!config.battery.shutdown_soc) { + throw new Error('Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20'); + } + if (config.battery.full_capacity < 80) { + throw new Error('Full capacity needs to be between 80 and 100'); + } + if (config.battery.empty_capacity > 30) { + throw new Error('Empty capacity needs to be <= 30'); + } + if (config.battery.show_daily === 'yes' && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71)) { + throw Error('Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs'); + } + } + if (config.show_solar === 'yes' && !config.solar) { + throw Error('No solar attributes defined'); + } else { + if (config.show_solar === 'yes' && !config.solar.mppts) { + throw Error('Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two'); + } + if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.day_pv_energy_108) { + throw Error('Please include the day_pv_energy_108 attribute and entity ID'); + } + } + + if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.day_grid_export_77)) { + throw Error('Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs'); + } + + if ((config && config.entities && config.entities.essential_power === 'none' && !config.entities.inverter_power_175) || (config && config.entities && config.entities.essential_power === 'none' && config.entities.inverter_power_175 === 'none')) { + throw Error('The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.'); + } + + if ((config && config.entities && config.entities.nonessential_power === 'none' && !config.entities.grid_power_169)) { + throw Error('The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.'); + } + + const all_attributes = [ + 'battery_soc_184', 'battery_power_190', 'battery_current_191', 'grid_ct_power_172' + ]; + + for (const attr of all_attributes) { + if (!config.entities[attr]) { + throw new Error(`Please include the ${attr} attribute and entity ID e.g. ${attr}: sensor.example`); + } + } + + const solar_attributes = [ + 'pv1_power_186' + ]; + + for (const attr1 of solar_attributes) { + if (config.show_solar === 'yes' && !config.entities[attr1]) { + throw new Error(`Please include the ${attr1} attribute and entity ID e.g. ${attr1}: sensor.example`); + } + } + + this._config = config; + } + + handlePopup(e, entity) { + e.stopPropagation(); + const entityId = entity; + //console.log(entity); + this._handleClick(this, { action: "more-info" }, entityId); + } + + _handleClick(node, actionConfig, entityId) { + let e; + // eslint-disable-next-line default-case + switch (actionConfig.action) { + case "more-info": { + e = new Event("hass-more-info", { composed: true }); + e.detail = { entityId }; + node.dispatchEvent(e); + break; + } + } + } + + + getCardSize() { + return 2; + } +} + +(window as any).customCards = (window as any).customCards || []; +(window as any).customCards.push({ + type: "sunsynk-power-flow-card", + name: "Sunsynk Power Flow Card", + preview: false, // Optional - defaults to false + description: "A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen", // Optional +}); diff --git a/src/style.ts b/src/style.ts new file mode 100644 index 00000000..3e40a81f --- /dev/null +++ b/src/style.ts @@ -0,0 +1,41 @@ +import { CSSResultGroup, css } from "lit"; + +export const styles: CSSResultGroup = css` + .container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; + padding: 5px; + } + + .card { + border-radius: var(--ha-card-border-radius, 10px); + box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12)); + background: var(--ha-card-background, var(--card-background-color, white)); + border-width: var(--ha-card-border-width); + padding: 0px; + } + + text { text-anchor: middle; alignment-baseline: middle; } + + .left-align {text-anchor: start;} + .right-align {text-anchor: end;} + .st1{fill:#ff9b30;} + .st2{fill:#f3b3ca;} + .st3{font-size:9px;} + .st4{font-size:14px;} + .st5{fill:#969696;} + .st6{fill:#5fb6ad;} + .st7{fill:#5490c2;} + .st8{font-weight:500} + .st9{fill:#959595;} + .st10{font-size:16px;} + .st11{fill:transparent;} + .st12{display:none;} + .st13{font-size:22px;} + .st14{font-size:12px;} + + `; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 00000000..3a7b748c --- /dev/null +++ b/src/types.ts @@ -0,0 +1,29 @@ +import { LovelaceCard, LovelaceCardConfig } from "custom-card-helpers"; + +declare global { + interface HTMLElementTagNameMap { + 'sunsynk-power-flow-card': LovelaceCard; + } +} + +export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { + battery: { + show: boolean; + energy: number; + shutdown_soc: number; + invert_power: string; + colour: string; + show_daily: string; + animation_speed: number; + max_power: number; + full_capacity: number; + empty_capacity: number; + } +} + +export interface inverterProg { + entityID: string; + show?: string; + charge?: string; + capacity: number; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..42d55379 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es2017", + "module": "esnext", + "moduleResolution": "node", + "lib": [ + "es2017", + "dom", + "dom.iterable" + ], + "noEmit": true, + "noUnusedParameters": true, + "noImplicitReturns": false, + "noFallthroughCasesInSwitch": true, + "strict": true, + "noImplicitAny": false, + "skipLibCheck": true, + "resolveJsonModule": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + }, + "include": [ + "src/*" + ] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..e1f7850d --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4757 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + +"@ampproject/remapping@^2.2.0": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/cli@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.22.10.tgz#25e4bbd8d0a0d8b4b389e1b5e2d7a238bd4c1b75" + integrity sha512-rM9ZMmaII630zGvtMtQ3P4GyHs28CHLYE9apLG7L8TgaSqcfoIGrlLSLsh4Q8kDTdZQQEXZm1M0nQtOvU/2heg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.17" + commander "^4.0.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.1.0" + glob "^7.2.0" + make-dir "^2.1.0" + slash "^2.0.0" + optionalDependencies: + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" + chokidar "^3.4.0" + +"@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3" + integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA== + dependencies: + "@babel/highlight" "^7.22.10" + chalk "^2.4.2" + +"@babel/compat-data@^7.22.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" + integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== + +"@babel/core@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.10.tgz#aad442c7bcd1582252cb4576747ace35bc122f35" + integrity sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.22.10" + "@babel/generator" "^7.22.10" + "@babel/helper-compilation-targets" "^7.22.10" + "@babel/helper-module-transforms" "^7.22.9" + "@babel/helpers" "^7.22.10" + "@babel/parser" "^7.22.10" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.10" + "@babel/types" "^7.22.10" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.1" + +"@babel/generator@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" + integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A== + dependencies: + "@babel/types" "^7.22.10" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.10.tgz#573e735937e99ea75ea30788b57eb52fab7468c9" + integrity sha512-Av0qubwDQxC56DoUReVDeLfMEjYYSN1nZrTUrWkXd7hpU73ymRANkbuDm3yni9npkn+RXy9nNbEJZEzXr7xrfQ== + dependencies: + "@babel/types" "^7.22.10" + +"@babel/helper-compilation-targets@^7.22.10", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz#01d648bbc25dd88f513d862ee0df27b7d4e67024" + integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.5" + browserslist "^4.21.9" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.22.10", "@babel/helper-create-class-features-plugin@^7.22.5": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.10.tgz#dd2612d59eac45588021ac3d6fa976d08f4e95a3" + integrity sha512-5IBb77txKYQPpOEdUdIhBx8VrZyDCQ+H82H0+5dX1TmuscP5vJKEE3cKurjtIw/vFwzbVH48VweE78kVDBrqjA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz#9d8e61a8d9366fe66198f57c40565663de0825f6" + integrity sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + regexpu-core "^5.3.1" + semver "^6.3.1" + +"@babel/helper-define-polyfill-provider@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz#82c825cadeeeee7aad237618ebbe8fa1710015d7" + integrity sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw== + dependencies: + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + +"@babel/helper-environment-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" + integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== + +"@babel/helper-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" + integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== + dependencies: + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-member-expression-to-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" + integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" + integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" + integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.5" + +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.22.5", "@babel/helper-remap-async-to-generator@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz#53a25b7484e722d7efb9c350c75c032d4628de82" + integrity sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-wrap-function" "^7.22.9" + +"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779" + integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" + integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== + +"@babel/helper-validator-option@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" + integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== + +"@babel/helper-wrap-function@^7.22.9": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.10.tgz#d845e043880ed0b8c18bd194a12005cb16d2f614" + integrity sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.10" + +"@babel/helpers@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.10.tgz#ae6005c539dfbcb5cd71fb51bfc8a52ba63bc37a" + integrity sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw== + dependencies: + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.10" + "@babel/types" "^7.22.10" + +"@babel/highlight@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.10.tgz#02a3f6d8c1cb4521b2fd0ab0da8f4739936137d7" + integrity sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ== + dependencies: + "@babel/helper-validator-identifier" "^7.22.5" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.22.10", "@babel/parser@^7.22.5": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55" + integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" + integrity sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz#fef09f9499b1f1c930da8a0c419db42167d792ca" + integrity sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.5" + +"@babel/plugin-proposal-class-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-decorators@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.22.10.tgz#d6a8c3a9018e1b13e6647f869c5ea56ff2b585d4" + integrity sha512-KxN6TqZzcFi4uD3UifqXElBTBNLAEH1l3vzMQj6JwJZbL2sZlThxSViOKCYY+4Ah4V4JhQ95IVB7s/Y6SJSlMQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.10" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/plugin-syntax-decorators" "^7.22.10" + +"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-decorators@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.22.10.tgz#7d83ea04d893c442b78ebf4c3cbac59a7211deff" + integrity sha512-z1KTVemBjnz+kSEilAsI4lbkPOl5TvJH7YDSY1CTIzvLWJ+KHXp+mRe8VPmfnyvqOPqar1V2gid2PleKzRUstQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + +"@babel/plugin-syntax-import-assertions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz#07d252e2aa0bc6125567f742cd58619cb14dce98" + integrity sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-attributes@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz#ab840248d834410b829f569f5262b9e517555ecb" + integrity sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-meta@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-arrow-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz#e5ba566d0c58a5b2ba2a8b795450641950b71958" + integrity sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-async-generator-functions@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.10.tgz#45946cd17f915b10e65c29b8ed18a0a50fc648c8" + integrity sha512-eueE8lvKVzq5wIObKK/7dvoeKJ+xc6TvRn6aysIjS6pSCeLy7S/eVi7pEQknZqyqvzaNKdDtem8nUNTBgDVR2g== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-transform-async-to-generator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz#c7a85f44e46f8952f6d27fe57c2ed3cc084c3775" + integrity sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ== + dependencies: + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.5" + +"@babel/plugin-transform-block-scoped-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz#27978075bfaeb9fa586d3cb63a3d30c1de580024" + integrity sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-block-scoping@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.10.tgz#88a1dccc3383899eb5e660534a76a22ecee64faa" + integrity sha512-1+kVpGAOOI1Albt6Vse7c8pHzcZQdQKW+wJH+g8mCaszOdDVwRXa/slHPqIw+oJAJANTKDMuM2cBdV0Dg618Vg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz#97a56e31ad8c9dc06a0b3710ce7803d5a48cca77" + integrity sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-static-block@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz#3e40c46f048403472d6f4183116d5e46b1bff5ba" + integrity sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-transform-classes@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.6.tgz#e04d7d804ed5b8501311293d1a0e6d43e94c3363" + integrity sha512-58EgM6nuPNG6Py4Z3zSuu0xWu2VfodiMi72Jt5Kj2FECmaYk1RrTXA45z6KBFsu9tRgwQDwIiY4FXTt+YsSFAQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" + integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.5" + +"@babel/plugin-transform-destructuring@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.10.tgz#38e2273814a58c810b6c34ea293be4973c4eb5e2" + integrity sha512-dPJrL0VOyxqLM9sritNbMSGx/teueHF/htMKrPT7DNxccXxRDPYqlgPFFdr8u+F+qUZOkZoXue/6rL5O5GduEw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-dotall-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz#dbb4f0e45766eb544e193fb00e65a1dd3b2a4165" + integrity sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-duplicate-keys@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz#b6e6428d9416f5f0bba19c70d1e6e7e0b88ab285" + integrity sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-dynamic-import@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz#d6908a8916a810468c4edff73b5b75bda6ad393e" + integrity sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-transform-exponentiation-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz#402432ad544a1f9a480da865fda26be653e48f6a" + integrity sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-export-namespace-from@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz#57c41cb1d0613d22f548fddd8b288eedb9973a5b" + integrity sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + +"@babel/plugin-transform-for-of@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" + integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" + integrity sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg== + dependencies: + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-json-strings@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz#14b64352fdf7e1f737eed68de1a1468bd2a77ec0" + integrity sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" + +"@babel/plugin-transform-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" + integrity sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-logical-assignment-operators@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz#66ae5f068fd5a9a5dc570df16f56c2a8462a9d6c" + integrity sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-transform-member-expression-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz#4fcc9050eded981a468347dd374539ed3e058def" + integrity sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-modules-amd@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz#4e045f55dcf98afd00f85691a68fc0780704f526" + integrity sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ== + dependencies: + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-modules-commonjs@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" + integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== + dependencies: + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + +"@babel/plugin-transform-modules-systemjs@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz#18c31410b5e579a0092638f95c896c2a98a5d496" + integrity sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ== + dependencies: + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" + +"@babel/plugin-transform-modules-umd@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz#4694ae40a87b1745e3775b6a7fe96400315d4f98" + integrity sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ== + dependencies: + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" + integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-new-target@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz#1b248acea54ce44ea06dfd37247ba089fcf9758d" + integrity sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz#f8872c65776e0b552e0849d7596cddd416c3e381" + integrity sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-transform-numeric-separator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz#57226a2ed9e512b9b446517ab6fa2d17abb83f58" + integrity sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-transform-object-rest-spread@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz#9686dc3447df4753b0b2a2fae7e8bc33cdc1f2e1" + integrity sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ== + dependencies: + "@babel/compat-data" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.22.5" + +"@babel/plugin-transform-object-super@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz#794a8d2fcb5d0835af722173c1a9d704f44e218c" + integrity sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + +"@babel/plugin-transform-optional-catch-binding@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz#842080be3076703be0eaf32ead6ac8174edee333" + integrity sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-transform-optional-chaining@^7.22.10", "@babel/plugin-transform-optional-chaining@^7.22.5": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.10.tgz#076d28a7e074392e840d4ae587d83445bac0372a" + integrity sha512-MMkQqZAZ+MGj+jGTG3OTuhKeBpNcO+0oCEbrGNEaOmiEn+1MzRyQlYsruGiU8RTK3zV6XwrVJTmwiDOyYK6J9g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-transform-parameters@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz#c3542dd3c39b42c8069936e48717a8d179d63a18" + integrity sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-methods@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz#21c8af791f76674420a147ae62e9935d790f8722" + integrity sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-property-in-object@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz#07a77f28cbb251546a43d175a1dda4cf3ef83e32" + integrity sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-transform-property-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz#b5ddabd73a4f7f26cd0e20f5db48290b88732766" + integrity sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-regenerator@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz#8ceef3bd7375c4db7652878b0241b2be5d0c3cca" + integrity sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + regenerator-transform "^0.15.2" + +"@babel/plugin-transform-reserved-words@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz#832cd35b81c287c4bcd09ce03e22199641f964fb" + integrity sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-shorthand-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz#6e277654be82b5559fc4b9f58088507c24f0c624" + integrity sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-spread@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" + integrity sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + +"@babel/plugin-transform-sticky-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz#295aba1595bfc8197abd02eae5fc288c0deb26aa" + integrity sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-template-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" + integrity sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-typeof-symbol@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" + integrity sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-escapes@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz#c723f380f40a2b2f57a62df24c9005834c8616d9" + integrity sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-property-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz#098898f74d5c1e86660dc112057b2d11227f1c81" + integrity sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz#ce7e7bb3ef208c4ff67e02a22816656256d7a183" + integrity sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-sets-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz#77788060e511b708ffc7d42fdfbc5b37c3004e91" + integrity sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/preset-env@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.10.tgz#3263b9fe2c8823d191d28e61eac60a79f9ce8a0f" + integrity sha512-riHpLb1drNkpLlocmSyEg4oYJIQFeXAK/d7rI6mbD0XsvoTOOweXDmQPG/ErxsEhWk3rl3Q/3F6RFQlVFS8m0A== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-compilation-targets" "^7.22.10" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.5" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.5" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.22.5" + "@babel/plugin-syntax-import-attributes" "^7.22.5" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.22.5" + "@babel/plugin-transform-async-generator-functions" "^7.22.10" + "@babel/plugin-transform-async-to-generator" "^7.22.5" + "@babel/plugin-transform-block-scoped-functions" "^7.22.5" + "@babel/plugin-transform-block-scoping" "^7.22.10" + "@babel/plugin-transform-class-properties" "^7.22.5" + "@babel/plugin-transform-class-static-block" "^7.22.5" + "@babel/plugin-transform-classes" "^7.22.6" + "@babel/plugin-transform-computed-properties" "^7.22.5" + "@babel/plugin-transform-destructuring" "^7.22.10" + "@babel/plugin-transform-dotall-regex" "^7.22.5" + "@babel/plugin-transform-duplicate-keys" "^7.22.5" + "@babel/plugin-transform-dynamic-import" "^7.22.5" + "@babel/plugin-transform-exponentiation-operator" "^7.22.5" + "@babel/plugin-transform-export-namespace-from" "^7.22.5" + "@babel/plugin-transform-for-of" "^7.22.5" + "@babel/plugin-transform-function-name" "^7.22.5" + "@babel/plugin-transform-json-strings" "^7.22.5" + "@babel/plugin-transform-literals" "^7.22.5" + "@babel/plugin-transform-logical-assignment-operators" "^7.22.5" + "@babel/plugin-transform-member-expression-literals" "^7.22.5" + "@babel/plugin-transform-modules-amd" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.22.5" + "@babel/plugin-transform-modules-systemjs" "^7.22.5" + "@babel/plugin-transform-modules-umd" "^7.22.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.22.5" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.5" + "@babel/plugin-transform-numeric-separator" "^7.22.5" + "@babel/plugin-transform-object-rest-spread" "^7.22.5" + "@babel/plugin-transform-object-super" "^7.22.5" + "@babel/plugin-transform-optional-catch-binding" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.10" + "@babel/plugin-transform-parameters" "^7.22.5" + "@babel/plugin-transform-private-methods" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.5" + "@babel/plugin-transform-property-literals" "^7.22.5" + "@babel/plugin-transform-regenerator" "^7.22.10" + "@babel/plugin-transform-reserved-words" "^7.22.5" + "@babel/plugin-transform-shorthand-properties" "^7.22.5" + "@babel/plugin-transform-spread" "^7.22.5" + "@babel/plugin-transform-sticky-regex" "^7.22.5" + "@babel/plugin-transform-template-literals" "^7.22.5" + "@babel/plugin-transform-typeof-symbol" "^7.22.5" + "@babel/plugin-transform-unicode-escapes" "^7.22.10" + "@babel/plugin-transform-unicode-property-regex" "^7.22.5" + "@babel/plugin-transform-unicode-regex" "^7.22.5" + "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" + "@babel/preset-modules" "0.1.6-no-external-plugins" + "@babel/types" "^7.22.10" + babel-plugin-polyfill-corejs2 "^0.4.5" + babel-plugin-polyfill-corejs3 "^0.8.3" + babel-plugin-polyfill-regenerator "^0.5.2" + core-js-compat "^3.31.0" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + +"@babel/regjsgen@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== + +"@babel/runtime@^7.8.4": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.10.tgz#ae3e9631fd947cb7e3610d3e9d8fef5f76696682" + integrity sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" + integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/traverse@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa" + integrity sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig== + dependencies: + "@babel/code-frame" "^7.22.10" + "@babel/generator" "^7.22.10" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.22.10" + "@babel/types" "^7.22.10" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.22.10", "@babel/types@^7.22.5", "@babel/types@^7.4.4": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.10.tgz#4a9e76446048f2c66982d1a989dd12b8a2d2dc03" + integrity sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" + to-fast-properties "^2.0.0" + +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" + integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== + +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@^8.47.0": + version "8.47.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.47.0.tgz#5478fdf443ff8158f9de171c704ae45308696c7d" + integrity sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og== + +"@formatjs/ecma402-abstract@1.11.4": + version "1.11.4" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz#b962dfc4ae84361f9f08fbce411b4e4340930eda" + integrity sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw== + dependencies: + "@formatjs/intl-localematcher" "0.2.25" + tslib "^2.1.0" + +"@formatjs/fast-memoize@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz#e6f5aee2e4fd0ca5edba6eba7668e2d855e0fc21" + integrity sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg== + dependencies: + tslib "^2.1.0" + +"@formatjs/icu-messageformat-parser@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz#a54293dd7f098d6a6f6a084ab08b6d54a3e8c12d" + integrity sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw== + dependencies: + "@formatjs/ecma402-abstract" "1.11.4" + "@formatjs/icu-skeleton-parser" "1.3.6" + tslib "^2.1.0" + +"@formatjs/icu-skeleton-parser@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz#4ce8c0737d6f07b735288177049e97acbf2e8964" + integrity sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg== + dependencies: + "@formatjs/ecma402-abstract" "1.11.4" + tslib "^2.1.0" + +"@formatjs/intl-localematcher@0.2.25": + version "0.2.25" + resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz#60892fe1b271ec35ba07a2eb018a2dd7bca6ea3a" + integrity sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA== + dependencies: + tslib "^2.1.0" + +"@formatjs/intl-utils@^3.8.4": + version "3.8.4" + resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-3.8.4.tgz#291baac91001db428fc3275c515a3e40fbe95945" + integrity sha512-j5C6NyfKevIxsfLK8KwO1C0vvP7k1+h4A9cFpc+cr6mEwCc1sPkr17dzh0Ke6k9U5pQccAQoXdcNBl3IYa4+ZQ== + dependencies: + emojis-list "^3.0.0" + +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + +"@isaacs/string-locale-compare@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b" + integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== + +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.3": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" + integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@lit-labs/ssr-dom-shim@^1.0.0", "@lit-labs/ssr-dom-shim@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.1.tgz#64df34e2f12e68e78ac57e571d25ec07fa460ca9" + integrity sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ== + +"@lit/reactive-element@^1.3.0", "@lit/reactive-element@^1.6.0": + version "1.6.3" + resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.6.3.tgz#25b4eece2592132845d303e091bad9b04cdcfe03" + integrity sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ== + dependencies: + "@lit-labs/ssr-dom-shim" "^1.0.0" + +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": + version "2.1.8-no-fsevents.3" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" + integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@npmcli/arborist@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-6.3.0.tgz#df37c79f7b82a2de8986fb9061b40efb4d188a38" + integrity sha512-XrS14qBDhK95RdGhjTSx8AgeZPNah949qp3b0v3GUFOugtPc9Z85rpWid57mONS8gHbuGIHjFzuA+5hSM7BuBA== + dependencies: + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/fs" "^3.1.0" + "@npmcli/installed-package-contents" "^2.0.2" + "@npmcli/map-workspaces" "^3.0.2" + "@npmcli/metavuln-calculator" "^5.0.0" + "@npmcli/name-from-folder" "^2.0.0" + "@npmcli/node-gyp" "^3.0.0" + "@npmcli/package-json" "^4.0.0" + "@npmcli/query" "^3.0.0" + "@npmcli/run-script" "^6.0.0" + bin-links "^4.0.1" + cacache "^17.0.4" + common-ancestor-path "^1.0.1" + hosted-git-info "^6.1.1" + json-parse-even-better-errors "^3.0.0" + json-stringify-nice "^1.1.4" + minimatch "^9.0.0" + nopt "^7.0.0" + npm-install-checks "^6.0.0" + npm-package-arg "^10.1.0" + npm-pick-manifest "^8.0.1" + npm-registry-fetch "^14.0.3" + npmlog "^7.0.1" + pacote "^15.0.8" + parse-conflict-json "^3.0.0" + proc-log "^3.0.0" + promise-all-reject-late "^1.0.0" + promise-call-limit "^1.0.2" + read-package-json-fast "^3.0.2" + semver "^7.3.7" + ssri "^10.0.1" + treeverse "^3.0.0" + walk-up-path "^3.0.1" + +"@npmcli/config@^6.2.1": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@npmcli/config/-/config-6.2.1.tgz#954cc09b727b6bfc087cb1d2a48994dc342e45cc" + integrity sha512-Cj/OrSbrLvnwWuzquFCDTwFN8QmR+SWH6qLNCBttUreDkKM5D5p36SeSMbcEUiCGdwjUrVy2yd8C0REwwwDPEw== + dependencies: + "@npmcli/map-workspaces" "^3.0.2" + ci-info "^3.8.0" + ini "^4.1.0" + nopt "^7.0.0" + proc-log "^3.0.0" + read-package-json-fast "^3.0.2" + semver "^7.3.5" + walk-up-path "^3.0.1" + +"@npmcli/disparity-colors@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/disparity-colors/-/disparity-colors-3.0.0.tgz#60ea8c6eb5ba9de2d1950e15b06205b2c3ab7833" + integrity sha512-5R/z157/f20Fi0Ou4ZttL51V0xz0EdPEOauFtPCEYOLInDBRCj1/TxOJ5aGTrtShxEshN2d+hXb9ZKSi5RLBcg== + dependencies: + ansi-styles "^4.3.0" + +"@npmcli/fs@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-3.1.0.tgz#233d43a25a91d68c3a863ba0da6a3f00924a173e" + integrity sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w== + dependencies: + semver "^7.3.5" + +"@npmcli/git@^4.0.0", "@npmcli/git@^4.0.1", "@npmcli/git@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-4.1.0.tgz#ab0ad3fd82bc4d8c1351b6c62f0fa56e8fe6afa6" + integrity sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ== + dependencies: + "@npmcli/promise-spawn" "^6.0.0" + lru-cache "^7.4.4" + npm-pick-manifest "^8.0.0" + proc-log "^3.0.0" + promise-inflight "^1.0.1" + promise-retry "^2.0.1" + semver "^7.3.5" + which "^3.0.0" + +"@npmcli/installed-package-contents@^2.0.1", "@npmcli/installed-package-contents@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz#bfd817eccd9e8df200919e73f57f9e3d9e4f9e33" + integrity sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ== + dependencies: + npm-bundled "^3.0.0" + npm-normalize-package-bin "^3.0.0" + +"@npmcli/map-workspaces@^3.0.2", "@npmcli/map-workspaces@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz#15ad7d854292e484f7ba04bc30187a8320dba799" + integrity sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg== + dependencies: + "@npmcli/name-from-folder" "^2.0.0" + glob "^10.2.2" + minimatch "^9.0.0" + read-package-json-fast "^3.0.0" + +"@npmcli/metavuln-calculator@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@npmcli/metavuln-calculator/-/metavuln-calculator-5.0.1.tgz#426b3e524c2008bcc82dbc2ef390aefedd643d76" + integrity sha512-qb8Q9wIIlEPj3WeA1Lba91R4ZboPL0uspzV0F9uwP+9AYMVB2zOoa7Pbk12g6D2NHAinSbHh6QYmGuRyHZ874Q== + dependencies: + cacache "^17.0.0" + json-parse-even-better-errors "^3.0.0" + pacote "^15.0.0" + semver "^7.3.5" + +"@npmcli/name-from-folder@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz#c44d3a7c6d5c184bb6036f4d5995eee298945815" + integrity sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg== + +"@npmcli/node-gyp@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz#101b2d0490ef1aa20ed460e4c0813f0db560545a" + integrity sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA== + +"@npmcli/package-json@^4.0.0", "@npmcli/package-json@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@npmcli/package-json/-/package-json-4.0.1.tgz#1a07bf0e086b640500791f6bf245ff43cc27fa37" + integrity sha512-lRCEGdHZomFsURroh522YvA/2cVb9oPIJrjHanCJZkiasz1BzcnLr3tBJhlV7S86MBJBuAQ33is2D60YitZL2Q== + dependencies: + "@npmcli/git" "^4.1.0" + glob "^10.2.2" + hosted-git-info "^6.1.1" + json-parse-even-better-errors "^3.0.0" + normalize-package-data "^5.0.0" + proc-log "^3.0.0" + semver "^7.5.3" + +"@npmcli/promise-spawn@^6.0.0", "@npmcli/promise-spawn@^6.0.1", "@npmcli/promise-spawn@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz#c8bc4fa2bd0f01cb979d8798ba038f314cfa70f2" + integrity sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg== + dependencies: + which "^3.0.0" + +"@npmcli/query@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/query/-/query-3.0.0.tgz#51a0dfb85811e04f244171f164b6bc83b36113a7" + integrity sha512-MFNDSJNgsLZIEBVZ0Q9w9K7o07j5N4o4yjtdz2uEpuCZlXGMuPENiRaFYk0vRqAA64qVuUQwC05g27fRtfUgnA== + dependencies: + postcss-selector-parser "^6.0.10" + +"@npmcli/run-script@^6.0.0", "@npmcli/run-script@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-6.0.2.tgz#a25452d45ee7f7fb8c16dfaf9624423c0c0eb885" + integrity sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA== + dependencies: + "@npmcli/node-gyp" "^3.0.0" + "@npmcli/promise-spawn" "^6.0.0" + node-gyp "^9.0.0" + read-package-json-fast "^3.0.0" + which "^3.0.0" + +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + +"@pkgr/utils@^2.3.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc" + integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw== + dependencies: + cross-spawn "^7.0.3" + fast-glob "^3.3.0" + is-glob "^4.0.3" + open "^9.1.0" + picocolors "^1.0.0" + tslib "^2.6.0" + +"@rollup/plugin-babel@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-6.0.3.tgz#07ccde15de278c581673034ad6accdb4a153dfeb" + integrity sha512-fKImZKppa1A/gX73eg4JGo+8kQr/q1HBQaCGKECZ0v4YBBv3lFqi14+7xyApECzvkLTHCifx+7ntcrvtBIRcpg== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@rollup/pluginutils" "^5.0.1" + +"@rollup/plugin-commonjs@^25.0.4": + version "25.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.4.tgz#a7547a0c4ec3fa79818eb313e1de0023e548f4e6" + integrity sha512-L92Vz9WUZXDnlQQl3EwbypJR4+DM2EbsO+/KOcEkP4Mc6Ct453EeDB2uH9lgRwj4w5yflgNpq9pHOiY8aoUXBQ== + dependencies: + "@rollup/pluginutils" "^5.0.1" + commondir "^1.0.1" + estree-walker "^2.0.2" + glob "^8.0.3" + is-reference "1.2.1" + magic-string "^0.27.0" + +"@rollup/plugin-eslint@^9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-eslint/-/plugin-eslint-9.0.4.tgz#be9c8d48318cdb213181cedfd8815d136ff1bc8a" + integrity sha512-JtXb8RFMsRB6pMsVAo7qR3wopb7XT7XlxnqQQk/5zdrhmCOgF/OoKBYWLzK0yaUXNfRZeuly9VLt6VgXIBrvkw== + dependencies: + "@rollup/pluginutils" "^5.0.1" + eslint "^8.24.0" + +"@rollup/plugin-json@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-6.0.0.tgz#199fea6670fd4dfb1f4932250569b14719db234a" + integrity sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w== + dependencies: + "@rollup/pluginutils" "^5.0.1" + +"@rollup/plugin-node-resolve@^15.1.0": + version "15.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.1.0.tgz#9ffcd8e8c457080dba89bb9fcb583a6778dc757e" + integrity sha512-xeZHCgsiZ9pzYVgAo9580eCGqwh/XCEUM9q6iQfGNocjgkufHAqC3exA+45URvhiYV8sBF9RlBai650eNs7AsA== + dependencies: + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" + deepmerge "^4.2.2" + is-builtin-module "^3.2.1" + is-module "^1.0.0" + resolve "^1.22.1" + +"@rollup/plugin-terser@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz#c2bde2fe3a85e45fa68a454d48f4e73e57f98b30" + integrity sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA== + dependencies: + serialize-javascript "^6.0.1" + smob "^1.0.0" + terser "^5.17.4" + +"@rollup/pluginutils@^4.1.2": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" + integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + +"@rollup/pluginutils@^5.0.1": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.3.tgz#183126d69aeb1cfa23401d5a71cb4b8c16c4a4e0" + integrity sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^2.3.1" + +"@sigstore/bundle@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@sigstore/bundle/-/bundle-1.1.0.tgz#17f8d813b09348b16eeed66a8cf1c3d6bd3d04f1" + integrity sha512-PFutXEy0SmQxYI4texPw3dd2KewuNqv7OuK1ZFtY2fM754yhvG2KdgwIhRnoEE2uHdtdGNQ8s0lb94dW9sELog== + dependencies: + "@sigstore/protobuf-specs" "^0.2.0" + +"@sigstore/protobuf-specs@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@sigstore/protobuf-specs/-/protobuf-specs-0.2.0.tgz#5801b2a4d10afe1577be6133be6b132b5677c18c" + integrity sha512-8ZhZKAVfXjIspDWwm3D3Kvj0ddbJ0HqDZ/pOs5cx88HpT8mVsotFrg7H1UMnXOuDHz6Zykwxn4mxG3QLuN+RUg== + +"@sigstore/sign@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@sigstore/sign/-/sign-1.0.0.tgz#6b08ebc2f6c92aa5acb07a49784cb6738796f7b4" + integrity sha512-INxFVNQteLtcfGmcoldzV6Je0sbbfh9I16DM4yJPw3j5+TFP8X6uIiA18mvpEa9yyeycAKgPmOA3X9hVdVTPUA== + dependencies: + "@sigstore/bundle" "^1.1.0" + "@sigstore/protobuf-specs" "^0.2.0" + make-fetch-happen "^11.0.1" + +"@sigstore/tuf@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@sigstore/tuf/-/tuf-1.0.3.tgz#2a65986772ede996485728f027b0514c0b70b160" + integrity sha512-2bRovzs0nJZFlCN3rXirE4gwxCn97JNjMmwpecqlbgV9WcxX7WRuIrgzx/X7Ib7MYRbyUTpBYE0s2x6AmZXnlg== + dependencies: + "@sigstore/protobuf-specs" "^0.2.0" + tuf-js "^1.1.7" + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +"@tufjs/canonical-json@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz#eade9fd1f537993bc1f0949f3aea276ecc4fab31" + integrity sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ== + +"@tufjs/models@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-1.0.4.tgz#5a689630f6b9dbda338d4b208019336562f176ef" + integrity sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A== + dependencies: + "@tufjs/canonical-json" "1.0.0" + minimatch "^9.0.0" + +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" + integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== + +"@types/json-schema@^7.0.12": + version "7.0.12" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" + integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== + +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== + +"@types/semver@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + +"@types/trusted-types@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.3.tgz#a136f83b0758698df454e328759dbd3d44555311" + integrity sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g== + +"@typescript-eslint/eslint-plugin@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.3.0.tgz#e751e148aab7ccaf8a7bfd370f7ce9e6bdd1f3f4" + integrity sha512-IZYjYZ0ifGSLZbwMqIip/nOamFiWJ9AH+T/GYNZBWkVcyNQOFGtSMoWV7RvY4poYCMZ/4lHzNl796WOSNxmk8A== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/type-utils" "6.3.0" + "@typescript-eslint/utils" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + natural-compare-lite "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.3.0.tgz#359684c443f4f848db3c4f14674f544f169c8f46" + integrity sha512-ibP+y2Gr6p0qsUkhs7InMdXrwldjxZw66wpcQq9/PzAroM45wdwyu81T+7RibNCh8oc0AgrsyCwJByncY0Ongg== + dependencies: + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/typescript-estree" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.3.0.tgz#6b74e338c4b88d5e1dfc1a28c570dd5cf8c86b09" + integrity sha512-WlNFgBEuGu74ahrXzgefiz/QlVb+qg8KDTpknKwR7hMH+lQygWyx0CQFoUmMn1zDkQjTBBIn75IxtWss77iBIQ== + dependencies: + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + +"@typescript-eslint/type-utils@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.3.0.tgz#3bf89ccd36621ddec1b7f8246afe467c67adc247" + integrity sha512-7Oj+1ox1T2Yc8PKpBvOKWhoI/4rWFd1j7FA/rPE0lbBPXTKjdbtC+7Ev0SeBjEKkIhKWVeZSP+mR7y1Db1CdfQ== + dependencies: + "@typescript-eslint/typescript-estree" "6.3.0" + "@typescript-eslint/utils" "6.3.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/types@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.3.0.tgz#84517f1427923e714b8418981e493b6635ab4c9d" + integrity sha512-K6TZOvfVyc7MO9j60MkRNWyFSf86IbOatTKGrpTQnzarDZPYPVy0oe3myTMq7VjhfsUAbNUW8I5s+2lZvtx1gg== + +"@typescript-eslint/typescript-estree@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.3.0.tgz#20e1e10e2f51cdb9e19a2751215cac92c003643c" + integrity sha512-Xh4NVDaC4eYKY4O3QGPuQNp5NxBAlEvNQYOqJquR2MePNxO11E5K3t5x4M4Mx53IZvtpW+mBxIT0s274fLUocg== + dependencies: + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.3.0.tgz#0898c5e374372c2092ca1b979ea7ee9cc020ce84" + integrity sha512-hLLg3BZE07XHnpzglNBG8P/IXq/ZVXraEbgY7FM0Cnc1ehM8RMdn9mat3LubJ3KBeYXXPxV1nugWbQPjGeJk6Q== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/typescript-estree" "6.3.0" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.3.0.tgz#8d09aa3e389ae0971426124c155ac289afbe450a" + integrity sha512-kEhRRj7HnvaSjux1J9+7dBen15CdWmDnwrpyiHsFX6Qx2iW5LOBUgNefOFeh2PjWPlNwN8TOn6+4eBU3J/gupw== + dependencies: + "@typescript-eslint/types" "6.3.0" + eslint-visitor-keys "^3.4.1" + +abbrev@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +abbrev@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" + integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.2, acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + +agent-base@6, agent-base@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +agentkeepalive@^4.2.1: + version "4.5.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" + integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== + dependencies: + humanize-ms "^1.2.1" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +"aproba@^1.0.3 || ^2.0.0", aproba@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + +archy@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== + +are-we-there-yet@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz#679df222b278c64f2cdba1175cdc00b0d96164bd" + integrity sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + +are-we-there-yet@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-4.0.1.tgz#05a6fc0e5f70771b673e82b0f915616e0ace8fd3" + integrity sha512-2zuA+jpOYBRgoBCfa+fB87Rk0oGJjDX6pxGzqH6f33NzUhG25Xur6R0u0Z9VVAq8Z5JvQpQI6j6rtonuivC8QA== + dependencies: + delegates "^1.0.0" + readable-stream "^4.1.0" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +babel-helper-evaluate-path@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" + integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA== + +babel-helper-flip-expressions@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" + integrity sha512-rSrkRW4YQ2ETCWww9gbsWk4N0x1BOtln349Tk0dlCS90oT68WMLyGR7WvaMp3eAnsVrCqdUtC19lo1avyGPejA== + +babel-helper-is-nodes-equiv@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" + integrity sha512-ri/nsMFVRqXn7IyT5qW4/hIAGQxuYUFHa3qsxmPtbk6spZQcYlyDogfVpNm2XYOslH/ULS4VEJGUqQX5u7ACQw== + +babel-helper-is-void-0@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" + integrity sha512-07rBV0xPRM3TM5NVJEOQEkECX3qnHDjaIbFvWYPv+T1ajpUiVLiqTfC+MmiZxY5KOL/Ec08vJdJD9kZiP9UkUg== + +babel-helper-mark-eval-scopes@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" + integrity sha512-+d/mXPP33bhgHkdVOiPkmYoeXJ+rXRWi7OdhwpyseIqOS8CmzHQXHUp/+/Qr8baXsT0kjGpMHHofHs6C3cskdA== + +babel-helper-remove-or-void@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" + integrity sha512-eYNceYtcGKpifHDir62gHJadVXdg9fAhuZEXiRQnJJ4Yi4oUTpqpNY//1pM4nVyjjDMPYaC2xSf0I+9IqVzwdA== + +babel-helper-to-multiple-sequence-expressions@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" + integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== + +babel-plugin-minify-builtins@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" + integrity sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag== + +babel-plugin-minify-constant-folding@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" + integrity sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ== + dependencies: + babel-helper-evaluate-path "^0.5.0" + +babel-plugin-minify-dead-code-elimination@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.2.tgz#f386ceec77a80cc4e76022a04c21b7d68e0aa5eb" + integrity sha512-krq9Lwi0QIzyAlcNBXTL4usqUvevB4BzktdEsb8srcXC1AaYqRJiAQw6vdKdJSaXbz6snBvziGr6ch/aoRCfpA== + dependencies: + babel-helper-evaluate-path "^0.5.0" + babel-helper-mark-eval-scopes "^0.4.3" + babel-helper-remove-or-void "^0.4.3" + lodash "^4.17.11" + +babel-plugin-minify-flip-comparisons@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" + integrity sha512-8hNwgLVeJzpeLVOVArag2DfTkbKodzOHU7+gAZ8mGBFGPQHK6uXVpg3jh5I/F6gfi5Q5usWU2OKcstn1YbAV7A== + dependencies: + babel-helper-is-void-0 "^0.4.3" + +babel-plugin-minify-guarded-expressions@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz#818960f64cc08aee9d6c75bec6da974c4d621135" + integrity sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA== + dependencies: + babel-helper-evaluate-path "^0.5.0" + babel-helper-flip-expressions "^0.4.3" + +babel-plugin-minify-infinity@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" + integrity sha512-X0ictxCk8y+NvIf+bZ1HJPbVZKMlPku3lgYxPmIp62Dp8wdtbMLSekczty3MzvUOlrk5xzWYpBpQprXUjDRyMA== + +babel-plugin-minify-mangle-names@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.1.tgz#3dfba7f4e649ff37a767542ea0d1093bee3bb155" + integrity sha512-8KMichAOae2FHlipjNDTo2wz97MdEb2Q0jrn4NIRXzHH7SJ3c5TaNNBkeTHbk9WUsMnqpNUx949ugM9NFWewzw== + dependencies: + babel-helper-mark-eval-scopes "^0.4.3" + +babel-plugin-minify-numeric-literals@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" + integrity sha512-5D54hvs9YVuCknfWywq0eaYDt7qYxlNwCqW9Ipm/kYeS9gYhJd0Rr/Pm2WhHKJ8DC6aIlDdqSBODSthabLSX3A== + +babel-plugin-minify-replace@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" + integrity sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q== + +babel-plugin-minify-simplify@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz#f21613c8b95af3450a2ca71502fdbd91793c8d6a" + integrity sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A== + dependencies: + babel-helper-evaluate-path "^0.5.0" + babel-helper-flip-expressions "^0.4.3" + babel-helper-is-nodes-equiv "^0.0.1" + babel-helper-to-multiple-sequence-expressions "^0.5.0" + +babel-plugin-minify-type-constructors@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" + integrity sha512-4ADB0irJ/6BeXWHubjCJmrPbzhxDgjphBMjIjxCc25n4NGJ00NsYqwYt+F/OvE9RXx8KaSW7cJvp+iZX436tnQ== + dependencies: + babel-helper-is-void-0 "^0.4.3" + +babel-plugin-polyfill-corejs2@^0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz#8097b4cb4af5b64a1d11332b6fb72ef5e64a054c" + integrity sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg== + dependencies: + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.4.2" + semver "^6.3.1" + +babel-plugin-polyfill-corejs3@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz#b4f719d0ad9bb8e0c23e3e630c0c8ec6dd7a1c52" + integrity sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.4.2" + core-js-compat "^3.31.0" + +babel-plugin-polyfill-regenerator@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz#80d0f3e1098c080c8b5a65f41e9427af692dc326" + integrity sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.4.2" + +babel-plugin-transform-inline-consecutive-adds@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" + integrity sha512-8D104wbzzI5RlxeVPYeQb9QsUyepiH1rAO5hpPpQ6NPRgQLpIVwkS/Nbx944pm4K8Z+rx7CgjPsFACz/VCBN0Q== + +babel-plugin-transform-member-expression-literals@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" + integrity sha512-Xq9/Rarpj+bjOZSl1nBbZYETsNEDDJSrb6Plb1sS3/36FukWFLLRysgecva5KZECjUJTrJoQqjJgtWToaflk5Q== + +babel-plugin-transform-merge-sibling-variables@^6.9.5: + version "6.9.5" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.5.tgz#0b2faa9e027ef47d4e7502f77cd1a7f3a6dfbc7b" + integrity sha512-xj/KrWi6/uP+DrD844h66Qh2cZN++iugEIgH8QcIxhmZZPNP6VpOE9b4gP2FFW39xDAY43kCmYMM6U0QNKN8fw== + +babel-plugin-transform-minify-booleans@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" + integrity sha512-9pW9ePng6DZpzGPalcrULuhSCcauGAbn8AeU3bE34HcDkGm8Ldt0ysjGkyb64f0K3T5ilV4mriayOVv5fg0ASA== + +babel-plugin-transform-property-literals@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" + integrity sha512-Pf8JHTjTPxecqVyL6KSwD/hxGpoTZjiEgV7nCx0KFQsJYM0nuuoCajbg09KRmZWeZbJ5NGTySABYv8b/hY1eEA== + dependencies: + esutils "^2.0.2" + +babel-plugin-transform-regexp-constructors@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" + integrity sha512-JjymDyEyRNhAoNFp09y/xGwYVYzT2nWTGrBrWaL6eCg2m+B24qH2jR0AA8V8GzKJTgC8NW6joJmc6nabvWBD/g== + +babel-plugin-transform-remove-console@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" + integrity sha512-88blrUrMX3SPiGkT1GnvVY8E/7A+k6oj3MNvUtTIxJflFzXTw1bHkuJ/y039ouhFMp2prRn5cQGzokViYi1dsg== + +babel-plugin-transform-remove-debugger@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" + integrity sha512-Kd+eTBYlXfwoFzisburVwrngsrz4xh9I0ppoJnU/qlLysxVBRgI4Pj+dk3X8F5tDiehp3hhP8oarRMT9v2Z3lw== + +babel-plugin-transform-remove-undefined@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" + integrity sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ== + dependencies: + babel-helper-evaluate-path "^0.5.0" + +babel-plugin-transform-simplify-comparison-operators@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" + integrity sha512-GLInxhGAQWJ9YIdjwF6dAFlmh4U+kN8pL6Big7nkDzHoZcaDQOtBm28atEhQJq6m9GpAovbiGEShKqXv4BSp0A== + +babel-plugin-transform-undefined-to-void@^6.9.4: + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" + integrity sha512-D2UbwxawEY1xVc9svYAUZQM2xarwSNXue2qDIx6CeV2EuMGaes/0su78zlIDIAgE7BvnMw4UpmSo9fDy+znghg== + +babel-preset-minify@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.2.tgz#4d5be8b1c21d126ac403a3fd002d8b5fb7bb3c34" + integrity sha512-v4GL+kk0TfovbRIKZnC3HPbu2cAGmPAby7BsOmuPdMJfHV+4FVdsGXTH/OOGQRKYdjemBuL1+MsE6mobobhe9w== + dependencies: + babel-plugin-minify-builtins "^0.5.0" + babel-plugin-minify-constant-folding "^0.5.0" + babel-plugin-minify-dead-code-elimination "^0.5.2" + babel-plugin-minify-flip-comparisons "^0.4.3" + babel-plugin-minify-guarded-expressions "^0.4.4" + babel-plugin-minify-infinity "^0.4.3" + babel-plugin-minify-mangle-names "^0.5.1" + babel-plugin-minify-numeric-literals "^0.4.3" + babel-plugin-minify-replace "^0.5.0" + babel-plugin-minify-simplify "^0.5.1" + babel-plugin-minify-type-constructors "^0.4.3" + babel-plugin-transform-inline-consecutive-adds "^0.4.3" + babel-plugin-transform-member-expression-literals "^6.9.4" + babel-plugin-transform-merge-sibling-variables "^6.9.5" + babel-plugin-transform-minify-booleans "^6.9.4" + babel-plugin-transform-property-literals "^6.9.4" + babel-plugin-transform-regexp-constructors "^0.4.3" + babel-plugin-transform-remove-console "^6.9.4" + babel-plugin-transform-remove-debugger "^6.9.4" + babel-plugin-transform-remove-undefined "^0.5.0" + babel-plugin-transform-simplify-comparison-operators "^6.9.4" + babel-plugin-transform-undefined-to-void "^6.9.4" + lodash "^4.17.11" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +big-integer@^1.6.44: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + +bin-links@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-4.0.2.tgz#13321472ea157e9530caded2b7281496d698665b" + integrity sha512-jxJ0PbXR8eQyPlExCvCs3JFnikvs1Yp4gUJt6nmgathdOwvur+q22KWC3h20gvWl4T/14DXKj2IlkJwwZkZPOw== + dependencies: + cmd-shim "^6.0.0" + npm-normalize-package-bin "^3.0.0" + read-cmd-shim "^4.0.0" + write-file-atomic "^5.0.0" + +binary-extensions@^2.0.0, binary-extensions@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bplist-parser@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" + integrity sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw== + dependencies: + big-integer "^1.6.44" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.21.9: + version "4.21.10" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" + integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== + dependencies: + caniuse-lite "^1.0.30001517" + electron-to-chromium "^1.4.477" + node-releases "^2.0.13" + update-browserslist-db "^1.0.11" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + +builtins@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" + integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ== + dependencies: + semver "^7.0.0" + +bundle-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bundle-name/-/bundle-name-3.0.0.tgz#ba59bcc9ac785fb67ccdbf104a2bf60c099f0e1a" + integrity sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw== + dependencies: + run-applescript "^5.0.0" + +cacache@^17.0.0, cacache@^17.0.4, cacache@^17.1.3: + version "17.1.3" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-17.1.3.tgz#c6ac23bec56516a7c0c52020fd48b4909d7c7044" + integrity sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg== + dependencies: + "@npmcli/fs" "^3.1.0" + fs-minipass "^3.0.0" + glob "^10.2.2" + lru-cache "^7.7.1" + minipass "^5.0.0" + minipass-collect "^1.0.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + p-map "^4.0.0" + ssri "^10.0.0" + tar "^6.1.11" + unique-filename "^3.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001517: + version "1.0.30001520" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz#62e2b7a1c7b35269594cf296a80bdf8cb9565006" + integrity sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + +chokidar@^3.4.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + +ci-info@^3.6.1, ci-info@^3.7.1, ci-info@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + +cidr-regex@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-3.1.1.tgz#ba1972c57c66f61875f18fd7dd487469770b571d" + integrity sha512-RBqYd32aDwbCMFJRL6wHOlDNYJsPNTt8vC82ErHF5vKt8QQzxm1FrkW8s/R5pVrXMf17sba09Uoy91PKiddAsw== + dependencies: + ip-regex "^4.1.0" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-columns@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-columns/-/cli-columns-4.0.0.tgz#9fe4d65975238d55218c41bd2ed296a7fa555646" + integrity sha512-XW2Vg+w+L9on9wtwKpyzluIPCWXjaBahI7mTcYjx+BVIYD9c3yqcv/yKC7CmdCZat4rq2yiE1UMSJC5ivKfMtQ== + dependencies: + string-width "^4.2.3" + strip-ansi "^6.0.1" + +cli-table3@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" + integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + +cmd-shim@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-6.0.1.tgz#a65878080548e1dca760b3aea1e21ed05194da9d" + integrity sha512-S9iI9y0nKR4hwEQsVWpyxld/6kRfGepGfzff83FcaiEBpmvlbA2nnGe7Cylgrx2f/p1P5S5wpRm9oL8z1PbS3Q== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-support@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + +columnify@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" + integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== + dependencies: + strip-ansi "^6.0.1" + wcwidth "^1.0.0" + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + +common-ancestor-path@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz#4f7d2d1394d91b7abdf51871c62f71eadb0182a7" + integrity sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +console-control-strings@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== + +convert-source-map@^1.1.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +core-js-compat@^3.31.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.32.0.tgz#f41574b6893ab15ddb0ac1693681bd56c8550a90" + integrity sha512-7a9a3D1k4UCVKnLhrgALyFcP7YCsLOQIxPd0dKjf/6GuPcgyiGP70ewWdCGrSK7evyhymi0qO4EqCmSJofDeYw== + dependencies: + browserslist "^4.21.9" + +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + +custom-card-helpers@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/custom-card-helpers/-/custom-card-helpers-1.9.0.tgz#dac7bb7a531101f4c83096b26a8be8ccad70d8c0" + integrity sha512-5IW4OXq3MiiCqDvqeu+MYsM1NmntKW1WfJhyJFsdP2tbzqEI4BOnqRz2qzdp08lE4QLVhYfRLwe0WAqgQVNeFg== + dependencies: + "@formatjs/intl-utils" "^3.8.4" + home-assistant-js-websocket "^6.0.1" + intl-messageformat "^9.11.1" + lit "^2.1.1" + rollup "^2.63.0" + superstruct "^0.15.3" + typescript "^4.5.4" + +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +default-browser-id@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/default-browser-id/-/default-browser-id-3.0.0.tgz#bee7bbbef1f4e75d31f98f4d3f1556a14cea790c" + integrity sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA== + dependencies: + bplist-parser "^0.2.0" + untildify "^4.0.0" + +default-browser@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/default-browser/-/default-browser-4.0.0.tgz#53c9894f8810bf86696de117a6ce9085a3cbc7da" + integrity sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA== + dependencies: + bundle-name "^3.0.0" + default-browser-id "^3.0.0" + execa "^7.1.1" + titleize "^3.0.0" + +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + +define-lazy-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== + +diff@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +electron-to-chromium@^1.4.477: + version "1.4.490" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz#d99286f6e915667fa18ea4554def1aa60eb4d5f1" + integrity sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== + +encoding@^0.1.13: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +err-code@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" + integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== + +eslint-plugin-prettier@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz#6887780ed95f7708340ec79acfdf60c35b9be57a" + integrity sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w== + dependencies: + prettier-linter-helpers "^1.0.0" + synckit "^0.8.5" + +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint@^8.24.0, eslint@^8.47.0: + version "8.47.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.47.0.tgz#c95f9b935463fb4fad7005e626c7621052e90806" + integrity sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "^8.47.0" + "@humanwhocodes/config-array" "^0.11.10" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" + +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estree-walker@^2.0.1, estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +execa@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9" + integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.1" + human-signals "^4.3.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^3.0.7" + strip-final-newline "^3.0.0" + +exponential-backoff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" + integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + +fast-glob@^3.2.9, fast-glob@^3.3.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastest-levenshtein@^1.0.16: + version "1.0.16" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-cache-dir@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + +fs-minipass@^3.0.0, fs-minipass@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.2.tgz#5b383858efa8c1eb8c33b39e994f7e8555b8b3a3" + integrity sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g== + dependencies: + minipass "^5.0.0" + +fs-readdir-recursive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +gauge@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" + integrity sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.3" + console-control-strings "^1.1.0" + has-unicode "^2.0.1" + signal-exit "^3.0.7" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.5" + +gauge@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-5.0.1.tgz#1efc801b8ff076b86ef3e9a7a280a975df572112" + integrity sha512-CmykPMJGuNan/3S4kZOpvvPYSNqSHANiWnh9XcMU2pSjtBfF0XzZ2p1bFAxTbnFxyBuPxQYHhzwaoOmUdqzvxQ== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.3" + console-control-strings "^1.1.0" + has-unicode "^2.0.1" + signal-exit "^4.0.1" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.5" + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-stream@^6.0.0, get-stream@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@^10.2.2, glob@^10.2.7: + version "10.3.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.3.tgz#8360a4ffdd6ed90df84aa8d52f21f452e86a123b" + integrity sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.0.3" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + +glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^8.0.3: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.19.0: + version "13.21.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.21.0.tgz#163aae12f34ef502f5153cfbdd3600f36c63c571" + integrity sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.6: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-unicode@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +home-assistant-js-websocket@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-6.1.1.tgz#87ba846753c4fb58a2e5ace6bb15a82689fd0735" + integrity sha512-TnZFzF4mn5F/v0XKUTK2GMQXrn/+eQpgaSDSELl6U0HSwSbFwRhGWLz330YT+hiKMspDflamsye//RPL+zwhDw== + +hosted-git-info@^6.0.0, hosted-git-info@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-6.1.1.tgz#629442c7889a69c05de604d52996b74fe6f26d58" + integrity sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w== + dependencies: + lru-cache "^7.5.1" + +http-cache-semantics@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +human-signals@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" + integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== + dependencies: + ms "^2.0.0" + +iconv-lite@^0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +ignore-walk@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.3.tgz#0fcdb6decaccda35e308a7b0948645dd9523b7bb" + integrity sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA== + dependencies: + minimatch "^9.0.0" + +ignore@^5.2.0, ignore@^5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^4.1.0, ini@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" + integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== + +init-package-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-5.0.0.tgz#030cf0ea9c84cfc1b0dc2e898b45d171393e4b40" + integrity sha512-kBhlSheBfYmq3e0L1ii+VKe3zBTLL5lDCDWR+f9dLmEGSB3MqLlMlsolubSsyI88Bg6EA+BIMlomAnQ1SwgQBw== + dependencies: + npm-package-arg "^10.0.0" + promzard "^1.0.0" + read "^2.0.0" + read-package-json "^6.0.0" + semver "^7.3.5" + validate-npm-package-license "^3.0.4" + validate-npm-package-name "^5.0.0" + +intl-messageformat@^9.11.1: + version "9.13.0" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-9.13.0.tgz#97360b73bd82212e4f6005c712a4a16053165468" + integrity sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw== + dependencies: + "@formatjs/ecma402-abstract" "1.11.4" + "@formatjs/fast-memoize" "1.2.1" + "@formatjs/icu-messageformat-parser" "2.1.0" + tslib "^2.1.0" + +ip-regex@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" + integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== + +ip@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" + integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-builtin-module@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== + dependencies: + builtin-modules "^3.3.0" + +is-cidr@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/is-cidr/-/is-cidr-4.0.2.tgz#94c7585e4c6c77ceabf920f8cde51b8c0fda8814" + integrity sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA== + dependencies: + cidr-regex "^3.1.1" + +is-core-module@^2.13.0, is-core-module@^2.8.1: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + dependencies: + has "^1.0.3" + +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + +is-docker@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-inside-container@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== + dependencies: + is-docker "^3.0.0" + +is-lambda@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" + integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== + +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-reference@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +jackspeak@^2.0.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.3.tgz#ac63c57c18d254dc78a1f4ecd1cdeb4daeb6e616" + integrity sha512-pF0kfjmg8DJLxDrizHoCZGUFz4P4czQ3HyfW4BU0ffebYkzAVlBywp5zaxW/TM+r0sGbmrQdi8EQQVTJFxnGsQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== + +json-parse-even-better-errors@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz#2cb2ee33069a78870a0c7e3da560026b89669cf7" + integrity sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json-stringify-nice@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" + integrity sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw== + +json5@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + +just-diff-apply@^5.2.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/just-diff-apply/-/just-diff-apply-5.5.0.tgz#771c2ca9fa69f3d2b54e7c3f5c1dfcbcc47f9f0f" + integrity sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw== + +just-diff@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-6.0.2.tgz#03b65908543ac0521caf6d8eb85035f7d27ea285" + integrity sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +libnpmaccess@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-7.0.2.tgz#7f056c8c933dd9c8ba771fa6493556b53c5aac52" + integrity sha512-vHBVMw1JFMTgEk15zRsJuSAg7QtGGHpUSEfnbcRL1/gTBag9iEfJbyjpDmdJmwMhvpoLoNBtdAUCdGnaP32hhw== + dependencies: + npm-package-arg "^10.1.0" + npm-registry-fetch "^14.0.3" + +libnpmdiff@^5.0.19: + version "5.0.19" + resolved "https://registry.yarnpkg.com/libnpmdiff/-/libnpmdiff-5.0.19.tgz#c56a8b1fcd7690f12e527c0ab21dbdbd259c27fe" + integrity sha512-caqIA7SzPeyqOn55GodejyEJRIXaFnzuqxrO9uyXtH4soom4wjDAkU97L1WrBSuVtDk3IZQD72daVeT2GqHSjA== + dependencies: + "@npmcli/arborist" "^6.3.0" + "@npmcli/disparity-colors" "^3.0.0" + "@npmcli/installed-package-contents" "^2.0.2" + binary-extensions "^2.2.0" + diff "^5.1.0" + minimatch "^9.0.0" + npm-package-arg "^10.1.0" + pacote "^15.0.8" + tar "^6.1.13" + +libnpmexec@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-6.0.3.tgz#f7ea9c028443d890297e1bbe2d5605f68b118470" + integrity sha512-E87xEzxChUe0qZgoqht5D5t13B876rPoTD877v9ZUSMztBFpuChQn5UNO3z5NaeBpEwWq/BAnQfMYRWR6sVAZA== + dependencies: + "@npmcli/arborist" "^6.3.0" + "@npmcli/run-script" "^6.0.0" + ci-info "^3.7.1" + npm-package-arg "^10.1.0" + npmlog "^7.0.1" + pacote "^15.0.8" + proc-log "^3.0.0" + read "^2.0.0" + read-package-json-fast "^3.0.2" + semver "^7.3.7" + walk-up-path "^3.0.1" + +libnpmfund@^4.0.19: + version "4.0.19" + resolved "https://registry.yarnpkg.com/libnpmfund/-/libnpmfund-4.0.19.tgz#ec615b9a5fb996185fca132420b6be265dc485f1" + integrity sha512-g2XV/oqBLo0Mau/nmqvIoNHRmAQqzSvSjSR9npO0+buEqGmyRHDeQJKDI3RxpLcQgd0IuNNAoTjXXpoKcX90EQ== + dependencies: + "@npmcli/arborist" "^6.3.0" + +libnpmhook@^9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-9.0.3.tgz#5dbd6a146feb7e11993d36a26f750ae2347bb1d9" + integrity sha512-wMZe58sI7KLhg0+nUWZW5KdMfjNNcOIIbkoP19BDHYoUF9El7eeUWkGNxUGzpHkPKiGoQ1z/v6CYin4deebeuw== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^14.0.3" + +libnpmorg@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/libnpmorg/-/libnpmorg-5.0.4.tgz#94eec2b84fbef736457eb27894c972ae6f5cac82" + integrity sha512-YqYXLMAN0Y1eJH4w3hUFN9648xfSdvJANMsdeZTOWJOW4Pqp8qapJFzQdqCfUkg+tEuQmnaFQQKXvkMZC51+Mw== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^14.0.3" + +libnpmpack@^5.0.19: + version "5.0.19" + resolved "https://registry.yarnpkg.com/libnpmpack/-/libnpmpack-5.0.19.tgz#e9790ebbcb078469d59dbb7e5ee7defe3039cc22" + integrity sha512-xxkROnxTZF3imCJ9ve+6ELtRYvOBMwvrKlMGJx6JhmvD5lqIPGOJpY8oY+w8XLmLX1N06scYuLonkFpF2ayrjQ== + dependencies: + "@npmcli/arborist" "^6.3.0" + "@npmcli/run-script" "^6.0.0" + npm-package-arg "^10.1.0" + pacote "^15.0.8" + +libnpmpublish@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-7.5.0.tgz#a118c8fdc680947c960648ed8b4c94d15e42e0ab" + integrity sha512-zctH6QcTJ093lpxmkufr2zr3AJ9V90hcRilDFNin6n91ODj+S28RdyMFFJpa9NwyztmyV2hlWLyZv0GaOQBDyA== + dependencies: + ci-info "^3.6.1" + normalize-package-data "^5.0.0" + npm-package-arg "^10.1.0" + npm-registry-fetch "^14.0.3" + proc-log "^3.0.0" + semver "^7.3.7" + sigstore "^1.4.0" + ssri "^10.0.1" + +libnpmsearch@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/libnpmsearch/-/libnpmsearch-6.0.2.tgz#b6a531a312855dd3bf84dd273b1033dd09b4cbec" + integrity sha512-p+5BF19AvnVg8mcIQhy6yWhI6jHQRVMYaIaKeITEfYAffWsqbottA/WZdMtHL76hViC6SFM1WdclM1w5eAIa1g== + dependencies: + npm-registry-fetch "^14.0.3" + +libnpmteam@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/libnpmteam/-/libnpmteam-5.0.3.tgz#196657e9d87c0cc914c44fee588ad2b838074a3c" + integrity sha512-7XOGhi45s+ml6TyrhJUTyrErcoDMKGKfEtiTEco4ofU7BGGAUOalVztKMVLLJgJOOXdIAIlzCHqkTXEuSiyCiA== + dependencies: + aproba "^2.0.0" + npm-registry-fetch "^14.0.3" + +libnpmversion@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/libnpmversion/-/libnpmversion-4.0.2.tgz#cad9cd1b287fcf9576a64edfe71491b49a65d06f" + integrity sha512-n1X70mFHv8Piy4yos+MFWUARSkTbyV5cdsHScaIkuwYvRAF/s2VtYScDzWB4Oe8uNEuGNdjiRR1E/Dh1tMvv6g== + dependencies: + "@npmcli/git" "^4.0.1" + "@npmcli/run-script" "^6.0.0" + json-parse-even-better-errors "^3.0.0" + proc-log "^3.0.0" + semver "^7.3.7" + +lit-element@^3.3.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.3.3.tgz#10bc19702b96ef5416cf7a70177255bfb17b3209" + integrity sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA== + dependencies: + "@lit-labs/ssr-dom-shim" "^1.1.0" + "@lit/reactive-element" "^1.3.0" + lit-html "^2.8.0" + +lit-html@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.8.0.tgz#96456a4bb4ee717b9a7d2f94562a16509d39bffa" + integrity sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q== + dependencies: + "@types/trusted-types" "^2.0.2" + +lit@^2.1.1, lit@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/lit/-/lit-2.8.0.tgz#4d838ae03059bf9cafa06e5c61d8acc0081e974e" + integrity sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA== + dependencies: + "@lit/reactive-element" "^1.6.0" + lit-element "^3.3.0" + lit-html "^2.8.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash@^4.17.11: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: + version "7.18.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" + integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== + +"lru-cache@^9.1.1 || ^10.0.0": + version "10.0.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a" + integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g== + +magic-string@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" + integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +make-fetch-happen@^11.0.0, make-fetch-happen@^11.0.1, make-fetch-happen@^11.0.3, make-fetch-happen@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz#85ceb98079584a9523d4bf71d32996e7e208549f" + integrity sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w== + dependencies: + agentkeepalive "^4.2.1" + cacache "^17.0.0" + http-cache-semantics "^4.1.1" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + is-lambda "^1.0.1" + lru-cache "^7.7.1" + minipass "^5.0.0" + minipass-fetch "^3.0.0" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + negotiator "^0.6.3" + promise-retry "^2.0.1" + socks-proxy-agent "^7.0.0" + ssri "^10.0.0" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime@>=2.4.6: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" + integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + +minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^9.0.0, minimatch@^9.0.1, minimatch@^9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + +minipass-collect@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" + integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== + dependencies: + minipass "^3.0.0" + +minipass-fetch@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.3.tgz#d9df70085609864331b533c960fd4ffaa78d15ce" + integrity sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ== + dependencies: + minipass "^5.0.0" + minipass-sized "^1.0.3" + minizlib "^2.1.2" + optionalDependencies: + encoding "^0.1.13" + +minipass-flush@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" + integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== + dependencies: + minipass "^3.0.0" + +minipass-json-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz#7edbb92588fbfc2ff1db2fc10397acb7b6b44aa7" + integrity sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg== + dependencies: + jsonparse "^1.3.1" + minipass "^3.0.0" + +minipass-pipeline@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" + integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== + dependencies: + minipass "^3.0.0" + +minipass-sized@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" + integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== + dependencies: + minipass "^3.0.0" + +minipass@^3.0.0: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.3.tgz#05ea638da44e475037ed94d1c7efcc76a25e1974" + integrity sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg== + +minizlib@^2.1.1, minizlib@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + +mkdirp@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.0.0, ms@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +mute-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +negotiator@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +node-gyp@^9.0.0, node-gyp@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.4.0.tgz#2a7a91c7cba4eccfd95e949369f27c9ba704f369" + integrity sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg== + dependencies: + env-paths "^2.2.0" + exponential-backoff "^3.1.1" + glob "^7.1.4" + graceful-fs "^4.2.6" + make-fetch-happen "^11.0.3" + nopt "^6.0.0" + npmlog "^6.0.0" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.2" + which "^2.0.2" + +node-releases@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== + +nopt@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" + integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== + dependencies: + abbrev "^1.0.0" + +nopt@^7.0.0, nopt@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-7.2.0.tgz#067378c68116f602f552876194fd11f1292503d7" + integrity sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA== + dependencies: + abbrev "^2.0.0" + +normalize-package-data@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-5.0.0.tgz#abcb8d7e724c40d88462b84982f7cbf6859b4588" + integrity sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q== + dependencies: + hosted-git-info "^6.0.0" + is-core-module "^2.8.1" + semver "^7.3.5" + validate-npm-package-license "^3.0.4" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-audit-report@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-5.0.0.tgz#83ac14aeff249484bde81eff53c3771d5048cf95" + integrity sha512-EkXrzat7zERmUhHaoren1YhTxFwsOu5jypE84k6632SXTHcQE1z8V51GC6GVZt8LxkC+tbBcKMUBZAgk8SUSbw== + +npm-bundled@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-3.0.0.tgz#7e8e2f8bb26b794265028491be60321a25a39db7" + integrity sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ== + dependencies: + npm-normalize-package-bin "^3.0.0" + +npm-install-checks@^6.0.0, npm-install-checks@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-6.1.1.tgz#b459b621634d06546664207fde16810815808db1" + integrity sha512-dH3GmQL4vsPtld59cOn8uY0iOqRmqKvV+DLGwNXV/Q7MDgD2QfOADWd/mFXcIE5LVhYYGjA3baz6W9JneqnuCw== + dependencies: + semver "^7.1.1" + +npm-normalize-package-bin@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz#25447e32a9a7de1f51362c61a559233b89947832" + integrity sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ== + +npm-package-arg@^10.0.0, npm-package-arg@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-10.1.0.tgz#827d1260a683806685d17193073cc152d3c7e9b1" + integrity sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA== + dependencies: + hosted-git-info "^6.0.0" + proc-log "^3.0.0" + semver "^7.3.5" + validate-npm-package-name "^5.0.0" + +npm-packlist@^7.0.0: + version "7.0.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-7.0.4.tgz#033bf74110eb74daf2910dc75144411999c5ff32" + integrity sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q== + dependencies: + ignore-walk "^6.0.0" + +npm-pick-manifest@^8.0.0, npm-pick-manifest@^8.0.1: + version "8.0.2" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-8.0.2.tgz#2159778d9c7360420c925c1a2287b5a884c713aa" + integrity sha512-1dKY+86/AIiq1tkKVD3l0WI+Gd3vkknVGAggsFeBkTvbhMQ1OND/LKkYv4JtXPKUJ8bOTCyLiqEg2P6QNdK+Gg== + dependencies: + npm-install-checks "^6.0.0" + npm-normalize-package-bin "^3.0.0" + npm-package-arg "^10.0.0" + semver "^7.3.5" + +npm-profile@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-7.0.1.tgz#a37dae08b22e662ece2c6e08946f9fcd9fdef663" + integrity sha512-VReArOY/fCx5dWL66cbJ2OMogTQAVVQA//8jjmjkarboki3V7UJ0XbGFW+khRwiAJFQjuH0Bqr/yF7Y5RZdkMQ== + dependencies: + npm-registry-fetch "^14.0.0" + proc-log "^3.0.0" + +npm-registry-fetch@^14.0.0, npm-registry-fetch@^14.0.3, npm-registry-fetch@^14.0.5: + version "14.0.5" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz#fe7169957ba4986a4853a650278ee02e568d115d" + integrity sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA== + dependencies: + make-fetch-happen "^11.0.0" + minipass "^5.0.0" + minipass-fetch "^3.0.0" + minipass-json-stream "^1.0.1" + minizlib "^2.1.2" + npm-package-arg "^10.0.0" + proc-log "^3.0.0" + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +npm-run-path@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00" + integrity sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q== + dependencies: + path-key "^4.0.0" + +npm-user-validate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-2.0.0.tgz#7b69bbbff6f7992a1d9a8968d52fd6b6db5431b6" + integrity sha512-sSWeqAYJ2dUPStJB+AEj0DyLRltr/f6YNcvCA7phkB8/RMLMnVsQ41GMwHo/ERZLYNDsyB2wPm7pZo1mqPOl7Q== + +npm@^9.8.1: + version "9.8.1" + resolved "https://registry.yarnpkg.com/npm/-/npm-9.8.1.tgz#b8f070cc770128b38017160491504184863329f0" + integrity sha512-AfDvThQzsIXhYgk9zhbk5R+lh811lKkLAeQMMhSypf1BM7zUafeIIBzMzespeuVEJ0+LvY36oRQYf7IKLzU3rw== + dependencies: + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/arborist" "^6.3.0" + "@npmcli/config" "^6.2.1" + "@npmcli/fs" "^3.1.0" + "@npmcli/map-workspaces" "^3.0.4" + "@npmcli/package-json" "^4.0.1" + "@npmcli/promise-spawn" "^6.0.2" + "@npmcli/run-script" "^6.0.2" + abbrev "^2.0.0" + archy "~1.0.0" + cacache "^17.1.3" + chalk "^5.3.0" + ci-info "^3.8.0" + cli-columns "^4.0.0" + cli-table3 "^0.6.3" + columnify "^1.6.0" + fastest-levenshtein "^1.0.16" + fs-minipass "^3.0.2" + glob "^10.2.7" + graceful-fs "^4.2.11" + hosted-git-info "^6.1.1" + ini "^4.1.1" + init-package-json "^5.0.0" + is-cidr "^4.0.2" + json-parse-even-better-errors "^3.0.0" + libnpmaccess "^7.0.2" + libnpmdiff "^5.0.19" + libnpmexec "^6.0.3" + libnpmfund "^4.0.19" + libnpmhook "^9.0.3" + libnpmorg "^5.0.4" + libnpmpack "^5.0.19" + libnpmpublish "^7.5.0" + libnpmsearch "^6.0.2" + libnpmteam "^5.0.3" + libnpmversion "^4.0.2" + make-fetch-happen "^11.1.1" + minimatch "^9.0.3" + minipass "^5.0.0" + minipass-pipeline "^1.2.4" + ms "^2.1.2" + node-gyp "^9.4.0" + nopt "^7.2.0" + npm-audit-report "^5.0.0" + npm-install-checks "^6.1.1" + npm-package-arg "^10.1.0" + npm-pick-manifest "^8.0.1" + npm-profile "^7.0.1" + npm-registry-fetch "^14.0.5" + npm-user-validate "^2.0.0" + npmlog "^7.0.1" + p-map "^4.0.0" + pacote "^15.2.0" + parse-conflict-json "^3.0.1" + proc-log "^3.0.0" + qrcode-terminal "^0.12.0" + read "^2.1.0" + semver "^7.5.4" + sigstore "^1.7.0" + ssri "^10.0.4" + supports-color "^9.4.0" + tar "^6.1.15" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + treeverse "^3.0.0" + validate-npm-package-name "^5.0.0" + which "^3.0.1" + write-file-atomic "^5.0.1" + +npmlog@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" + integrity sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg== + dependencies: + are-we-there-yet "^3.0.0" + console-control-strings "^1.1.0" + gauge "^4.0.3" + set-blocking "^2.0.0" + +npmlog@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-7.0.1.tgz#7372151a01ccb095c47d8bf1d0771a4ff1f53ac8" + integrity sha512-uJ0YFk/mCQpLBt+bxN88AKd+gyqZvZDbtiNxk6Waqcj2aPRyfVx8ITawkyQynxUagInjdYT1+qj4NfA5KJJUxg== + dependencies: + are-we-there-yet "^4.0.0" + console-control-strings "^1.1.0" + gauge "^5.0.0" + set-blocking "^2.0.0" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + +open@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6" + integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg== + dependencies: + default-browser "^4.0.0" + define-lazy-prop "^3.0.0" + is-inside-container "^1.0.0" + is-wsl "^2.2.0" + +opener@1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== + dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +pacote@^15.0.0, pacote@^15.0.8, pacote@^15.2.0: + version "15.2.0" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-15.2.0.tgz#0f0dfcc3e60c7b39121b2ac612bf8596e95344d3" + integrity sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA== + dependencies: + "@npmcli/git" "^4.0.0" + "@npmcli/installed-package-contents" "^2.0.1" + "@npmcli/promise-spawn" "^6.0.1" + "@npmcli/run-script" "^6.0.0" + cacache "^17.0.0" + fs-minipass "^3.0.0" + minipass "^5.0.0" + npm-package-arg "^10.0.0" + npm-packlist "^7.0.0" + npm-pick-manifest "^8.0.0" + npm-registry-fetch "^14.0.0" + proc-log "^3.0.0" + promise-retry "^2.0.1" + read-package-json "^6.0.0" + read-package-json-fast "^3.0.0" + sigstore "^1.3.0" + ssri "^10.0.0" + tar "^6.1.11" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-conflict-json@^3.0.0, parse-conflict-json@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/parse-conflict-json/-/parse-conflict-json-3.0.1.tgz#67dc55312781e62aa2ddb91452c7606d1969960c" + integrity sha512-01TvEktc68vwbJOtWZluyWeVGWjP+bZwXtPDMQVbBKzbJ/vZBif0L69KH1+cHv1SZ6e0FKLvjyHe8mqsIqYOmw== + dependencies: + json-parse-even-better-errors "^3.0.0" + just-diff "^6.0.0" + just-diff-apply "^5.2.0" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pkg-dir@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +postcss-selector-parser@^6.0.10: + version "6.0.13" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" + integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40" + integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ== + +proc-log@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-3.0.0.tgz#fb05ef83ccd64fd7b20bbe9c8c1070fc08338dd8" + integrity sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + +promise-all-reject-late@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz#f8ebf13483e5ca91ad809ccc2fcf25f26f8643c2" + integrity sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw== + +promise-call-limit@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/promise-call-limit/-/promise-call-limit-1.0.2.tgz#f64b8dd9ef7693c9c7613e7dfe8d6d24de3031ea" + integrity sha512-1vTUnfI2hzui8AEIixbdAJlFY4LFDXqQswy/2eOlThAscXCY4It8FdVuI0fMJGAB2aWGbdQf/gv0skKYXmdrHA== + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== + +promise-retry@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" + integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== + dependencies: + err-code "^2.0.2" + retry "^0.12.0" + +promzard@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/promzard/-/promzard-1.0.0.tgz#3246f8e6c9895a77c0549cefb65828ac0f6c006b" + integrity sha512-KQVDEubSUHGSt5xLakaToDFrSoZhStB8dXLzk2xvwR67gJktrHFvpR63oZgHyK19WKbHFLXJqCPXdVR3aBP8Ig== + dependencies: + read "^2.0.0" + +punycode@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +qrcode-terminal@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +read-cmd-shim@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-4.0.0.tgz#640a08b473a49043e394ae0c7a34dd822c73b9bb" + integrity sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q== + +read-package-json-fast@^3.0.0, read-package-json-fast@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz#394908a9725dc7a5f14e70c8e7556dff1d2b1049" + integrity sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw== + dependencies: + json-parse-even-better-errors "^3.0.0" + npm-normalize-package-bin "^3.0.0" + +read-package-json@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-6.0.4.tgz#90318824ec456c287437ea79595f4c2854708836" + integrity sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw== + dependencies: + glob "^10.2.2" + json-parse-even-better-errors "^3.0.0" + normalize-package-data "^5.0.0" + npm-normalize-package-bin "^3.0.0" + +read@^2.0.0, read@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/read/-/read-2.1.0.tgz#69409372c54fe3381092bc363a00650b6ac37218" + integrity sha512-bvxi1QLJHcaywCAEsAk4DG3nVoqiY2Csps3qzWalhj5hFqRn1d/OixkFXtLO1PrgHUcAP0FNaSY/5GYNfENFFQ== + dependencies: + mute-stream "~1.0.0" + +readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@^4.1.0: + version "4.4.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.4.2.tgz#e6aced27ad3b9d726d8308515b9a1b98dc1b9d13" + integrity sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + string_decoder "^1.3.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerate-unicode-properties@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" + integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== + dependencies: + regenerate "^1.4.2" + +regenerate@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== + dependencies: + "@babel/runtime" "^7.8.4" + +regexpu-core@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" + integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== + dependencies: + "@babel/regjsgen" "^0.8.0" + regenerate "^1.4.2" + regenerate-unicode-properties "^10.1.0" + regjsparser "^0.9.1" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" + +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== + dependencies: + jsesc "~0.5.0" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.14.2, resolve@^1.22.1: + version "1.22.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" + integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rollup-plugin-serve@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-2.0.2.tgz#f49958b0725c9bd2fef976d23025a361e20bdee2" + integrity sha512-ALqyTbPhlf7FZ5RzlbDvMYvbKuCHWginJkTo6dMsbgji/a78IbsXox+pC83HENdkTRz8OXrTj+aShp3+3ratpg== + dependencies: + mime ">=2.4.6" + opener "1" + +rollup-plugin-typescript2@^0.35.0: + version "0.35.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.35.0.tgz#a84fb4e802b919613f31552c69c3415101b547c1" + integrity sha512-szcIO9hPUx3PhQl91u4pfNAH2EKbtrXaES+m163xQVE5O1CC0ea6YZV/5woiDDW3CR9jF2CszPrKN+AFiND0bg== + dependencies: + "@rollup/pluginutils" "^4.1.2" + find-cache-dir "^3.3.2" + fs-extra "^10.0.0" + semver "^7.3.7" + tslib "^2.4.0" + +rollup@^2.63.0: + version "2.79.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" + integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== + optionalDependencies: + fsevents "~2.3.2" + +rollup@^3.28.0: + version "3.28.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.28.0.tgz#a3c70004b01934760c0cb8df717c7a1d932389a2" + integrity sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw== + optionalDependencies: + fsevents "~2.3.2" + +run-applescript@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-5.0.0.tgz#e11e1c932e055d5c6b40d98374e0268d9b11899c" + integrity sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg== + dependencies: + execa "^5.0.0" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.6.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.0.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.0.0, semver@^7.1.1, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" + integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +sigstore@^1.3.0, sigstore@^1.4.0, sigstore@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.9.0.tgz#1e7ad8933aa99b75c6898ddd0eeebc3eb0d59875" + integrity sha512-0Zjz0oe37d08VeOtBIuB6cRriqXse2e8w+7yIy2XSXjshRKxbc2KkhXjL229jXSxEm7UbcjS76wcJDGQddVI9A== + dependencies: + "@sigstore/bundle" "^1.1.0" + "@sigstore/protobuf-specs" "^0.2.0" + "@sigstore/sign" "^1.0.0" + "@sigstore/tuf" "^1.0.3" + make-fetch-happen "^11.0.1" + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +smart-buffer@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" + integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== + +smob@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/smob/-/smob-1.4.0.tgz#ac9751fe54b1fc1fc8286a628d4e7f824273b95a" + integrity sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg== + +socks-proxy-agent@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" + integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== + dependencies: + agent-base "^6.0.2" + debug "^4.3.3" + socks "^2.6.2" + +socks@^2.6.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.7.1.tgz#d8e651247178fde79c0663043e07240196857d55" + integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== + dependencies: + ip "^2.0.0" + smart-buffer "^4.2.0" + +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.13" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" + integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + +ssri@^10.0.0, ssri@^10.0.1, ssri@^10.0.4: + version "10.0.4" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.4.tgz#5a20af378be586df139ddb2dfb3bf992cf0daba6" + integrity sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ== + dependencies: + minipass "^5.0.0" + +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +string_decoder@^1.1.1, string_decoder@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.15.3: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.4.0.tgz#17bfcf686288f531db3dea3215510621ccb55954" + integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw== + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +synckit@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3" + integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q== + dependencies: + "@pkgr/utils" "^2.3.1" + tslib "^2.5.0" + +tar@^6.1.11, tar@^6.1.13, tar@^6.1.15, tar@^6.1.2: + version "6.1.15" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" + integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + +terser@^5.17.4: + version "5.19.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.19.2.tgz#bdb8017a9a4a8de4663a7983f45c506534f9234e" + integrity sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + +text-table@^0.2.0, text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +tiny-relative-date@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== + +titleize@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/titleize/-/titleize-3.0.0.tgz#71c12eb7fdd2558aa8a44b0be83b8a76694acd53" + integrity sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +treeverse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-3.0.0.tgz#dd82de9eb602115c6ebd77a574aae67003cb48c8" + integrity sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ== + +ts-api-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.1.tgz#8144e811d44c749cd65b2da305a032510774452d" + integrity sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A== + +tslib@^2.1.0, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" + integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== + +tuf-js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.7.tgz#21b7ae92a9373015be77dfe0cb282a80ec3bbe43" + integrity sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg== + dependencies: + "@tufjs/models" "1.0.4" + debug "^4.3.4" + make-fetch-happen "^11.1.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +typescript@^4.5.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +typescript@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" + integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== + +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" + integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== + +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== + dependencies: + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" + +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== + +unique-filename@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea" + integrity sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g== + dependencies: + unique-slug "^4.0.0" + +unique-slug@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-4.0.0.tgz#6bae6bb16be91351badd24cdce741f892a6532e3" + integrity sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ== + dependencies: + imurmurhash "^0.1.4" + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +untildify@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" + integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== + +update-browserslist-db@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" + integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util-deprecate@^1.0.1, util-deprecate@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +validate-npm-package-license@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +validate-npm-package-name@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz#f16afd48318e6f90a1ec101377fa0384cfc8c713" + integrity sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ== + dependencies: + builtins "^5.0.0" + +walk-up-path@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-3.0.1.tgz#c8d78d5375b4966c717eb17ada73dbd41490e886" + integrity sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA== + +wcwidth@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +which@^3.0.0, which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/which/-/which-3.0.1.tgz#89f1cd0c23f629a8105ffe69b8172791c87b4be1" + integrity sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== + dependencies: + string-width "^1.0.2 || 2 || 3 || 4" + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^5.0.0, write-file-atomic@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7" + integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^4.0.1" + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 75f763d14dd1ea049ef4102f4d53d8f337a995a4 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 15:27:14 +0100 Subject: [PATCH 02/40] refactor: remove show and use 0 instead --- README.md | 32 +++++++++++++++---------------- dist/sunsynk-power-flow-card.js | 4 ++-- src/defaults.ts | 7 +++++++ src/index.ts | 34 +++++++++++++++++++-------------- src/types.ts | 1 - 5 files changed, 45 insertions(+), 33 deletions(-) create mode 100644 src/defaults.ts diff --git a/README.md b/README.md index 81c4ac24..b16b5888 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ An animated Home Assistant card to emulate the power flow that's shown on the Su ## Features * Option to switch between two card styles: `lite` or `full`. * Animated power flow based on positive/negative/zero sensor values with configurable dynamic speed. (Supports inverted battery, AUX and grid power). -* Dynamic battery image based on SOC (empty->low->medium->high). +* Dynamic battery image based on SOC (empty->low->medium->high). * Grid connected status. -* Inverter status (standby, normal, self-test, alarm, fault). +* Inverter status (standby, normal, self-test, alarm, fault). * Configurable battery size and shutdown SOC to calculate and display remaining battery runtime based on current battery usage and system time slot setting i.e. SOC, Grid Charge. Can be toggled off. * Daily Totals that can be toggled on or off. -* Hide all solar data if not installed or specify number of mppts in use. Set custom MPPT labels. +* Hide all solar data if not installed or specify number of mppts in use. Set custom MPPT labels. * "Use Timer" setting and "Energy Pattern" setting (Priority Load or Priority Battery) shown as dynamic icons with ability to hide if not required. If setup as switches can be toggled by clicking on the card * Panel mode for bigger card * AUX and Non-essential can be hidden from the full card or assigned configurable labels @@ -54,13 +54,13 @@ The card can be installed manually or via HACS You can add to HACS as a Custom Repo ## Usage -Add the `Custom: Sunsynk Power Flow Card` to your Dashboard view. +Add the `Custom: Sunsynk Power Flow Card` to your Dashboard view. ![image](https://user-images.githubusercontent.com/7227275/235375690-65d17663-e117-4626-9151-1a41979a13b8.png) ### Card Options -The card can be configured through the following attributes: +The card can be configured through the following attributes: | Attribute | Requirement | Default |Description | | --- | --- | --- | --- | @@ -90,24 +90,24 @@ Note that the card will always display batter power as a positive number regardl | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | -|energy: | **Required** | `15960` | Total Battery Energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `hidden` the remaining battery runtime will be hidden| +|energy: | **Required** | `0` | Total Battery Energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| |shutdown_soc: | **Required** | `20` |The battery shutdown percentage used to calculate remaining runtime | |invert_power:| Optional | `no`|Set to `yes` if your sensor provides a positive number for battery charge and negative number for battery discharge| |colour:| Optional| `pink`| Changes the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional| `no` | Toggles the Daily Total (`yes/no`) | -|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on Power draw | +|show_daily: | Optional| `no` | Toggles the Daily Total (`yes/no`) | +|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `4500` | Maximun Power draw to calculate animation speed | |full_capacity: | Optional| `80` | If SOC >= to this value the Fully Charged battery image will be shown. Accepts any value between 80-100| |empty_capacity: | Optional | `30` | If SOC <= to this value the Empty battery image will be shown. Accepts any value between 1-30 ### Solar -These attributes are only needed if `show_solar` is set to `yes` +These attributes are only needed if `show_solar` is set to `yes` | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | |colour:| Optional | `orange` | Changes the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |show_daily: | Optional | `no` | Toggles the Daily Total (`yes/no`) | |mppts: | **Required** | `two` | Specify the number of MPPT's in use `one`, `two`, `three` or `four` | -|animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | +|animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | |pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | |pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | @@ -121,13 +121,13 @@ These attributes are only needed if `show_solar` is set to `yes` |show_daily: | Optional |`no` | Toggles the Daily Total `yes/no` Only displayed if `show_aux` is set to `no` | |show_aux: | Optional | `no` | Toggles the display of Aux (`yes/no`) | |invert_aux: | Optional | `no` | Set to `yes` if your sensor provides a positive number for AUX input and negative number for AUX output | -|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | +|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | |aux_name: | Optional | `Auxilary` | Set the display name for the Auxilary Load |aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. |aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| additional_loads: | Optional | `no` | Display additional loads on the essential side (`one/two/no`) +| additional_loads: | Optional | `no` | Display additional loads on the essential side (`one/two/no`) | load1_name: | Optional | | Set the display name for the Essential Load 1 | load2_name: | Optional | | Set the display name for the Essential Load 2 | load1_icon: | Optional | none | Change the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | @@ -149,7 +149,7 @@ These attributes are only needed if `show_solar` is set to `yes` |load1_icon: | Optional | `default` | Change the nonessential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | |load2_icon: | Optional | `default` | Change the nonessential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | |invert_grid:| Optional | `no`| Set to `yes` if your sensor provides a negative number for Grid import and positive number for Grid export | -|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | +|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | ### Entities @@ -180,7 +180,7 @@ See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Ma |battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery Voltage (V) | |battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery State of Charge (%) | |battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery Power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | -|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery Current (A) | +|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery Current (A) | |essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant. (W) | |essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W)| |essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W)| @@ -224,9 +224,9 @@ See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Ma |prog6_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) |energy_cost:| Optional | | Sensor that provides current energy cost per kWh |solar_sell_247:|Optional | `switch.sunsynk_toggle_solar_sell` | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) - + The card calculates the sensors below based on supplied attributes in the config so you dont need to define them in Home Assistant. NOTE if your essential and non-essential readings are innacurate replace sensor 169 with 167. Alternatively provide the card with sensors that calculate this data i.e essential_power: and nonessential_power: - + ``` totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 nonessential = grid_ct_power_172 - grid_power_169 diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 85b05894..9bcb2eea 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const s=window,i=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var m;x[g]=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:x}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=R(1),N=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[O(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(O(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;lt}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=R(1),N=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),O=new WeakMap,U=H.createTreeWalker(H,129,null,!1);function z(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[z(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),U.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=U.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(z(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;l"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t,yt,wt,gt,xt,mt,ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Dt,Nt,$t,Yt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v".concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:15960,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:"two"},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,w,g,x,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,Ut,zt,Ot,Qt,jt,Wt,Gt,Xt,Kt,Jt,te;const ee=this._config,ne=this.hass.states[ee.entities.day_battery_discharge_71]||{state:"0"},se=this.hass.states[ee.entities.day_battery_charge_70]||{state:"0"},ie=this.hass.states[ee.entities.day_load_energy_84]||{state:"0"},oe=this.hass.states[ee.entities.day_grid_import_76]||{state:"0"},le=this.hass.states[ee.entities.day_pv_energy_108]||{state:"0"},ae=this.hass.states[ee.entities.inverter_voltage_154]||{state:"0"},re=this.hass.states[ee.entities.load_frequency_192]||{state:"0"},he=this.hass.states[ee.entities.inverter_current_164]||{state:"0"},de=this.hass.states[ee.entities.pv2_power_187]||{state:"0"},pe=this.hass.states[ee.entities.pv1_power_186]||{state:"0"},ce=this.hass.states[ee.entities.battery_voltage_183]||{state:"0"},ve=this.hass.states[ee.entities.battery_soc_184]||{state:"0"},_e=this.hass.states[ee.entities.battery_power_190]||{state:"0"},ye=this.hass.states[ee.entities.essential_power]||{state:"0"},we=this.hass.states[ee.entities.grid_ct_power_172]||{state:"0"},ge=this.hass.states[ee.entities.pv1_voltage_109]||{state:"0"},xe=this.hass.states[ee.entities.pv1_current_110]||{state:"0"},me=this.hass.states[ee.entities.pv2_voltage_111]||{state:"0"},fe=this.hass.states[ee.entities.pv2_current_112]||{state:"0"},ue=this.hass.states[ee.entities.grid_connected_status_194]||{state:"on"},qe=this.hass.states[ee.entities.inverter_status_59]||{state:""},Te=this.hass.states[ee.entities.inverter_power_175]||{state:"0"},ke=this.hass.states[ee.entities.grid_power_169]||{state:"0"},Me=this.hass.states[ee.entities.aux_power_166]||{state:"0"},Ae=this.hass.states[ee.entities.priority_load_243]||{state:"undefined"},He=this.hass.states[ee.entities.use_timer_248]||{state:"undefined"},be=this.hass.states[ee.entities.pv3_voltage_113]||{state:"0"},Ze=this.hass.states[ee.entities.pv3_current_114]||{state:"0"},Le=this.hass.states[ee.entities.pv4_voltage_115]||{state:"0"},Ee=this.hass.states[ee.entities.pv4_current_116]||{state:"0"},Pe=this.hass.states[ee.entities.pv3_power_188]||{state:"0"},Ve=this.hass.states[ee.entities.pv4_power_189]||{state:"0"},Ie=this.hass.states[ee.entities.day_grid_export_77]||{state:"0"},Ce=this.hass.states[ee.entities.nonessential_power]||{state:"0"},Be=this.hass.states[ee.entities.battery_current_191]||{state:"0"},Fe=this.hass.states[ee.entities.remaining_solar]||{state:"0"},Se=this.hass.states[ee.entities.battery_temp_182]||{state:""},Re=this.hass.states[ee.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ee.entities.radiator_temp_91]||{state:""},Ne=this.hass.states[ee.entities.non_essential_load1]||{state:"0"},$e=this.hass.states[ee.entities.non_essential_load2]||{state:"0"},Ye=this.hass.states[ee.entities.essential_load1]||{state:"0"},Ue=this.hass.states[ee.entities.energy_cost]||{state:""},ze=this.hass.states[ee.entities.solar_sell_247]||{state:"undefined"},Oe=this.hass.states[ee.entities.essential_load2]||{state:"0"},Qe=this.hass.states[ee.entities.pv_total]||{state:"0"},je=this.hass.states[ee.entities.aux_connected_status]||{state:"on"};let We="yes"===((null===(t=null==ee?void 0:ee.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Me.state):parseInt(Me.state),Ge="yes"===((null===(n=null==ee?void 0:ee.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(we.state):parseInt(we.state),Xe=(null===(s=null==ee?void 0:ee.inverter)||void 0===s?void 0:s.modern)||"yes",Ke=(null===(i=null==ee?void 0:ee.load)||void 0===i?void 0:i.colour)||"#5fb6ad",Je=(null===(o=null==ee?void 0:ee.load)||void 0===o?void 0:o.aux_colour)||Ke,tn=(null===(l=null==ee?void 0:ee.load)||void 0===l?void 0:l.aux_off_colour)||Ke,en=(null===(a=null==ee?void 0:ee.load)||void 0===a?void 0:a.show_daily)||"no",nn=(null===(r=null==ee?void 0:ee.grid)||void 0===r?void 0:r.colour)||"#5490c2",sn=(null===(h=null==ee?void 0:ee.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",on=(null===(d=null==ee?void 0:ee.grid)||void 0===d?void 0:d.show_nonessential)||"yes",ln=(null===(p=null==ee?void 0:ee.entities)||void 0===p?void 0:p.grid_connected_status_194)?ue.state:"on",an=(null===(c=null==ee?void 0:ee.entities)||void 0===c?void 0:c.aux_connected_status)?je.state:"on",rn=(null===(v=null==ee?void 0:ee.entities)||void 0===v?void 0:v.load_frequency_192)?re.state:0,hn=(null===(_=null==ee?void 0:ee.entities)||void 0===_?void 0:_.inverter_voltage_154)?ae.state:0,dn=(null===(y=null==ee?void 0:ee.entities)||void 0===y?void 0:y.inverter_current_164)?he.state:0,pn=(null===(w=null==ee?void 0:ee.entities)||void 0===w?void 0:w.battery_voltage_183)?ce.state:0,cn=null===(g=null==ee?void 0:ee.grid)||void 0===g?void 0:g.additional_loads;"no"!==cn&&"one"!==cn&&"two"!==cn&&(cn="no");let vn=(null===(x=null==ee?void 0:ee.grid)||void 0===x?void 0:x.show_daily_buy)||"no",_n=(null===(m=null==ee?void 0:ee.grid)||void 0===m?void 0:m.show_daily_sell)||"no",yn=(null===(f=null==ee?void 0:ee.battery)||void 0===f?void 0:f.colour)||"pink",wn=(null===(u=null==ee?void 0:ee.battery)||void 0===u?void 0:u.show_daily)||"no",gn=(null===(q=null==ee?void 0:ee.solar)||void 0===q?void 0:q.colour)||"orange",xn=(null===(T=null==ee?void 0:ee.solar)||void 0===T?void 0:T.show_daily)||"no",mn=null===(k=null==ee?void 0:ee.load)||void 0===k?void 0:k.show_aux;"no"!==mn&&"yes"!==mn&&(mn="no");let fn=null===(M=null==ee?void 0:ee.load)||void 0===M?void 0:M.additional_loads;"no"!==fn&&"one"!==fn&&"two"!==fn&&(fn="no");let un=(null===(A=null==ee?void 0:ee.load)||void 0===A?void 0:A.aux_type)||"default",qn=(null===(H=null==ee?void 0:ee.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Tn=(null===(b=null==ee?void 0:ee.grid)||void 0===b?void 0:b.load1_icon)||"default",kn=(null===(Z=null==ee?void 0:ee.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Mn=(null===(L=null==ee?void 0:ee.load)||void 0===L?void 0:L.load1_icon)||"default",An=(null===(E=null==ee?void 0:ee.load)||void 0===E?void 0:E.load2_icon)||"default",Hn=ee.entities.remaining_solar?parseFloat(Fe.state).toFixed(1):"false",bn=(null==ee?void 0:ee.large_font)||"no",Zn=(null==ee?void 0:ee.panel_mode)||"no",Ln=(null===(P=null==ee?void 0:ee.inverter)||void 0===P?void 0:P.colour)||"grey",En=(null===(V=null==ee?void 0:ee.inverter)||void 0===V?void 0:V.autarky)||"power",Pn="no"!==(null==ee?void 0:ee.entities.use_timer_248)&&(null==ee?void 0:ee.entities.use_timer_248)?He.state:"no",Vn="no"!==(null==ee?void 0:ee.entities.priority_load_243)&&(null==ee?void 0:ee.entities.priority_load_243)?Ae.state:"no",In="yes"===(null===(I=null==ee?void 0:ee.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(_e.state):parseInt(_e.state),Cn=(null==ee?void 0:ee.card_height)||"396px",Bn=(null===(C=null==ee?void 0:ee.battery)||void 0===C?void 0:C.full_capacity)||80,Fn=(null===(B=null==ee?void 0:ee.battery)||void 0===B?void 0:B.empty_capacity)||30,Sn=parseInt(parseFloat(de.state||"0").toFixed(0))+parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(Pe.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0)),Rn=(null===(F=null==ee?void 0:ee.entities)||void 0===F?void 0:F.pv_total)?parseInt(Qe.state):Sn,Dn="none"!==(null==ee?void 0:ee.entities.essential_power)&&(null==ee?void 0:ee.entities.essential_power)?parseInt(ye.state):parseInt(Te.state)+parseInt(ke.state)-parseInt(Me.state),Nn="none"!==(null==ee?void 0:ee.entities.nonessential_power)&&(null==ee?void 0:ee.entities.nonessential_power)?parseInt(Ce.state):parseInt(we.state)-parseInt(ke.state);const $n={time:this.hass.states[ee.entities.prog1_time]||{state:""},capacity:this.hass.states[ee.entities.prog1_capacity]||{state:""},charge:this.hass.states[ee.entities.prog1_charge]||{state:""}},Yn={time:this.hass.states[ee.entities.prog2_time]||{state:""},capacity:this.hass.states[ee.entities.prog2_capacity]||{state:""},charge:this.hass.states[ee.entities.prog2_charge]||{state:""}},Un={time:this.hass.states[ee.entities.prog3_time]||{state:""},capacity:this.hass.states[ee.entities.prog3_capacity]||{state:""},charge:this.hass.states[ee.entities.prog3_charge]||{state:""}},zn={time:this.hass.states[ee.entities.prog4_time]||{state:""},capacity:this.hass.states[ee.entities.prog4_capacity]||{state:""},charge:this.hass.states[ee.entities.prog4_charge]||{state:""}},On={time:this.hass.states[ee.entities.prog5_time]||{state:""},capacity:this.hass.states[ee.entities.prog5_capacity]||{state:""},charge:this.hass.states[ee.entities.prog5_charge]||{state:""}},Qn={time:this.hass.states[ee.entities.prog6_time]||{state:""},capacity:this.hass.states[ee.entities.prog6_capacity]||{state:""},charge:this.hass.states[ee.entities.prog6_charge]||{state:""}};let jn={capacity:ee.battery.shutdown_soc,entityID:""};if(ee.entities.use_timer_248&&"no"!==ee.entities.use_timer_248&&"off"!==He.state)if(ee.entities.prog1_time&&ee.entities.prog2_time&&ee.entities.prog3_time&&ee.entities.prog4_time&&ee.entities.prog5_time&&ee.entities.prog6_time){jn.show="yes";const ws=new Date,gs=[];[$n,Yn,Un,zn,On,Qn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));gs[e]=new Date(ws.getTime()),gs[e].setHours(n),gs[e].setMinutes(s)}));const[xs,ms,fs,us,qs,Ts]=gs;function ks(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?jn.charge="none":jn.charge="both",jn.capacity=parseInt(t.capacity.state),jn.entityID=e}ws>=Ts||ws=xs&&ws=ms&&ws=fs&&ws=us&&ws=qs&&ws0?Wn="off"===ue.state||"no"===jn.show||parseInt(ve.state)<=jn.capacity?ee.battery.shutdown_soc:jn.capacity:In<0&&("off"===ue.state||"no"===jn.show||parseInt(ve.state)>=jn.capacity?Wn=100:parseInt(ve.state)0?Gn=(parseInt(ve.state)-Wn)/100*(ee.battery.energy||15960)/In*60*60:In<0&&(Gn=(Wn-parseInt(ve.state))/100*ee.battery.energy/In*60*60*-1);const Ms=new Date,As=1e3*Gn,Hs=new Date(Ms.getTime()+As),bs=Hs.getHours(),Zs=Hs.getMinutes().toString().padStart(2,"0"),Ls=bs.toString().padStart(2,"0");Xn="".concat(Ls,":").concat(Zs);const Es=Math.floor(Gn/86400),Ps=Math.floor(Gn%86400/3600),Vs=Math.floor(Gn%3600/60);Es>0&&(Kn+="".concat(Es," days, ")),(Ps>0||Es>0)&&(Kn+="".concat(Ps," hrs, ")),Kn+="".concat(Vs," min")}let Jn=-2<=parseInt(Be.state)&&parseInt(Be.state)<=2&&parseInt(ve.state)>=99?"True":"False",ts="",es="";switch(qe.state){case"0":case"standby":ts="blue",es="Standby";break;case"1":case"selftest":ts="yellow",es="Selftest";break;case"2":case"normal":case"ok":ts="green",es="Normal";break;case"3":case"alarm":ts="orange",es="Alarm";break;case"4":case"fault":ts="red",es="Fault";break;default:"none"!==(null===(S=null==ee?void 0:ee.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ee?void 0:ee.entities)||void 0===R?void 0:R.inverter_status_59)?(ts="transparent",es="Status"):(ts="transparent",es="")}let ns=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ss=(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=0!=ss?Math.min(Math.round(100*ns/ss),100):0,os=0!=ns?Math.min(Math.round(100*ss/ns),100):0,ls=Sn+parseInt("".concat(In>0?In:0))+parseInt("".concat(We<0?-1*We:0)),as=Dn+Nn+parseInt("".concat(We>0?We:0))+parseInt("".concat(In<0?-1*In:0)),rs=0!=as?Math.min(Math.round(100*ls/as),100):0,hs=0!=ls?Math.min(Math.round(100*as/ls),100):0,ds=(null===($=null==ee?void 0:ee.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ee&&ee.solar&&ee.solar.animation_speed){let Is=ee.solar.animation_speed-(ee.solar.animation_speed-1)*(Sn/(ee.solar.max_power||Sn));ds="".concat(Is>=1?Is:1)}let ps=(null===(Y=null==ee?void 0:ee.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ee&&ee.battery&&ee.battery.animation_speed){let Cs=ee.battery.animation_speed-(ee.battery.animation_speed-1)*((In<0?-1*In:In)/(ee.battery.max_power||(In<0?-1*In:In)));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(U=null==ee?void 0:ee.load)||void 0===U?void 0:U.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Bs=ee.load.animation_speed-(ee.load.animation_speed-1)*(Dn/(ee.load.max_power||Dn));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(z=null==ee?void 0:ee.load)||void 0===z?void 0:z.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Fs=ee.load.animation_speed-(ee.load.animation_speed-1)*((parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))/(ee.load.max_power||(parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(O=null==ee?void 0:ee.grid)||void 0===O?void 0:O.animation_speed)||"8";if(ee&&ee.grid&&ee.grid.animation_speed){let Ss=ee.grid.animation_speed-(ee.grid.animation_speed-1)*((parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))/(ee.grid.max_power||(parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(Q=null==ee?void 0:ee.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ee&&ee.grid&&ee.grid.animation_speed){let Rs=ee.grid.animation_speed-(ee.grid.animation_speed-1)*(Nn/(ee.grid.max_power||Nn));ys="".concat(Rs>=1?Rs:1)}return"full"===ee.cardstyle?D(_t||(_t=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n DAILY LOAD\n DAILY LOAD\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY GRID BUY\n DAILY GRID SELL\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ke,Ke,Je,tn,nn,nn,"no"===Zn?"".concat(Cn):"100%",gn,"no"===ee.show_solar?"st12":"",yn,nn,nn,Je,"no"===mn?"st12":"",Ke,Ln,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",nn,"no"===on?"st12":"","one"===cn?"":"none",nn,"no"===on?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","no"===mn?"30":"143",Ke,"one"===fn?"":"none","no"===mn?"376":"373","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===mn?"413":"410","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===bn?"st14":"st4",!1===ee.battery.show||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,!1===ee.battery.show||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||"False"===Jn?"transparent":"".concat(yn),"no"===ee.show_solar?"none":"",gn,(null===(j=null==ee?void 0:ee.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(W=null==ee?void 0:ee.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(G=null==ee?void 0:ee.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(X=null==ee?void 0:ee.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ee.solar.pv4_name):"PV4",nn,Ln,es,"one"!==fn&&"two"!==fn||"yes"!==mn?"":"none",Ke,"no"===fn||"no"===mn?"none":"",Ke,"no"===mn?"70":"181","one"===fn?"":"none",Ke,(null===(K=null==ee?void 0:ee.load)||void 0===K?void 0:K.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"47":"158","one"===fn?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"393":"390","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(J=null==ee?void 0:ee.load)||void 0===J?void 0:J.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"394":"391","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"429":"426","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(tt=null==ee?void 0:ee.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ee.load.load2_name):"","no"===mn?"430":"427","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),"no"===en||"no"===mn?"transparent":"".concat(Ke),"no"===fn?"83%":"67%","no"===fn?"18.5%":"24.25%","no"===en||"yes"===mn?"transparent":"".concat(Ke),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===on?"68%":"76%","no"===on?"96%":"66%","no"===vn?"transparent":"".concat(nn),"no"===on?"68%":"76%","no"===on?"88%":"58%","no"===_n?"transparent":"".concat(nn),"no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),(null===(et=null==ee?void 0:ee.load)||void 0===et?void 0:et.aux_name)?"".concat(ee.load.aux_name):"Auxiliary","no"===on?"none":"",nn,(null===(nt=null==ee?void 0:ee.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ee.grid.nonessential_name):"Non Essential","no"===on||"no"===cn||"two"===cn?"none":"",nn,(null===(st=null==ee?void 0:ee.grid)||void 0===st?void 0:st.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(it=null==ee?void 0:ee.grid)||void 0===it?void 0:it.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(ot=null==ee?void 0:ee.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ee.grid.load2_name):"","no"===on||"no"===cn||"two"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,ts,"yes"===mn?"":"none","one"===fn||"two"===fn?"":"st12",Ke,"no"===mn?"":"none","one"===fn?"":"st12",Ke,"no"===mn?"":"none","two"===fn?"":"st12",Ke,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s/2,Ge>0||0===Ge?"transparent":"".concat(nn),_s/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys,"no"===mn?"st12":"",Je,"no"===mn||0===We?"st12":"",We<0?"transparent":"".concat(Je),vs,"no"===mn||0===We?"st12":"",We>0?"transparent":"".concat(Je),vs,"no"===mn?"st12":"",Je,nn,Ln,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,Ln,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?"1":"0",yn,parseInt(ve.state)<=Fn?1:0,yn,"no"===ee.show_solar?"st12":"",gn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,"default"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"oven"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"boiler"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"pump"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"aircon"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"no"===on||"two"===cn||"one"===cn?"none":"",qn,"default"===Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"===Tn&&"default"!=kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"!=Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"no"===on||"no"===cn||"one"===cn?"none":"",Tn,"no"===on||"no"===cn||"one"===cn?"none":"",kn,"default"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"no"===on||"no"===cn||"two"===cn?"none":"",Tn,"one"!==fn&&"two"!==fn||"no"!==mn?"none":"",Ke,"one"!==fn&&"two"!==fn||"yes"!==mn?"none":"",Ke,"one"===fn||"two"===fn?"none":"",Ke,(t=>this.handlePopup(t,ee.entities.aux_connected_status)),"default"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"gen"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"inverter"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"oven"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"boiler"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"aircon"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"pump"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"no"===mn?"none":"",un,"on"===an||"1"===an?"aux-icon":"aux-off-icon","boiler"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"no"===fn||"one"===fn?"none":"","yes"===mn?"350":"383","yes"===mn?"140":"5",Mn,"no"===fn||"one"===fn?"none":"","yes"===mn?"446":"420","yes"===mn?"140":"5",An,"no"===fn||"two"===fn?"none":"","336","yes"===mn?"140":"27",Mn,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"no"!=En?"60.5%":"65%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"60.5%":"65%","off"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","off"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"off"!==ze.state&&"0"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"on"!==ze.state&&"1"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"no"!=En?"65.5%":"70%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"65.5%":"70%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===en||"no"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===fn?"83%":"67%","no"===fn?"15%":"21%","no"===en||"yes"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===on?"68%":"76%","no"===on?"92.5%":"62.5%","no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===on?"68%":"76%","no"===on?"84.25%":"54.5%","no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(null===(lt=null==ee?void 0:ee.entities)||void 0===lt?void 0:lt.pv_total)?N(yt||(yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(wt||(wt=e([' '," W "])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.essential_power?N(gt||(gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||"0"):N(xt||(xt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0),"none"!==ee.entities.nonessential_power?N(mt||(mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.nonessential_power)),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0):N(ft||(ft=e([''," W "])),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0),(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,"none"!==ee.entities.aux_power_166?N(ut||(ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.aux_power_166)),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We):N(qt||(qt=e([''," W "])),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We),"none"!==ee.entities.pv1_power_186?N(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(kt||(kt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(At||(At=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(bt||(bt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Lt||(Lt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none","no"===bn?"st14":"st4",nn,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none","no"===bn?"st14":"st4",nn,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none","no"===bn?"st14":"st4",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.inverter_power_175)),"none"===ee.entities.inverter_power_175?"none":"","no"===bn?"st14":"st4",Ln,Te.state||0,(t=>this.handlePopup(t,ee.entities.grid_power_169)),"none"===ee.entities.grid_power_169?"none":"","no"===bn?"st14":"st4",nn,ke.state||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(at=null==ee?void 0:ee.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"four"===(null===(rt=null==ee?void 0:ee.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%","four"===(null===(ht=null==ee?void 0:ee.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(dt=null==ee?void 0:ee.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(pt=null==ee?void 0:ee.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(ct=null==ee?void 0:ee.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",Ue.state||""):"lite"===ee.cardstyle?D(Et||(Et=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY LOAD\n DAILY GRID BUY\n DAILY GRID SELL\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ke,"no"===ee.show_solar?145.33:-.5,"no"===ee.show_solar?270.67:406,"".concat("no"===Zn?"no"===ee.show_solar?"246px":"".concat(Cn):"no"===ee.show_solar?"75%":"100%"),Ke,gn,"no"===ee.show_solar?"st12":"",yn,nn,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",Ke,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",!1===ee.battery.show||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,!1===ee.battery.show||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,!1===ee.battery.show||"False"===Jn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"two"===fn?"365":"400.4","two"===fn?"182.2":"282.1","no"===en?"transparent":"".concat(Ke),"no"===vn?"transparent":"".concat(nn),"no"===_n?"transparent":"".concat(nn),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===ee.show_solar?"none":"",gn,(null===(vt=null==ee?void 0:ee.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(Ut=null==ee?void 0:ee.solar)||void 0===Ut?void 0:Ut.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(zt=null==ee?void 0:ee.solar)||void 0===zt?void 0:zt.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(Ot=null==ee?void 0:ee.solar)||void 0===Ot?void 0:Ot.pv4_name)?"".concat(ee.solar.pv4_name):"PV4","no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Qt=null==ee?void 0:ee.load)||void 0===Qt?void 0:Qt.load1_name)?"".concat(ee.load.load1_name):"","one"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(jt=null==ee?void 0:ee.load)||void 0===jt?void 0:jt.load1_name)?"".concat(ee.load.load1_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Wt=null==ee?void 0:ee.load)||void 0===Wt?void 0:Wt.load2_name)?"".concat(ee.load.load2_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),ts,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,0===Dn?"transparent":"".concat(Ke),cs,"one"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"oven"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"no"===fn||"no"===ee.show_solar?"none":"",Mn,"no"===fn||"one"===fn||"no"===ee.show_solar?"none":"",An,"no"===ee.show_solar?"st12":"",gn,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?1:0,yn,parseInt(ve.state)<=Fn?1:0,yn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,Ke,Ln,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"on"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"on"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"off"!==ze.state&&"0"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"on"!==ze.state&&"1"!==ze.state&&"no"!==ee.show_solar?"":"none",gn,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"two"===fn?"365":"400.4","two"===fn?"168":"267.9","no"===en?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none",Ln,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none",Ln,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(Gt=null==ee?void 0:ee.entities)||void 0===Gt?void 0:Gt.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(Xt=null==ee?void 0:ee.entities)||void 0===Xt?void 0:Xt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(Kt=null==ee?void 0:ee.entities)||void 0===Kt?void 0:Kt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(Jt=null==ee?void 0:ee.entities)||void 0===Jt?void 0:Jt.energy_cost)?"":"none",Ue.state||"",(null===(te=null==ee?void 0:ee.entities)||void 0===te?void 0:te.pv_total)?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(Vt||(Vt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ee.entities.essential_power?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||0):N(Yt||(Yt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error("Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple");if(!t.show_solar)throw Error("Please include the show_solar attribute e.g. show_solar: yes");if(!t.battery)throw Error("No battery attributes defined");if(!t.battery.energy)throw new Error("Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320");if(!t.battery.shutdown_soc)throw new Error("Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20");if(t.battery.full_capacity<80)throw new Error("Full capacity needs to be between 80 and 100");if(t.battery.empty_capacity>30)throw new Error("Empty capacity needs to be <= 30");if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error("Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs");if("yes"===t.show_solar&&!t.solar)throw Error("No solar attributes defined");if("yes"===t.show_solar&&!t.solar.mppts)throw Error("Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two");if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error("Please include the day_pv_energy_108 attribute and entity ID");if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error("Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs");if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error("The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.");if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error("The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.");const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));this._config=t}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen"})})); + */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt,wt,gt,xt,mt,ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Dt,Nt,$t,Yt,Ot;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v".concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:0,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:"two"},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,w,g,x,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,O,U,z,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,_t,Ut,zt,Qt,jt,Wt,Gt,Xt,Kt,Jt,te;const ee=this._config,ne=this.hass.states[ee.entities.day_battery_discharge_71]||{state:"0"},se=this.hass.states[ee.entities.day_battery_charge_70]||{state:"0"},ie=this.hass.states[ee.entities.day_load_energy_84]||{state:"0"},oe=this.hass.states[ee.entities.day_grid_import_76]||{state:"0"},le=this.hass.states[ee.entities.day_pv_energy_108]||{state:"0"},ae=this.hass.states[ee.entities.inverter_voltage_154]||{state:"0"},re=this.hass.states[ee.entities.load_frequency_192]||{state:"0"},he=this.hass.states[ee.entities.inverter_current_164]||{state:"0"},de=this.hass.states[ee.entities.pv2_power_187]||{state:"0"},pe=this.hass.states[ee.entities.pv1_power_186]||{state:"0"},ce=this.hass.states[ee.entities.battery_voltage_183]||{state:"0"},ve=this.hass.states[ee.entities.battery_soc_184]||{state:"0"},_e=this.hass.states[ee.entities.battery_power_190]||{state:"0"},ye=this.hass.states[ee.entities.essential_power]||{state:"0"},we=this.hass.states[ee.entities.grid_ct_power_172]||{state:"0"},ge=this.hass.states[ee.entities.pv1_voltage_109]||{state:"0"},xe=this.hass.states[ee.entities.pv1_current_110]||{state:"0"},me=this.hass.states[ee.entities.pv2_voltage_111]||{state:"0"},fe=this.hass.states[ee.entities.pv2_current_112]||{state:"0"},ue=this.hass.states[ee.entities.grid_connected_status_194]||{state:"on"},qe=this.hass.states[ee.entities.inverter_status_59]||{state:""},Te=this.hass.states[ee.entities.inverter_power_175]||{state:"0"},ke=this.hass.states[ee.entities.grid_power_169]||{state:"0"},Me=this.hass.states[ee.entities.aux_power_166]||{state:"0"},Ae=this.hass.states[ee.entities.priority_load_243]||{state:"undefined"},He=this.hass.states[ee.entities.use_timer_248]||{state:"undefined"},be=this.hass.states[ee.entities.pv3_voltage_113]||{state:"0"},Ze=this.hass.states[ee.entities.pv3_current_114]||{state:"0"},Le=this.hass.states[ee.entities.pv4_voltage_115]||{state:"0"},Ee=this.hass.states[ee.entities.pv4_current_116]||{state:"0"},Pe=this.hass.states[ee.entities.pv3_power_188]||{state:"0"},Ve=this.hass.states[ee.entities.pv4_power_189]||{state:"0"},Ie=this.hass.states[ee.entities.day_grid_export_77]||{state:"0"},Ce=this.hass.states[ee.entities.nonessential_power]||{state:"0"},Be=this.hass.states[ee.entities.battery_current_191]||{state:"0"},Fe=this.hass.states[ee.entities.remaining_solar]||{state:"0"},Se=this.hass.states[ee.entities.battery_temp_182]||{state:""},Re=this.hass.states[ee.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ee.entities.radiator_temp_91]||{state:""},Ne=this.hass.states[ee.entities.non_essential_load1]||{state:"0"},$e=this.hass.states[ee.entities.non_essential_load2]||{state:"0"},Ye=this.hass.states[ee.entities.essential_load1]||{state:"0"},Oe=this.hass.states[ee.entities.energy_cost]||{state:""},Ue=this.hass.states[ee.entities.solar_sell_247]||{state:"undefined"},ze=this.hass.states[ee.entities.essential_load2]||{state:"0"},Qe=this.hass.states[ee.entities.pv_total]||{state:"0"},je=this.hass.states[ee.entities.aux_connected_status]||{state:"on"};let We="yes"===((null===(t=null==ee?void 0:ee.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Me.state):parseInt(Me.state),Ge="yes"===((null===(n=null==ee?void 0:ee.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(we.state):parseInt(we.state),Xe=(null===(s=null==ee?void 0:ee.inverter)||void 0===s?void 0:s.modern)||"yes",Ke=(null===(i=null==ee?void 0:ee.load)||void 0===i?void 0:i.colour)||"#5fb6ad",Je=(null===(o=null==ee?void 0:ee.load)||void 0===o?void 0:o.aux_colour)||Ke,tn=(null===(l=null==ee?void 0:ee.load)||void 0===l?void 0:l.aux_off_colour)||Ke,en=(null===(a=null==ee?void 0:ee.load)||void 0===a?void 0:a.show_daily)||"no",nn=(null===(r=null==ee?void 0:ee.grid)||void 0===r?void 0:r.colour)||"#5490c2",sn=(null===(h=null==ee?void 0:ee.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",on=(null===(d=null==ee?void 0:ee.grid)||void 0===d?void 0:d.show_nonessential)||"yes",ln=(null===(p=null==ee?void 0:ee.entities)||void 0===p?void 0:p.grid_connected_status_194)?ue.state:"on",an=(null===(c=null==ee?void 0:ee.entities)||void 0===c?void 0:c.aux_connected_status)?je.state:"on",rn=(null===(v=null==ee?void 0:ee.entities)||void 0===v?void 0:v.load_frequency_192)?re.state:0,hn=(null===(_=null==ee?void 0:ee.entities)||void 0===_?void 0:_.inverter_voltage_154)?ae.state:0,dn=(null===(y=null==ee?void 0:ee.entities)||void 0===y?void 0:y.inverter_current_164)?he.state:0,pn=(null===(w=null==ee?void 0:ee.entities)||void 0===w?void 0:w.battery_voltage_183)?ce.state:0,cn=null===(g=null==ee?void 0:ee.grid)||void 0===g?void 0:g.additional_loads;"no"!==cn&&"one"!==cn&&"two"!==cn&&(cn="no");let vn=(null===(x=null==ee?void 0:ee.grid)||void 0===x?void 0:x.show_daily_buy)||"no",_n=(null===(m=null==ee?void 0:ee.grid)||void 0===m?void 0:m.show_daily_sell)||"no",yn=(null===(f=null==ee?void 0:ee.battery)||void 0===f?void 0:f.colour)||"pink",wn=(null===(u=null==ee?void 0:ee.battery)||void 0===u?void 0:u.show_daily)||"no",gn=(null===(q=null==ee?void 0:ee.solar)||void 0===q?void 0:q.colour)||"orange",xn=(null===(T=null==ee?void 0:ee.solar)||void 0===T?void 0:T.show_daily)||"no",mn=null===(k=null==ee?void 0:ee.load)||void 0===k?void 0:k.show_aux;"no"!==mn&&"yes"!==mn&&(mn="no");let fn=null===(M=null==ee?void 0:ee.load)||void 0===M?void 0:M.additional_loads;"no"!==fn&&"one"!==fn&&"two"!==fn&&(fn="no");let un=(null===(A=null==ee?void 0:ee.load)||void 0===A?void 0:A.aux_type)||"default",qn=(null===(H=null==ee?void 0:ee.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Tn=(null===(b=null==ee?void 0:ee.grid)||void 0===b?void 0:b.load1_icon)||"default",kn=(null===(Z=null==ee?void 0:ee.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Mn=(null===(L=null==ee?void 0:ee.load)||void 0===L?void 0:L.load1_icon)||"default",An=(null===(E=null==ee?void 0:ee.load)||void 0===E?void 0:E.load2_icon)||"default",Hn=ee.entities.remaining_solar?parseFloat(Fe.state).toFixed(1):"false",bn=(null==ee?void 0:ee.large_font)||"no",Zn=(null==ee?void 0:ee.panel_mode)||"no",Ln=(null===(P=null==ee?void 0:ee.inverter)||void 0===P?void 0:P.colour)||"grey",En=(null===(V=null==ee?void 0:ee.inverter)||void 0===V?void 0:V.autarky)||"power",Pn="no"!==(null==ee?void 0:ee.entities.use_timer_248)&&(null==ee?void 0:ee.entities.use_timer_248)?He.state:"no",Vn="no"!==(null==ee?void 0:ee.entities.priority_load_243)&&(null==ee?void 0:ee.entities.priority_load_243)?Ae.state:"no",In="yes"===(null===(I=null==ee?void 0:ee.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(_e.state):parseInt(_e.state),Cn=(null==ee?void 0:ee.card_height)||"396px",Bn=(null===(C=null==ee?void 0:ee.battery)||void 0===C?void 0:C.full_capacity)||80,Fn=(null===(B=null==ee?void 0:ee.battery)||void 0===B?void 0:B.empty_capacity)||30,Sn=parseInt(parseFloat(de.state||"0").toFixed(0))+parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(Pe.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0)),Rn=(null===(F=null==ee?void 0:ee.entities)||void 0===F?void 0:F.pv_total)?parseInt(Qe.state):Sn,Dn="none"!==(null==ee?void 0:ee.entities.essential_power)&&(null==ee?void 0:ee.entities.essential_power)?parseInt(ye.state):parseInt(Te.state)+parseInt(ke.state)-parseInt(Me.state),Nn="none"!==(null==ee?void 0:ee.entities.nonessential_power)&&(null==ee?void 0:ee.entities.nonessential_power)?parseInt(Ce.state):parseInt(we.state)-parseInt(ke.state);const $n={time:this.hass.states[ee.entities.prog1_time]||{state:""},capacity:this.hass.states[ee.entities.prog1_capacity]||{state:""},charge:this.hass.states[ee.entities.prog1_charge]||{state:""}},Yn={time:this.hass.states[ee.entities.prog2_time]||{state:""},capacity:this.hass.states[ee.entities.prog2_capacity]||{state:""},charge:this.hass.states[ee.entities.prog2_charge]||{state:""}},On={time:this.hass.states[ee.entities.prog3_time]||{state:""},capacity:this.hass.states[ee.entities.prog3_capacity]||{state:""},charge:this.hass.states[ee.entities.prog3_charge]||{state:""}},Un={time:this.hass.states[ee.entities.prog4_time]||{state:""},capacity:this.hass.states[ee.entities.prog4_capacity]||{state:""},charge:this.hass.states[ee.entities.prog4_charge]||{state:""}},zn={time:this.hass.states[ee.entities.prog5_time]||{state:""},capacity:this.hass.states[ee.entities.prog5_capacity]||{state:""},charge:this.hass.states[ee.entities.prog5_charge]||{state:""}},Qn={time:this.hass.states[ee.entities.prog6_time]||{state:""},capacity:this.hass.states[ee.entities.prog6_capacity]||{state:""},charge:this.hass.states[ee.entities.prog6_charge]||{state:""}};let jn={capacity:ee.battery.shutdown_soc,entityID:""};if(ee.entities.use_timer_248&&"no"!==ee.entities.use_timer_248&&"off"!==He.state)if(ee.entities.prog1_time&&ee.entities.prog2_time&&ee.entities.prog3_time&&ee.entities.prog4_time&&ee.entities.prog5_time&&ee.entities.prog6_time){jn.show="yes";const ws=new Date,gs=[];[$n,Yn,On,Un,zn,Qn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));gs[e]=new Date(ws.getTime()),gs[e].setHours(n),gs[e].setMinutes(s)}));const[xs,ms,fs,us,qs,Ts]=gs;function ks(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?jn.charge="none":jn.charge="both",jn.capacity=parseInt(t.capacity.state),jn.entityID=e}ws>=Ts||ws=xs&&ws=ms&&ws=fs&&ws=us&&ws=qs&&ws0?Wn="off"===ue.state||"no"===jn.show||parseInt(ve.state)<=jn.capacity?ee.battery.shutdown_soc:jn.capacity:In<0&&("off"===ue.state||"no"===jn.show||parseInt(ve.state)>=jn.capacity?Wn=100:parseInt(ve.state)0?Gn=(parseInt(ve.state)-Wn)/100*ee.battery.energy/In*60*60:In<0&&(Gn=(Wn-parseInt(ve.state))/100*ee.battery.energy/In*60*60*-1);const Ms=new Date,As=1e3*Gn,Hs=new Date(Ms.getTime()+As),bs=Hs.getHours(),Zs=Hs.getMinutes().toString().padStart(2,"0"),Ls=bs.toString().padStart(2,"0");Xn="".concat(Ls,":").concat(Zs);const Es=Math.floor(Gn/86400),Ps=Math.floor(Gn%86400/3600),Vs=Math.floor(Gn%3600/60);Es>0&&(Kn+="".concat(Es," days, ")),(Ps>0||Es>0)&&(Kn+="".concat(Ps," hrs, ")),Kn+="".concat(Vs," min")}let Jn=-2<=parseInt(Be.state)&&parseInt(Be.state)<=2&&parseInt(ve.state)>=99?"True":"False",ts="",es="";switch(qe.state){case"0":case"standby":ts="blue",es="Standby";break;case"1":case"selftest":ts="yellow",es="Selftest";break;case"2":case"normal":case"ok":ts="green",es="Normal";break;case"3":case"alarm":ts="orange",es="Alarm";break;case"4":case"fault":ts="red",es="Fault";break;default:"none"!==(null===(S=null==ee?void 0:ee.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ee?void 0:ee.entities)||void 0===R?void 0:R.inverter_status_59)?(ts="transparent",es="Status"):(ts="transparent",es="")}let ns=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ss=(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=0!=ss?Math.min(Math.round(100*ns/ss),100):0,os=0!=ns?Math.min(Math.round(100*ss/ns),100):0,ls=Sn+parseInt("".concat(In>0?In:0))+parseInt("".concat(We<0?-1*We:0)),as=Dn+Nn+parseInt("".concat(We>0?We:0))+parseInt("".concat(In<0?-1*In:0)),rs=0!=as?Math.min(Math.round(100*ls/as),100):0,hs=0!=ls?Math.min(Math.round(100*as/ls),100):0,ds=(null===($=null==ee?void 0:ee.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ee&&ee.solar&&ee.solar.animation_speed){let Is=ee.solar.animation_speed-(ee.solar.animation_speed-1)*(Sn/(ee.solar.max_power||Sn));ds="".concat(Is>=1?Is:1)}let ps=(null===(Y=null==ee?void 0:ee.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ee&&ee.battery&&ee.battery.animation_speed){let Cs=ee.battery.animation_speed-(ee.battery.animation_speed-1)*((In<0?-1*In:In)/(ee.battery.max_power||(In<0?-1*In:In)));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(O=null==ee?void 0:ee.load)||void 0===O?void 0:O.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Bs=ee.load.animation_speed-(ee.load.animation_speed-1)*(Dn/(ee.load.max_power||Dn));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(U=null==ee?void 0:ee.load)||void 0===U?void 0:U.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Fs=ee.load.animation_speed-(ee.load.animation_speed-1)*((parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))/(ee.load.max_power||(parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(z=null==ee?void 0:ee.grid)||void 0===z?void 0:z.animation_speed)||"8";if(ee&&ee.grid&&ee.grid.animation_speed){let Ss=ee.grid.animation_speed-(ee.grid.animation_speed-1)*((parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))/(ee.grid.max_power||(parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(Q=null==ee?void 0:ee.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ee&&ee.grid&&ee.grid.animation_speed){let Rs=ee.grid.animation_speed-(ee.grid.animation_speed-1)*(Nn/(ee.grid.max_power||Nn));ys="".concat(Rs>=1?Rs:1)}return"full"===ee.cardstyle?D(yt||(yt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n DAILY LOAD\n DAILY LOAD\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY GRID BUY\n DAILY GRID SELL\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ke,Ke,Je,tn,nn,nn,"no"===Zn?"".concat(Cn):"100%",gn,"no"===ee.show_solar?"st12":"",yn,nn,nn,Je,"no"===mn?"st12":"",Ke,Ln,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",nn,"no"===on?"st12":"","one"===cn?"":"none",nn,"no"===on?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","no"===mn?"30":"143",Ke,"one"===fn?"":"none","no"===mn?"376":"373","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===mn?"413":"410","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===bn?"st14":"st4",0===ee.battery.energy||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,0===ee.battery.energy||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||"False"===Jn?"transparent":"".concat(yn),"no"===ee.show_solar?"none":"",gn,(null===(j=null==ee?void 0:ee.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(W=null==ee?void 0:ee.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(G=null==ee?void 0:ee.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(X=null==ee?void 0:ee.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ee.solar.pv4_name):"PV4",nn,Ln,es,"one"!==fn&&"two"!==fn||"yes"!==mn?"":"none",Ke,"no"===fn||"no"===mn?"none":"",Ke,"no"===mn?"70":"181","one"===fn?"":"none",Ke,(null===(K=null==ee?void 0:ee.load)||void 0===K?void 0:K.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"47":"158","one"===fn?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"393":"390","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(J=null==ee?void 0:ee.load)||void 0===J?void 0:J.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"394":"391","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"429":"426","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(tt=null==ee?void 0:ee.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ee.load.load2_name):"","no"===mn?"430":"427","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(ze.state))?0:parseFloat(ze.state).toFixed(0),"no"===en||"no"===mn?"transparent":"".concat(Ke),"no"===fn?"83%":"67%","no"===fn?"18.5%":"24.25%","no"===en||"yes"===mn?"transparent":"".concat(Ke),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===on?"68%":"76%","no"===on?"96%":"66%","no"===vn?"transparent":"".concat(nn),"no"===on?"68%":"76%","no"===on?"88%":"58%","no"===_n?"transparent":"".concat(nn),"no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),(null===(et=null==ee?void 0:ee.load)||void 0===et?void 0:et.aux_name)?"".concat(ee.load.aux_name):"Auxiliary","no"===on?"none":"",nn,(null===(nt=null==ee?void 0:ee.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ee.grid.nonessential_name):"Non Essential","no"===on||"no"===cn||"two"===cn?"none":"",nn,(null===(st=null==ee?void 0:ee.grid)||void 0===st?void 0:st.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(it=null==ee?void 0:ee.grid)||void 0===it?void 0:it.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(ot=null==ee?void 0:ee.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ee.grid.load2_name):"","no"===on||"no"===cn||"two"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,ts,"yes"===mn?"":"none","one"===fn||"two"===fn?"":"st12",Ke,"no"===mn?"":"none","one"===fn?"":"st12",Ke,"no"===mn?"":"none","two"===fn?"":"st12",Ke,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s/2,Ge>0||0===Ge?"transparent":"".concat(nn),_s/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys,"no"===mn?"st12":"",Je,"no"===mn||0===We?"st12":"",We<0?"transparent":"".concat(Je),vs,"no"===mn||0===We?"st12":"",We>0?"transparent":"".concat(Je),vs,"no"===mn?"st12":"",Je,nn,Ln,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,Ln,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?"1":"0",yn,parseInt(ve.state)<=Fn?1:0,yn,"no"===ee.show_solar?"st12":"",gn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,"default"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"oven"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"boiler"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"pump"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"aircon"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"no"===on||"two"===cn||"one"===cn?"none":"",qn,"default"===Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"===Tn&&"default"!=kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"!=Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"no"===on||"no"===cn||"one"===cn?"none":"",Tn,"no"===on||"no"===cn||"one"===cn?"none":"",kn,"default"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"no"===on||"no"===cn||"two"===cn?"none":"",Tn,"one"!==fn&&"two"!==fn||"no"!==mn?"none":"",Ke,"one"!==fn&&"two"!==fn||"yes"!==mn?"none":"",Ke,"one"===fn||"two"===fn?"none":"",Ke,(t=>this.handlePopup(t,ee.entities.aux_connected_status)),"default"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"gen"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"inverter"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"oven"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"boiler"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"aircon"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"pump"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"no"===mn?"none":"",un,"on"===an||"1"===an?"aux-icon":"aux-off-icon","boiler"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"no"===fn||"one"===fn?"none":"","yes"===mn?"350":"383","yes"===mn?"140":"5",Mn,"no"===fn||"one"===fn?"none":"","yes"===mn?"446":"420","yes"===mn?"140":"5",An,"no"===fn||"two"===fn?"none":"","336","yes"===mn?"140":"27",Mn,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"no"!=En?"60.5%":"65%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"60.5%":"65%","off"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","off"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"no"!=En?"65.5%":"70%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"65.5%":"70%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===en||"no"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===fn?"83%":"67%","no"===fn?"15%":"21%","no"===en||"yes"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===on?"68%":"76%","no"===on?"92.5%":"62.5%","no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===on?"68%":"76%","no"===on?"84.25%":"54.5%","no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(null===(lt=null==ee?void 0:ee.entities)||void 0===lt?void 0:lt.pv_total)?N(wt||(wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(gt||(gt=e([' '," W "])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.essential_power?N(xt||(xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||"0"):N(mt||(mt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0),"none"!==ee.entities.nonessential_power?N(ft||(ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.nonessential_power)),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0):N(ut||(ut=e([''," W "])),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0),(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,"none"!==ee.entities.aux_power_166?N(qt||(qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.aux_power_166)),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We):N(Tt||(Tt=e([''," W "])),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We),"none"!==ee.entities.pv1_power_186?N(kt||(kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Mt||(Mt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(At||(At=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(Ht||(Ht=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Zt||(Zt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Et||(Et=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none","no"===bn?"st14":"st4",nn,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none","no"===bn?"st14":"st4",nn,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none","no"===bn?"st14":"st4",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.inverter_power_175)),"none"===ee.entities.inverter_power_175?"none":"","no"===bn?"st14":"st4",Ln,Te.state||0,(t=>this.handlePopup(t,ee.entities.grid_power_169)),"none"===ee.entities.grid_power_169?"none":"","no"===bn?"st14":"st4",nn,ke.state||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(at=null==ee?void 0:ee.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"four"===(null===(rt=null==ee?void 0:ee.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%","four"===(null===(ht=null==ee?void 0:ee.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(dt=null==ee?void 0:ee.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(pt=null==ee?void 0:ee.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(ct=null==ee?void 0:ee.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",Oe.state||""):"lite"===ee.cardstyle?D(Pt||(Pt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY LOAD\n DAILY GRID BUY\n DAILY GRID SELL\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ke,"no"===ee.show_solar?145.33:-.5,"no"===ee.show_solar?270.67:406,"".concat("no"===Zn?"no"===ee.show_solar?"246px":"".concat(Cn):"no"===ee.show_solar?"75%":"100%"),Ke,gn,"no"===ee.show_solar?"st12":"",yn,nn,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",Ke,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",0===ee.battery.energy||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,0===ee.battery.energy||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||"False"===Jn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"two"===fn?"365":"400.4","two"===fn?"182.2":"282.1","no"===en?"transparent":"".concat(Ke),"no"===vn?"transparent":"".concat(nn),"no"===_n?"transparent":"".concat(nn),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===ee.show_solar?"none":"",gn,(null===(vt=null==ee?void 0:ee.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(_t=null==ee?void 0:ee.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(Ut=null==ee?void 0:ee.solar)||void 0===Ut?void 0:Ut.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(zt=null==ee?void 0:ee.solar)||void 0===zt?void 0:zt.pv4_name)?"".concat(ee.solar.pv4_name):"PV4","no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Qt=null==ee?void 0:ee.load)||void 0===Qt?void 0:Qt.load1_name)?"".concat(ee.load.load1_name):"","one"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(jt=null==ee?void 0:ee.load)||void 0===jt?void 0:jt.load1_name)?"".concat(ee.load.load1_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Wt=null==ee?void 0:ee.load)||void 0===Wt?void 0:Wt.load2_name)?"".concat(ee.load.load2_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(ze.state))?0:parseFloat(ze.state).toFixed(0),ts,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,0===Dn?"transparent":"".concat(Ke),cs,"one"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"oven"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"no"===fn||"no"===ee.show_solar?"none":"",Mn,"no"===fn||"one"===fn||"no"===ee.show_solar?"none":"",An,"no"===ee.show_solar?"st12":"",gn,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?1:0,yn,parseInt(ve.state)<=Fn?1:0,yn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,Ke,Ln,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"on"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"on"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"two"===fn?"365":"400.4","two"===fn?"168":"267.9","no"===en?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none",Ln,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none",Ln,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(Gt=null==ee?void 0:ee.entities)||void 0===Gt?void 0:Gt.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(Xt=null==ee?void 0:ee.entities)||void 0===Xt?void 0:Xt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(Kt=null==ee?void 0:ee.entities)||void 0===Kt?void 0:Kt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(Jt=null==ee?void 0:ee.entities)||void 0===Jt?void 0:Jt.energy_cost)?"":"none",Oe.state||"",(null===(te=null==ee?void 0:ee.entities)||void 0===te?void 0:te.pv_total)?N(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(It||(It=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.pv1_power_186?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(St||(St=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Dt||(Dt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N($t||($t=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ee.entities.essential_power?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||0):N(Ot||(Ot=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error("Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple");if(!t.show_solar)throw Error("Please include the show_solar attribute e.g. show_solar: yes");if(!t.battery)throw Error("No battery attributes defined");if(!t.battery.energy)throw new Error("Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320");if(!t.battery.shutdown_soc)throw new Error("Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20");if(t.battery.full_capacity<80)throw new Error("Full capacity needs to be between 80 and 100");if(t.battery.empty_capacity>30)throw new Error("Empty capacity needs to be <= 30");if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error("Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs");if("yes"===t.show_solar&&!t.solar)throw Error("No solar attributes defined");if("yes"===t.show_solar&&!t.solar.mppts)throw Error("Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two");if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error("Please include the day_pv_energy_108 attribute and entity ID");if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error("Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs");if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error("The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.");if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error("The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.");const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),s)}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen"})})); diff --git a/src/defaults.ts b/src/defaults.ts new file mode 100644 index 00000000..83a8e468 --- /dev/null +++ b/src/defaults.ts @@ -0,0 +1,7 @@ + + +export default { + battery: { + energy: 0 + } +} diff --git a/src/index.ts b/src/index.ts index 50ee7011..386c2e11 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js'; import { HomeAssistant } from 'custom-card-helpers'; import { styles } from './style'; import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; +import defaultConfig from './defaults'; import { CARD_VERSION } from './const'; @@ -12,7 +13,7 @@ console.groupCollapsed( 'color: white; font-weight: bold; background: dimgray', ); console.log("Readme:", "https://github.com/slipx06/sunsynk-power-flow-card"), -console.groupEnd(); + console.groupEnd(); @customElement('sunsynk-power-flow-card') export class SunsynkPowerFlowCard extends LitElement { @@ -28,7 +29,7 @@ export class SunsynkPowerFlowCard extends LitElement { cardstyle: 'lite', show_solar: 'yes', battery: { - energy: 15960, + energy: 0, shutdown_soc: 20, show_daily: 'yes', }, @@ -319,11 +320,11 @@ export class SunsynkPowerFlowCard extends LitElement { let formattedResultTime = ""; let duration = ""; - if (config.battery.show === true) { + if (config.battery.energy !== 0) { if (battery_power === 0) { - totalSeconds = (((parseInt(stateObj12.state) - config.battery.shutdown_soc) / 100) * (config.battery.energy || 15960)) / 1 * 60 * 60; + totalSeconds = (((parseInt(stateObj12.state) - config.battery.shutdown_soc) / 100) * config.battery.energy) / 1 * 60 * 60; } else if (battery_power > 0) { - totalSeconds = (((parseInt(stateObj12.state) - battery_capacity) / 100) * (config.battery.energy || 15960)) / battery_power * 60 * 60; + totalSeconds = (((parseInt(stateObj12.state) - battery_capacity) / 100) * config.battery.energy) / battery_power * 60 * 60; } else if (battery_power < 0) { totalSeconds = ((((battery_capacity - parseInt(stateObj12.state)) / 100) * config.battery.energy) / battery_power) * 60 * 60 * -1; } @@ -500,10 +501,10 @@ export class SunsynkPowerFlowCard extends LitElement { - ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING + ${duration} + RUNTIME TO ${battery_capacity}% @${formattedResultTime} + TO ${battery_capacity}% CHARGE @${formattedResultTime} + BATTERY FLOATING ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} @@ -993,10 +994,10 @@ export class SunsynkPowerFlowCard extends LitElement { - ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING + ${duration} + RUNTIME TO ${battery_capacity}% @${formattedResultTime} + TO ${battery_capacity}% CHARGE @${formattedResultTime} + BATTERY FLOATING DAILY CHARGE DAILY DISCHARGE DAILY LOAD @@ -1353,7 +1354,12 @@ export class SunsynkPowerFlowCard extends LitElement { } } - this._config = config; + const customConfig: sunsynkPowerFlowCardConfig = JSON.parse(JSON.stringify(config)); + + this._config = { + ...defaultConfig, + ...customConfig, + }; } handlePopup(e, entity) { diff --git a/src/types.ts b/src/types.ts index 3a7b748c..4ff8233d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,7 +8,6 @@ declare global { export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { battery: { - show: boolean; energy: number; shutdown_soc: number; invert_power: string; From 8fb9d9984f6073e46b92fac1951624ee5773eec0 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 16:09:06 +0100 Subject: [PATCH 03/40] feat: start localize & change text numbers to numbers --- dist/sunsynk-power-flow-card.js | 8 +- src/index.ts | 376 ++++++++++++++++---------------- src/localize/languages/en.json | 39 ++++ src/localize/localize.ts | 26 +++ 4 files changed, 257 insertions(+), 192 deletions(-) create mode 100644 src/localize/languages/en.json create mode 100644 src/localize/localize.ts diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 9bcb2eea..87d44205 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -9,19 +9,19 @@ const s=window,i=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&" * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),w={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},g="finalized";let x=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const s=this._$Ep(n,e);void 0!==s&&(this._$Ev.set(s,n),t.push(s))})),t}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,n,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty(g))return!1;this[g]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=s.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=w){var s;const i=this.constructor._$Ep(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null===(s=n.converter)||void 0===s?void 0:s.toAttribute)?n.converter:_).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(t,e){var n;const s=this.constructor,i=s._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:_;this._$El=i,this[i]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let s=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const s=this._$Ep(n,e);void 0!==s&&(this._$Ev.set(s,n),t.push(s))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,n,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=s.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=g){var s;const i=this.constructor._$Ep(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null===(s=n.converter)||void 0===s?void 0:s.toAttribute)?n.converter:_).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(t,e){var n;const s=this.constructor,i=s._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:_;this._$El=i,this[i]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let s=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var m;x[g]=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:x}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=R(1),N=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),O=new WeakMap,U=H.createTreeWalker(H,129,null,!1);function z(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[z(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),U.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=U.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(z(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;lt}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),N=R(1),D=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[O(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(O(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;l{var s,i;const o=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:e;let l=o._$litPart$;if(void 0===l){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=l=new X(e.insertBefore(b(),t),t,void 0,null!=n?n:{})}return l._$AI(t),l})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}at.finalized=!0,at._$litElement$=!0,null===(ot=globalThis.litElementHydrateSupport)||void 0===ot||ot.call(globalThis,{LitElement:at});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:at}),(null!==(lt=globalThis.litElementVersions)&&void 0!==lt?lt:globalThis.litElementVersions=[]).push("3.3.3"); +var ot,lt;class at extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const n=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=n.firstChild),n}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,n)=>{var s,i;const o=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:e;let l=o._$litPart$;if(void 0===l){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=l=new X(e.insertBefore(b(),t),t,void 0,null!=n?n:{})}return l._$AI(t),l})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}at.finalized=!0,at._$litElement$=!0,null===(ot=globalThis.litElementHydrateSupport)||void 0===ot||ot.call(globalThis,{LitElement:at});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:at}),(null!==(lt=globalThis.litElementVersions)&&void 0!==lt?lt:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt,wt,gt,xt,mt,ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Dt,Nt,$t,Yt,Ot;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v".concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:0,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:"two"},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,w,g,x,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,O,U,z,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,_t,Ut,zt,Qt,jt,Wt,Gt,Xt,Kt,Jt,te;const ee=this._config,ne=this.hass.states[ee.entities.day_battery_discharge_71]||{state:"0"},se=this.hass.states[ee.entities.day_battery_charge_70]||{state:"0"},ie=this.hass.states[ee.entities.day_load_energy_84]||{state:"0"},oe=this.hass.states[ee.entities.day_grid_import_76]||{state:"0"},le=this.hass.states[ee.entities.day_pv_energy_108]||{state:"0"},ae=this.hass.states[ee.entities.inverter_voltage_154]||{state:"0"},re=this.hass.states[ee.entities.load_frequency_192]||{state:"0"},he=this.hass.states[ee.entities.inverter_current_164]||{state:"0"},de=this.hass.states[ee.entities.pv2_power_187]||{state:"0"},pe=this.hass.states[ee.entities.pv1_power_186]||{state:"0"},ce=this.hass.states[ee.entities.battery_voltage_183]||{state:"0"},ve=this.hass.states[ee.entities.battery_soc_184]||{state:"0"},_e=this.hass.states[ee.entities.battery_power_190]||{state:"0"},ye=this.hass.states[ee.entities.essential_power]||{state:"0"},we=this.hass.states[ee.entities.grid_ct_power_172]||{state:"0"},ge=this.hass.states[ee.entities.pv1_voltage_109]||{state:"0"},xe=this.hass.states[ee.entities.pv1_current_110]||{state:"0"},me=this.hass.states[ee.entities.pv2_voltage_111]||{state:"0"},fe=this.hass.states[ee.entities.pv2_current_112]||{state:"0"},ue=this.hass.states[ee.entities.grid_connected_status_194]||{state:"on"},qe=this.hass.states[ee.entities.inverter_status_59]||{state:""},Te=this.hass.states[ee.entities.inverter_power_175]||{state:"0"},ke=this.hass.states[ee.entities.grid_power_169]||{state:"0"},Me=this.hass.states[ee.entities.aux_power_166]||{state:"0"},Ae=this.hass.states[ee.entities.priority_load_243]||{state:"undefined"},He=this.hass.states[ee.entities.use_timer_248]||{state:"undefined"},be=this.hass.states[ee.entities.pv3_voltage_113]||{state:"0"},Ze=this.hass.states[ee.entities.pv3_current_114]||{state:"0"},Le=this.hass.states[ee.entities.pv4_voltage_115]||{state:"0"},Ee=this.hass.states[ee.entities.pv4_current_116]||{state:"0"},Pe=this.hass.states[ee.entities.pv3_power_188]||{state:"0"},Ve=this.hass.states[ee.entities.pv4_power_189]||{state:"0"},Ie=this.hass.states[ee.entities.day_grid_export_77]||{state:"0"},Ce=this.hass.states[ee.entities.nonessential_power]||{state:"0"},Be=this.hass.states[ee.entities.battery_current_191]||{state:"0"},Fe=this.hass.states[ee.entities.remaining_solar]||{state:"0"},Se=this.hass.states[ee.entities.battery_temp_182]||{state:""},Re=this.hass.states[ee.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ee.entities.radiator_temp_91]||{state:""},Ne=this.hass.states[ee.entities.non_essential_load1]||{state:"0"},$e=this.hass.states[ee.entities.non_essential_load2]||{state:"0"},Ye=this.hass.states[ee.entities.essential_load1]||{state:"0"},Oe=this.hass.states[ee.entities.energy_cost]||{state:""},Ue=this.hass.states[ee.entities.solar_sell_247]||{state:"undefined"},ze=this.hass.states[ee.entities.essential_load2]||{state:"0"},Qe=this.hass.states[ee.entities.pv_total]||{state:"0"},je=this.hass.states[ee.entities.aux_connected_status]||{state:"on"};let We="yes"===((null===(t=null==ee?void 0:ee.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Me.state):parseInt(Me.state),Ge="yes"===((null===(n=null==ee?void 0:ee.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(we.state):parseInt(we.state),Xe=(null===(s=null==ee?void 0:ee.inverter)||void 0===s?void 0:s.modern)||"yes",Ke=(null===(i=null==ee?void 0:ee.load)||void 0===i?void 0:i.colour)||"#5fb6ad",Je=(null===(o=null==ee?void 0:ee.load)||void 0===o?void 0:o.aux_colour)||Ke,tn=(null===(l=null==ee?void 0:ee.load)||void 0===l?void 0:l.aux_off_colour)||Ke,en=(null===(a=null==ee?void 0:ee.load)||void 0===a?void 0:a.show_daily)||"no",nn=(null===(r=null==ee?void 0:ee.grid)||void 0===r?void 0:r.colour)||"#5490c2",sn=(null===(h=null==ee?void 0:ee.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",on=(null===(d=null==ee?void 0:ee.grid)||void 0===d?void 0:d.show_nonessential)||"yes",ln=(null===(p=null==ee?void 0:ee.entities)||void 0===p?void 0:p.grid_connected_status_194)?ue.state:"on",an=(null===(c=null==ee?void 0:ee.entities)||void 0===c?void 0:c.aux_connected_status)?je.state:"on",rn=(null===(v=null==ee?void 0:ee.entities)||void 0===v?void 0:v.load_frequency_192)?re.state:0,hn=(null===(_=null==ee?void 0:ee.entities)||void 0===_?void 0:_.inverter_voltage_154)?ae.state:0,dn=(null===(y=null==ee?void 0:ee.entities)||void 0===y?void 0:y.inverter_current_164)?he.state:0,pn=(null===(w=null==ee?void 0:ee.entities)||void 0===w?void 0:w.battery_voltage_183)?ce.state:0,cn=null===(g=null==ee?void 0:ee.grid)||void 0===g?void 0:g.additional_loads;"no"!==cn&&"one"!==cn&&"two"!==cn&&(cn="no");let vn=(null===(x=null==ee?void 0:ee.grid)||void 0===x?void 0:x.show_daily_buy)||"no",_n=(null===(m=null==ee?void 0:ee.grid)||void 0===m?void 0:m.show_daily_sell)||"no",yn=(null===(f=null==ee?void 0:ee.battery)||void 0===f?void 0:f.colour)||"pink",wn=(null===(u=null==ee?void 0:ee.battery)||void 0===u?void 0:u.show_daily)||"no",gn=(null===(q=null==ee?void 0:ee.solar)||void 0===q?void 0:q.colour)||"orange",xn=(null===(T=null==ee?void 0:ee.solar)||void 0===T?void 0:T.show_daily)||"no",mn=null===(k=null==ee?void 0:ee.load)||void 0===k?void 0:k.show_aux;"no"!==mn&&"yes"!==mn&&(mn="no");let fn=null===(M=null==ee?void 0:ee.load)||void 0===M?void 0:M.additional_loads;"no"!==fn&&"one"!==fn&&"two"!==fn&&(fn="no");let un=(null===(A=null==ee?void 0:ee.load)||void 0===A?void 0:A.aux_type)||"default",qn=(null===(H=null==ee?void 0:ee.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Tn=(null===(b=null==ee?void 0:ee.grid)||void 0===b?void 0:b.load1_icon)||"default",kn=(null===(Z=null==ee?void 0:ee.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Mn=(null===(L=null==ee?void 0:ee.load)||void 0===L?void 0:L.load1_icon)||"default",An=(null===(E=null==ee?void 0:ee.load)||void 0===E?void 0:E.load2_icon)||"default",Hn=ee.entities.remaining_solar?parseFloat(Fe.state).toFixed(1):"false",bn=(null==ee?void 0:ee.large_font)||"no",Zn=(null==ee?void 0:ee.panel_mode)||"no",Ln=(null===(P=null==ee?void 0:ee.inverter)||void 0===P?void 0:P.colour)||"grey",En=(null===(V=null==ee?void 0:ee.inverter)||void 0===V?void 0:V.autarky)||"power",Pn="no"!==(null==ee?void 0:ee.entities.use_timer_248)&&(null==ee?void 0:ee.entities.use_timer_248)?He.state:"no",Vn="no"!==(null==ee?void 0:ee.entities.priority_load_243)&&(null==ee?void 0:ee.entities.priority_load_243)?Ae.state:"no",In="yes"===(null===(I=null==ee?void 0:ee.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(_e.state):parseInt(_e.state),Cn=(null==ee?void 0:ee.card_height)||"396px",Bn=(null===(C=null==ee?void 0:ee.battery)||void 0===C?void 0:C.full_capacity)||80,Fn=(null===(B=null==ee?void 0:ee.battery)||void 0===B?void 0:B.empty_capacity)||30,Sn=parseInt(parseFloat(de.state||"0").toFixed(0))+parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(Pe.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0)),Rn=(null===(F=null==ee?void 0:ee.entities)||void 0===F?void 0:F.pv_total)?parseInt(Qe.state):Sn,Dn="none"!==(null==ee?void 0:ee.entities.essential_power)&&(null==ee?void 0:ee.entities.essential_power)?parseInt(ye.state):parseInt(Te.state)+parseInt(ke.state)-parseInt(Me.state),Nn="none"!==(null==ee?void 0:ee.entities.nonessential_power)&&(null==ee?void 0:ee.entities.nonessential_power)?parseInt(Ce.state):parseInt(we.state)-parseInt(ke.state);const $n={time:this.hass.states[ee.entities.prog1_time]||{state:""},capacity:this.hass.states[ee.entities.prog1_capacity]||{state:""},charge:this.hass.states[ee.entities.prog1_charge]||{state:""}},Yn={time:this.hass.states[ee.entities.prog2_time]||{state:""},capacity:this.hass.states[ee.entities.prog2_capacity]||{state:""},charge:this.hass.states[ee.entities.prog2_charge]||{state:""}},On={time:this.hass.states[ee.entities.prog3_time]||{state:""},capacity:this.hass.states[ee.entities.prog3_capacity]||{state:""},charge:this.hass.states[ee.entities.prog3_charge]||{state:""}},Un={time:this.hass.states[ee.entities.prog4_time]||{state:""},capacity:this.hass.states[ee.entities.prog4_capacity]||{state:""},charge:this.hass.states[ee.entities.prog4_charge]||{state:""}},zn={time:this.hass.states[ee.entities.prog5_time]||{state:""},capacity:this.hass.states[ee.entities.prog5_capacity]||{state:""},charge:this.hass.states[ee.entities.prog5_charge]||{state:""}},Qn={time:this.hass.states[ee.entities.prog6_time]||{state:""},capacity:this.hass.states[ee.entities.prog6_capacity]||{state:""},charge:this.hass.states[ee.entities.prog6_charge]||{state:""}};let jn={capacity:ee.battery.shutdown_soc,entityID:""};if(ee.entities.use_timer_248&&"no"!==ee.entities.use_timer_248&&"off"!==He.state)if(ee.entities.prog1_time&&ee.entities.prog2_time&&ee.entities.prog3_time&&ee.entities.prog4_time&&ee.entities.prog5_time&&ee.entities.prog6_time){jn.show="yes";const ws=new Date,gs=[];[$n,Yn,On,Un,zn,Qn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));gs[e]=new Date(ws.getTime()),gs[e].setHours(n),gs[e].setMinutes(s)}));const[xs,ms,fs,us,qs,Ts]=gs;function ks(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?jn.charge="none":jn.charge="both",jn.capacity=parseInt(t.capacity.state),jn.entityID=e}ws>=Ts||ws=xs&&ws=ms&&ws=fs&&ws=us&&ws=qs&&ws0?Wn="off"===ue.state||"no"===jn.show||parseInt(ve.state)<=jn.capacity?ee.battery.shutdown_soc:jn.capacity:In<0&&("off"===ue.state||"no"===jn.show||parseInt(ve.state)>=jn.capacity?Wn=100:parseInt(ve.state)0?Gn=(parseInt(ve.state)-Wn)/100*ee.battery.energy/In*60*60:In<0&&(Gn=(Wn-parseInt(ve.state))/100*ee.battery.energy/In*60*60*-1);const Ms=new Date,As=1e3*Gn,Hs=new Date(Ms.getTime()+As),bs=Hs.getHours(),Zs=Hs.getMinutes().toString().padStart(2,"0"),Ls=bs.toString().padStart(2,"0");Xn="".concat(Ls,":").concat(Zs);const Es=Math.floor(Gn/86400),Ps=Math.floor(Gn%86400/3600),Vs=Math.floor(Gn%3600/60);Es>0&&(Kn+="".concat(Es," days, ")),(Ps>0||Es>0)&&(Kn+="".concat(Ps," hrs, ")),Kn+="".concat(Vs," min")}let Jn=-2<=parseInt(Be.state)&&parseInt(Be.state)<=2&&parseInt(ve.state)>=99?"True":"False",ts="",es="";switch(qe.state){case"0":case"standby":ts="blue",es="Standby";break;case"1":case"selftest":ts="yellow",es="Selftest";break;case"2":case"normal":case"ok":ts="green",es="Normal";break;case"3":case"alarm":ts="orange",es="Alarm";break;case"4":case"fault":ts="red",es="Fault";break;default:"none"!==(null===(S=null==ee?void 0:ee.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ee?void 0:ee.entities)||void 0===R?void 0:R.inverter_status_59)?(ts="transparent",es="Status"):(ts="transparent",es="")}let ns=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ss=(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=0!=ss?Math.min(Math.round(100*ns/ss),100):0,os=0!=ns?Math.min(Math.round(100*ss/ns),100):0,ls=Sn+parseInt("".concat(In>0?In:0))+parseInt("".concat(We<0?-1*We:0)),as=Dn+Nn+parseInt("".concat(We>0?We:0))+parseInt("".concat(In<0?-1*In:0)),rs=0!=as?Math.min(Math.round(100*ls/as),100):0,hs=0!=ls?Math.min(Math.round(100*as/ls),100):0,ds=(null===($=null==ee?void 0:ee.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ee&&ee.solar&&ee.solar.animation_speed){let Is=ee.solar.animation_speed-(ee.solar.animation_speed-1)*(Sn/(ee.solar.max_power||Sn));ds="".concat(Is>=1?Is:1)}let ps=(null===(Y=null==ee?void 0:ee.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ee&&ee.battery&&ee.battery.animation_speed){let Cs=ee.battery.animation_speed-(ee.battery.animation_speed-1)*((In<0?-1*In:In)/(ee.battery.max_power||(In<0?-1*In:In)));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(O=null==ee?void 0:ee.load)||void 0===O?void 0:O.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Bs=ee.load.animation_speed-(ee.load.animation_speed-1)*(Dn/(ee.load.max_power||Dn));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(U=null==ee?void 0:ee.load)||void 0===U?void 0:U.animation_speed)||"4";if(ee&&ee.load&&ee.load.animation_speed){let Fs=ee.load.animation_speed-(ee.load.animation_speed-1)*((parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))/(ee.load.max_power||(parseInt(Me.state)<0?-1*parseInt(Me.state):parseInt(Me.state))));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(z=null==ee?void 0:ee.grid)||void 0===z?void 0:z.animation_speed)||"8";if(ee&&ee.grid&&ee.grid.animation_speed){let Ss=ee.grid.animation_speed-(ee.grid.animation_speed-1)*((parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))/(ee.grid.max_power||(parseInt(we.state)<0?-1*parseInt(we.state):parseInt(we.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(Q=null==ee?void 0:ee.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ee&&ee.grid&&ee.grid.animation_speed){let Rs=ee.grid.animation_speed-(ee.grid.animation_speed-1)*(Nn/(ee.grid.max_power||Nn));ys="".concat(Rs>=1?Rs:1)}return"full"===ee.cardstyle?D(yt||(yt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n DAILY LOAD\n DAILY LOAD\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY GRID BUY\n DAILY GRID SELL\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ke,Ke,Je,tn,nn,nn,"no"===Zn?"".concat(Cn):"100%",gn,"no"===ee.show_solar?"st12":"",yn,nn,nn,Je,"no"===mn?"st12":"",Ke,Ln,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",nn,"no"===on?"st12":"","one"===cn?"":"none",nn,"no"===on?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","two"===cn?"":"none",nn,"no"===on||"one"===cn?"st12":"","no"===mn?"30":"143",Ke,"one"===fn?"":"none","no"===mn?"376":"373","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===mn?"413":"410","no"===mn?"30":"143",Ke,"two"===fn?"":"none","no"===bn?"st14":"st4",0===ee.battery.energy||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,0===ee.battery.energy||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||"False"===Jn?"transparent":"".concat(yn),"no"===ee.show_solar?"none":"",gn,(null===(j=null==ee?void 0:ee.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(W=null==ee?void 0:ee.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(G=null==ee?void 0:ee.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(X=null==ee?void 0:ee.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ee.solar.pv4_name):"PV4",nn,Ln,es,"one"!==fn&&"two"!==fn||"yes"!==mn?"":"none",Ke,"no"===fn||"no"===mn?"none":"",Ke,"no"===mn?"70":"181","one"===fn?"":"none",Ke,(null===(K=null==ee?void 0:ee.load)||void 0===K?void 0:K.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"47":"158","one"===fn?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"393":"390","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(J=null==ee?void 0:ee.load)||void 0===J?void 0:J.load1_name)?"".concat(ee.load.load1_name):"","no"===mn?"394":"391","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===mn?"429":"426","no"===mn?"59":"172","two"===fn?"":"none",Ke,(null===(tt=null==ee?void 0:ee.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ee.load.load2_name):"","no"===mn?"430":"427","no"===mn?"42":"154","two"===fn?"":"none",Ke,isNaN(parseFloat(ze.state))?0:parseFloat(ze.state).toFixed(0),"no"===en||"no"===mn?"transparent":"".concat(Ke),"no"===fn?"83%":"67%","no"===fn?"18.5%":"24.25%","no"===en||"yes"===mn?"transparent":"".concat(Ke),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===on?"68%":"76%","no"===on?"96%":"66%","no"===vn?"transparent":"".concat(nn),"no"===on?"68%":"76%","no"===on?"88%":"58%","no"===_n?"transparent":"".concat(nn),"no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),(null===(et=null==ee?void 0:ee.load)||void 0===et?void 0:et.aux_name)?"".concat(ee.load.aux_name):"Auxiliary","no"===on?"none":"",nn,(null===(nt=null==ee?void 0:ee.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ee.grid.nonessential_name):"Non Essential","no"===on||"no"===cn||"two"===cn?"none":"",nn,(null===(st=null==ee?void 0:ee.grid)||void 0===st?void 0:st.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(it=null==ee?void 0:ee.grid)||void 0===it?void 0:it.load1_name)?"".concat(ee.grid.load1_name):"","no"===on||"no"===cn||"one"===cn?"none":"",nn,(null===(ot=null==ee?void 0:ee.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ee.grid.load2_name):"","no"===on||"no"===cn||"two"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),"no"===on||"no"===cn||"one"===cn?"none":"",nn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,ts,"yes"===mn?"":"none","one"===fn||"two"===fn?"":"st12",Ke,"no"===mn?"":"none","one"===fn?"":"st12",Ke,"no"===mn?"":"none","two"===fn?"":"st12",Ke,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s/2,Ge>0||0===Ge?"transparent":"".concat(nn),_s/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys/2,nn,"no"===on?"st12":"","no"===on?"st12":"",Nn<=0?"transparent":"".concat(nn),ys,"no"===mn?"st12":"",Je,"no"===mn||0===We?"st12":"",We<0?"transparent":"".concat(Je),vs,"no"===mn||0===We?"st12":"",We>0?"transparent":"".concat(Je),vs,"no"===mn?"st12":"",Je,nn,Ln,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,Ln,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?"1":"0",yn,parseInt(ve.state)<=Fn?1:0,yn,"no"===ee.show_solar?"st12":"",gn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,"default"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"oven"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"boiler"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"pump"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"aircon"===qn?"1":"0","no"===on||"two"===cn||"one"===cn?"none":"",nn,"no"===on||"two"===cn||"one"===cn?"none":"",qn,"default"===Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"===Tn&&"default"!=kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"default"!=Tn&&"default"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"boiler"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"pump"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"oven"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"aircon"===kn?"1":"0","no"===on||"no"===cn||"one"===cn?"none":"",nn,"no"===on||"no"===cn||"one"===cn?"none":"",Tn,"no"===on||"no"===cn||"one"===cn?"none":"",kn,"default"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"boiler"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"pump"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"oven"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"aircon"===Tn?"1":"0","no"===on||"no"===cn||"two"===cn?"none":"",nn,"no"===on||"no"===cn||"two"===cn?"none":"",Tn,"one"!==fn&&"two"!==fn||"no"!==mn?"none":"",Ke,"one"!==fn&&"two"!==fn||"yes"!==mn?"none":"",Ke,"one"===fn||"two"===fn?"none":"",Ke,(t=>this.handlePopup(t,ee.entities.aux_connected_status)),"default"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"gen"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"inverter"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"oven"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"boiler"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"aircon"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"pump"===un?"":"st12","no"===mn?"none":"","".concat("on"===an||"1"===an?Je:tn),"no"===mn?"none":"",un,"on"===an||"1"===an?"aux-icon":"aux-off-icon","boiler"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"boiler"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"aircon"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"pump"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===mn||"no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===An&&"two"===fn&&"no"===mn?"1":"0","no"===fn||"one"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn&&"no"===mn?"1":"0","no"===fn||"two"===fn?"none":"",Ke,"oven"===Mn&&"one"===fn?"1":"0","no"===mn||"no"===fn||"two"===fn?"none":"",Ke,"no"===fn||"one"===fn?"none":"","yes"===mn?"350":"383","yes"===mn?"140":"5",Mn,"no"===fn||"one"===fn?"none":"","yes"===mn?"446":"420","yes"===mn?"140":"5",An,"no"===fn||"two"===fn?"none":"","336","yes"===mn?"140":"27",Mn,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"no"!=En?"60.5%":"65%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"60.5%":"65%","off"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","on"==He.state&&"no"!==Pn?"":"none",Ln,"no"!=En?"63.5%":"68%","off"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"none"!==ee.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"no"!=En?"65.5%":"70%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"65.5%":"70%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","on"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"!=En?"68.5%":"73%","off"===Ae.state&&"no"!==Vn?"":"none",Ln,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"!=En?"60.5%":"65%","no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===en||"no"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"no"===fn?"83%":"67%","no"===fn?"15%":"21%","no"===en||"yes"===mn?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===on?"68%":"76%","no"===on?"92.5%":"62.5%","no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===on?"68%":"76%","no"===on?"84.25%":"54.5%","no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(null===(lt=null==ee?void 0:ee.entities)||void 0===lt?void 0:lt.pv_total)?N(wt||(wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(gt||(gt=e([' '," W "])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.essential_power?N(xt||(xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||"0"):N(mt||(mt=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0),"none"!==ee.entities.nonessential_power?N(ft||(ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.nonessential_power)),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0):N(ut||(ut=e([''," W "])),"no"===on?"none":"","no"===bn?"st14":"st4",nn,Nn||0),(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,"none"!==ee.entities.aux_power_166?N(qt||(qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.aux_power_166)),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We):N(Tt||(Tt=e([''," W "])),"no"===bn?"st14":"st4","no"===mn?"none":"",Je,We<0?-1*We:We),"none"!==ee.entities.pv1_power_186?N(kt||(kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Mt||(Mt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(At||(At=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(Ht||(Ht=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Zt||(Zt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N(Et||(Et=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none","no"===bn?"st14":"st4",nn,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none","no"===bn?"st14":"st4",nn,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none","no"===bn?"st14":"st4",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.inverter_power_175)),"none"===ee.entities.inverter_power_175?"none":"","no"===bn?"st14":"st4",Ln,Te.state||0,(t=>this.handlePopup(t,ee.entities.grid_power_169)),"none"===ee.entities.grid_power_169?"none":"","no"===bn?"st14":"st4",nn,ke.state||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(at=null==ee?void 0:ee.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"four"===(null===(rt=null==ee?void 0:ee.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%","four"===(null===(ht=null==ee?void 0:ee.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(dt=null==ee?void 0:ee.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(pt=null==ee?void 0:ee.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(ct=null==ee?void 0:ee.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",Oe.state||""):"lite"===ee.cardstyle?D(Pt||(Pt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n BATTERY FLOATING\n DAILY CHARGE\n DAILY DISCHARGE\n DAILY LOAD\n DAILY GRID BUY\n DAILY GRID SELL\n DAILY SOLAR\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ke,"no"===ee.show_solar?145.33:-.5,"no"===ee.show_solar?270.67:406,"".concat("no"===Zn?"no"===ee.show_solar?"246px":"".concat(Cn):"no"===ee.show_solar?"75%":"100%"),Ke,gn,"no"===ee.show_solar?"st12":"",yn,nn,gn,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",Ke,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,"two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",0===ee.battery.energy||"True"===Jn||0===In?"transparent":"".concat(yn),Kn,0===ee.battery.energy||In<=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||In>=0||"True"===Jn?"transparent":"".concat(yn),Wn,Xn,0===ee.battery.energy||"False"===Jn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"no"===wn?"transparent":"".concat(yn),"two"===fn?"365":"400.4","two"===fn?"182.2":"282.1","no"===en?"transparent":"".concat(Ke),"no"===vn?"transparent":"".concat(nn),"no"===_n?"transparent":"".concat(nn),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"transparent":"".concat(gn),"no"===xn||"no"===ee.show_solar||"false"===Hn?"transparent":"".concat(gn),"no"===ee.show_solar?"none":"",gn,(null===(vt=null==ee?void 0:ee.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ee.solar.pv1_name):"PV1","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,(null===(_t=null==ee?void 0:ee.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(ee.solar.pv2_name):"PV2","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,(null===(Ut=null==ee?void 0:ee.solar)||void 0===Ut?void 0:Ut.pv3_name)?"".concat(ee.solar.pv3_name):"PV3","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,(null===(zt=null==ee?void 0:ee.solar)||void 0===zt?void 0:zt.pv4_name)?"".concat(ee.solar.pv4_name):"PV4","no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,is,"no"===En?"none":"","energy"===En?"st4 st8 left-align":"st12",Ln,os,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,rs,"no"===En?"none":"","power"===En?"st4 st8 left-align":"st12",Ln,hs,"no"===En?"none":"",Ln,"no"===En?"none":"",Ln,"one"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Qt=null==ee?void 0:ee.load)||void 0===Qt?void 0:Qt.load1_name)?"".concat(ee.load.load1_name):"","one"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(jt=null==ee?void 0:ee.load)||void 0===jt?void 0:jt.load1_name)?"".concat(ee.load.load1_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"two"===fn&&"yes"===ee.show_solar?"":"none",Ke,(null===(Wt=null==ee?void 0:ee.load)||void 0===Wt?void 0:Wt.load2_name)?"".concat(ee.load.load2_name):"","two"===fn&&"yes"===ee.show_solar?"":"none","no"===bn?"st14":"st4",Ke,isNaN(parseFloat(ze.state))?0:parseFloat(ze.state).toFixed(0),ts,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts?"st12":"",parseInt(de.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"st12":"",parseInt(Pe.state)<=0?"transparent":"".concat(gn),ds,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",gn,"no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(gn),ds,yn,In<0||0===In?"transparent":"".concat(yn),ps,In>0||0===In?"transparent":"".concat(yn),ps,"no"===ee.show_solar?"st12":"",gn,"no"===ee.show_solar?"st12":"",0===Sn?"transparent":"".concat(gn),ds,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,nn,Ge<0||0===Ge?"transparent":"".concat(nn),_s,Ge>0||0===Ge?"transparent":"".concat(nn),_s,Ke,0===Dn?"transparent":"".concat(Ke),cs,Ke,0===Dn?"transparent":"".concat(Ke),cs,"one"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"two"===fn&&"yes"===ee.show_solar?"":"st12",Ke,"oven"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"oven"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"pump"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"aircon"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"!==Mn||"one"!==fn&&"two"!==fn?"0":"1","no"===fn||"no"===ee.show_solar?"none":"",Ke,"boiler"===An&&"two"===fn?"1":"0","no"===fn||"no"===ee.show_solar?"none":"",Ke,"no"===fn||"no"===ee.show_solar?"none":"",Mn,"no"===fn||"one"===fn||"no"===ee.show_solar?"none":"",An,"no"===ee.show_solar?"st12":"",gn,parseInt(ve.state)>=Bn?1:0,yn,parseInt(ve.state)>=50&&parseInt(ve.state)Fn&&parseInt(ve.state)<=49?1:0,yn,parseInt(ve.state)<=Fn?1:0,yn,(t=>this.handlePopup(t,ee.entities.grid_connected_status_194)),"off"===ln||"0"===ln?"st12":"",nn,"on"===ln||"1"===ln?"st12":"",sn,Ke,Ln,(t=>this.handlePopup(t,ee.entities.use_timer_248)),"on"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"off"==He.state&&"no"!==Pn?"":"none",Ln,"on"==He.state&&"no"!==Pn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.priority_load_243)),"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,"off"===Ae.state&&"no"!==Vn?"":"none",Ln,"on"===Ae.state&&"no"!==Vn?"":"none",Ln,(t=>this.handlePopup(t,ee.entities.solar_sell_247)),ee.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,ee.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&"no"!==ee.show_solar?"":"none",gn,"no"===Xe?"":"st12",(t=>this.handlePopup(t,jn.entityID)),"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"st12":"",Ln,"no"===jn.show||"none"===ee.entities.use_timer_248?"none":"","none"===jn.charge?"":"st12",Ln,(t=>this.handlePopup(t,ee.entities.day_battery_charge_70)),"no"===wn?"none":"",yn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"!=Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_pv_energy_108)),"no"===xn||"no"===ee.show_solar||"false"===Hn?"none":"",gn,parseFloat(le.state).toFixed(1)||0,Hn,(t=>this.handlePopup(t,ee.entities.day_battery_discharge_71)),"no"===wn?"none":"",yn,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_load_energy_84)),"two"===fn?"365":"400.4","two"===fn?"168":"267.9","no"===en?"none":"",Ke,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_import_76)),"no"===vn?"none":"",nn,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.day_grid_export_77)),"no"===_n?"none":"",nn,parseFloat(Ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ee.entities.inverter_voltage_154)),"none"!==ee.entities.inverter_voltage_154&&ee.entities.inverter_voltage_154?"":"none",Ln,hn,(t=>this.handlePopup(t,ee.entities.load_frequency_192)),"none"!==ee.entities.load_frequency_192&&ee.entities.load_frequency_192?"":"none",Ln,rn,(t=>this.handlePopup(t,ee.entities.inverter_current_164)),"none"!==ee.entities.inverter_current_164&&ee.entities.inverter_current_164?"":"none",Ln,dn,(t=>this.handlePopup(t,ee.entities.battery_voltage_183)),"none"!==ee.entities.battery_voltage_183&&ee.entities.battery_voltage_183?"":"none",yn,"no"===bn?"st14":"st4",pn,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),"none"===ee.entities.battery_soc_184?"none":"",yn,parseInt(ve.state)||0,(t=>this.handlePopup(t,ee.entities.battery_soc_184)),yn,"no"===jn.show||"none"===ee.entities.battery_soc_184?"none":"",jn.capacity||0,(t=>this.handlePopup(t,ee.entities.battery_power_190)),"none"===ee.entities.battery_power_190?"none":"",yn,"no"===bn?"st14":"st4",In<0?-1*In:In,(t=>this.handlePopup(t,ee.entities.battery_current_191)),"none"===ee.entities.battery_current_191?"none":"",yn,"no"===bn?"st14":"st4",Be.state||0,(t=>this.handlePopup(t,ee.entities.grid_ct_power_172)),"none"===ee.entities.grid_ct_power_172?"none":"","no"===bn?"st14":"st4",nn,Ge||0,(t=>this.handlePopup(t,ee.entities.pv1_voltage_109)),"no"!==ee.show_solar&&ee.entities.pv1_voltage_109&&"none"!==ee.entities.pv1_voltage_109?"":"none",gn,ge.state||0,(t=>this.handlePopup(t,ee.entities.pv1_current_110)),"no"!==ee.show_solar&&ee.entities.pv1_current_110&&"none"!==ee.entities.pv1_current_110?"":"none",gn,xe.state||0,(t=>this.handlePopup(t,ee.entities.pv2_voltage_111)),"no"!==ee.show_solar&&ee.entities.pv2_voltage_111&&"none"!==ee.entities.pv2_voltage_111&&"one"!==ee.solar.mppts?"":"none",gn,me.state||0,(t=>this.handlePopup(t,ee.entities.pv2_current_112)),"no"!==ee.show_solar&&ee.entities.pv2_current_112&&"none"!==ee.entities.pv2_current_112&&"one"!==ee.solar.mppts?"":"none",gn,fe.state||0,(t=>this.handlePopup(t,ee.entities.pv3_voltage_113)),"no"!==ee.show_solar&&ee.entities.pv3_voltage_113&&"none"!==ee.entities.pv3_voltage_113&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,be.state||0,(t=>this.handlePopup(t,ee.entities.pv3_current_114)),"no"!==ee.show_solar&&ee.entities.pv3_current_114&&"none"!==ee.entities.pv3_current_114&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts?"":"none",gn,Ze.state||0,(t=>this.handlePopup(t,ee.entities.pv4_voltage_115)),"no"!==ee.show_solar&&ee.entities.pv4_voltage_115&&"none"!==ee.entities.pv4_voltage_115&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Le.state||0,(t=>this.handlePopup(t,ee.entities.pv4_current_116)),"no"!==ee.show_solar&&ee.entities.pv4_current_116&&"none"!==ee.entities.pv4_current_116&&"one"!==ee.solar.mppts&&"two"!==ee.solar.mppts&&"three"!==ee.solar.mppts?"":"none",gn,Ee.state||0,(t=>this.handlePopup(t,ee.entities.battery_temp_182)),"none"===ee.entities.battery_temp_182?"st12":"st3 left-align",yn,(null===(Gt=null==ee?void 0:ee.entities)||void 0===Gt?void 0:Gt.battery_temp_182)?"":"none",Se.state||"",(t=>this.handlePopup(t,ee.entities.radiator_temp_91)),"none"===ee.entities.radiator_temp_91?"st12":"st3 left-align",Ln,(null===(Xt=null==ee?void 0:ee.entities)||void 0===Xt?void 0:Xt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ee.entities.dc_transformer_temp_90)),"none"===ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ln,(null===(Kt=null==ee?void 0:ee.entities)||void 0===Kt?void 0:Kt.dc_transformer_temp_90)?"":"none",Re.state||"",(t=>this.handlePopup(t,ee.entities.energy_cost)),"none"===ee.entities.energy_cost?"st12":"st3 left-align",nn,(null===(Jt=null==ee?void 0:ee.entities)||void 0===Jt?void 0:Jt.energy_cost)?"":"none",Oe.state||"",(null===(te=null==ee?void 0:ee.entities)||void 0===te?void 0:te.pv_total)?N(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv_total)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0):N(It||(It=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,Rn||0),"none"!==ee.entities.pv1_power_186?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv1_power_186)),"no"===bn?"st14":"st4","no"===ee.show_solar?"none":"",gn,parseFloat(pe.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv1_power_186?"none":"",gn,parseFloat(pe.state).toFixed(0)||0),"none"!==ee.entities.pv2_power_187?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv2_power_187)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0):N(St||(St=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv2_power_187||"one"===ee.solar.mppts?"none":"",gn,parseFloat(de.state).toFixed(0)||0),"none"!==ee.entities.pv3_power_188?N(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv3_power_188)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0):N(Dt||(Dt=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv3_power_188||"one"===ee.solar.mppts||"two"===ee.solar.mppts?"none":"",gn,parseFloat(Pe.state).toFixed(0)||0),"none"!==ee.entities.pv4_power_189?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.pv4_power_189)),"no"===bn?"st14":"st4","no"===ee.show_solar||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0):N($t||($t=e([''," W"])),"no"===bn?"st14":"st4","no"===ee.show_solar||"none"===ee.entities.pv4_power_189||"one"===ee.solar.mppts||"two"===ee.solar.mppts||"three"===ee.solar.mppts?"none":"",gn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ee.entities.essential_power?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ee.entities.essential_power)),"no"===bn?"st14":"st4",Ke,Dn||0):N(Ot||(Ot=e([''," W"])),"no"===bn?"st14":"st4",Ke,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error("Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple");if(!t.show_solar)throw Error("Please include the show_solar attribute e.g. show_solar: yes");if(!t.battery)throw Error("No battery attributes defined");if(!t.battery.energy)throw new Error("Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320");if(!t.battery.shutdown_soc)throw new Error("Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20");if(t.battery.full_capacity<80)throw new Error("Full capacity needs to be between 80 and 100");if(t.battery.empty_capacity>30)throw new Error("Empty capacity needs to be <= 30");if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error("Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs");if("yes"===t.show_solar&&!t.solar)throw Error("No solar attributes defined");if("yes"===t.show_solar&&!t.solar.mppts)throw Error("Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two");if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error("Please include the day_pv_energy_108 attribute and entity ID");if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error("Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs");if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error("The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.");if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error("The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.");const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),s)}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen"})})); + */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function mt(t,e="",n=""){const s=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),wt[s])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==n&&(i=i.replace(e,n)),i}var ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Nt,Dt,$t,Yt,Ut,zt,Ot,Qt,jt,Wt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(mt("common.version"),": ").concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:0,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:2},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,g,x,w,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,_t,yt,gt,xt,wt,Gt,Xt,Kt,Jt,te,ee;const ne=this._config,se=this.hass.states[ne.entities.day_battery_discharge_71]||{state:"0"},ie=this.hass.states[ne.entities.day_battery_charge_70]||{state:"0"},oe=this.hass.states[ne.entities.day_load_energy_84]||{state:"0"},le=this.hass.states[ne.entities.day_grid_import_76]||{state:"0"},ae=this.hass.states[ne.entities.day_pv_energy_108]||{state:"0"},re=this.hass.states[ne.entities.inverter_voltage_154]||{state:"0"},he=this.hass.states[ne.entities.load_frequency_192]||{state:"0"},de=this.hass.states[ne.entities.inverter_current_164]||{state:"0"},pe=this.hass.states[ne.entities.pv2_power_187]||{state:"0"},ce=this.hass.states[ne.entities.pv1_power_186]||{state:"0"},ve=this.hass.states[ne.entities.battery_voltage_183]||{state:"0"},_e=this.hass.states[ne.entities.battery_soc_184]||{state:"0"},ye=this.hass.states[ne.entities.battery_power_190]||{state:"0"},ge=this.hass.states[ne.entities.essential_power]||{state:"0"},xe=this.hass.states[ne.entities.grid_ct_power_172]||{state:"0"},we=this.hass.states[ne.entities.pv1_voltage_109]||{state:"0"},me=this.hass.states[ne.entities.pv1_current_110]||{state:"0"},fe=this.hass.states[ne.entities.pv2_voltage_111]||{state:"0"},ue=this.hass.states[ne.entities.pv2_current_112]||{state:"0"},qe=this.hass.states[ne.entities.grid_connected_status_194]||{state:"on"},Te=this.hass.states[ne.entities.inverter_status_59]||{state:""},ke=this.hass.states[ne.entities.inverter_power_175]||{state:"0"},Me=this.hass.states[ne.entities.grid_power_169]||{state:"0"},Ae=this.hass.states[ne.entities.aux_power_166]||{state:"0"},He=this.hass.states[ne.entities.priority_load_243]||{state:"undefined"},be=this.hass.states[ne.entities.use_timer_248]||{state:"undefined"},Ze=this.hass.states[ne.entities.pv3_voltage_113]||{state:"0"},Le=this.hass.states[ne.entities.pv3_current_114]||{state:"0"},Ee=this.hass.states[ne.entities.pv4_voltage_115]||{state:"0"},Pe=this.hass.states[ne.entities.pv4_current_116]||{state:"0"},Ve=this.hass.states[ne.entities.pv3_power_188]||{state:"0"},Ie=this.hass.states[ne.entities.pv4_power_189]||{state:"0"},Ce=this.hass.states[ne.entities.day_grid_export_77]||{state:"0"},Be=this.hass.states[ne.entities.nonessential_power]||{state:"0"},Fe=this.hass.states[ne.entities.battery_current_191]||{state:"0"},Se=this.hass.states[ne.entities.remaining_solar]||{state:"0"},Re=this.hass.states[ne.entities.battery_temp_182]||{state:""},Ne=this.hass.states[ne.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ne.entities.radiator_temp_91]||{state:""},$e=this.hass.states[ne.entities.non_essential_load1]||{state:"0"},Ye=this.hass.states[ne.entities.non_essential_load2]||{state:"0"},Ue=this.hass.states[ne.entities.essential_load1]||{state:"0"},ze=this.hass.states[ne.entities.energy_cost]||{state:""},Oe=this.hass.states[ne.entities.solar_sell_247]||{state:"undefined"},Qe=this.hass.states[ne.entities.essential_load2]||{state:"0"},je=this.hass.states[ne.entities.pv_total]||{state:"0"},We=this.hass.states[ne.entities.aux_connected_status]||{state:"on"};let Ge="yes"===((null===(t=null==ne?void 0:ne.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Ae.state):parseInt(Ae.state),Xe="yes"===((null===(n=null==ne?void 0:ne.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(xe.state):parseInt(xe.state),Ke=(null===(s=null==ne?void 0:ne.inverter)||void 0===s?void 0:s.modern)||"yes",Je=(null===(i=null==ne?void 0:ne.load)||void 0===i?void 0:i.colour)||"#5fb6ad",tn=(null===(o=null==ne?void 0:ne.load)||void 0===o?void 0:o.aux_colour)||Je,en=(null===(l=null==ne?void 0:ne.load)||void 0===l?void 0:l.aux_off_colour)||Je,nn=(null===(a=null==ne?void 0:ne.load)||void 0===a?void 0:a.show_daily)||"no",sn=(null===(r=null==ne?void 0:ne.grid)||void 0===r?void 0:r.colour)||"#5490c2",on=(null===(h=null==ne?void 0:ne.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",ln=(null===(d=null==ne?void 0:ne.grid)||void 0===d?void 0:d.show_nonessential)||"yes",an=(null===(p=null==ne?void 0:ne.entities)||void 0===p?void 0:p.grid_connected_status_194)?qe.state:"on",rn=(null===(c=null==ne?void 0:ne.entities)||void 0===c?void 0:c.aux_connected_status)?We.state:"on",hn=(null===(v=null==ne?void 0:ne.entities)||void 0===v?void 0:v.load_frequency_192)?he.state:0,dn=(null===(_=null==ne?void 0:ne.entities)||void 0===_?void 0:_.inverter_voltage_154)?re.state:0,pn=(null===(y=null==ne?void 0:ne.entities)||void 0===y?void 0:y.inverter_current_164)?de.state:0,cn=(null===(g=null==ne?void 0:ne.entities)||void 0===g?void 0:g.battery_voltage_183)?ve.state:0,vn=null===(x=null==ne?void 0:ne.grid)||void 0===x?void 0:x.additional_loads;"no"!==vn&&1!==vn&&2!==vn&&(vn="no");let _n=(null===(w=null==ne?void 0:ne.grid)||void 0===w?void 0:w.show_daily_buy)||"no",yn=(null===(m=null==ne?void 0:ne.grid)||void 0===m?void 0:m.show_daily_sell)||"no",gn=(null===(f=null==ne?void 0:ne.battery)||void 0===f?void 0:f.colour)||"pink",xn=(null===(u=null==ne?void 0:ne.battery)||void 0===u?void 0:u.show_daily)||"no",wn=(null===(q=null==ne?void 0:ne.solar)||void 0===q?void 0:q.colour)||"orange",mn=(null===(T=null==ne?void 0:ne.solar)||void 0===T?void 0:T.show_daily)||"no",fn=null===(k=null==ne?void 0:ne.load)||void 0===k?void 0:k.show_aux;"no"!==fn&&"yes"!==fn&&(fn="no");let un=null===(M=null==ne?void 0:ne.load)||void 0===M?void 0:M.additional_loads;"no"!==un&&1!==un&&2!==un&&(un="no");let qn=(null===(A=null==ne?void 0:ne.load)||void 0===A?void 0:A.aux_type)||"default",Tn=(null===(H=null==ne?void 0:ne.grid)||void 0===H?void 0:H.nonessential_icon)||"default",kn=(null===(b=null==ne?void 0:ne.grid)||void 0===b?void 0:b.load1_icon)||"default",Mn=(null===(Z=null==ne?void 0:ne.grid)||void 0===Z?void 0:Z.load2_icon)||"default",An=(null===(L=null==ne?void 0:ne.load)||void 0===L?void 0:L.load1_icon)||"default",Hn=(null===(E=null==ne?void 0:ne.load)||void 0===E?void 0:E.load2_icon)||"default",bn=ne.entities.remaining_solar?parseFloat(Se.state).toFixed(1):"false",Zn=(null==ne?void 0:ne.large_font)||"no",Ln=(null==ne?void 0:ne.panel_mode)||"no",En=(null===(P=null==ne?void 0:ne.inverter)||void 0===P?void 0:P.colour)||"grey",Pn=(null===(V=null==ne?void 0:ne.inverter)||void 0===V?void 0:V.autarky)||"power",Vn="no"!==(null==ne?void 0:ne.entities.use_timer_248)&&(null==ne?void 0:ne.entities.use_timer_248)?be.state:"no",In="no"!==(null==ne?void 0:ne.entities.priority_load_243)&&(null==ne?void 0:ne.entities.priority_load_243)?He.state:"no",Cn="yes"===(null===(I=null==ne?void 0:ne.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(ye.state):parseInt(ye.state),Bn=(null==ne?void 0:ne.card_height)||"396px",Fn=(null===(C=null==ne?void 0:ne.battery)||void 0===C?void 0:C.full_capacity)||80,Sn=(null===(B=null==ne?void 0:ne.battery)||void 0===B?void 0:B.empty_capacity)||30,Rn=parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(ce.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0))+parseInt(parseFloat(Ie.state||"0").toFixed(0)),Nn=(null===(F=null==ne?void 0:ne.entities)||void 0===F?void 0:F.pv_total)?parseInt(je.state):Rn,Dn="none"!==(null==ne?void 0:ne.entities.essential_power)&&(null==ne?void 0:ne.entities.essential_power)?parseInt(ge.state):parseInt(ke.state)+parseInt(Me.state)-parseInt(Ae.state),$n="none"!==(null==ne?void 0:ne.entities.nonessential_power)&&(null==ne?void 0:ne.entities.nonessential_power)?parseInt(Be.state):parseInt(xe.state)-parseInt(Me.state);const Yn={time:this.hass.states[ne.entities.prog1_time]||{state:""},capacity:this.hass.states[ne.entities.prog1_capacity]||{state:""},charge:this.hass.states[ne.entities.prog1_charge]||{state:""}},Un={time:this.hass.states[ne.entities.prog2_time]||{state:""},capacity:this.hass.states[ne.entities.prog2_capacity]||{state:""},charge:this.hass.states[ne.entities.prog2_charge]||{state:""}},zn={time:this.hass.states[ne.entities.prog3_time]||{state:""},capacity:this.hass.states[ne.entities.prog3_capacity]||{state:""},charge:this.hass.states[ne.entities.prog3_charge]||{state:""}},On={time:this.hass.states[ne.entities.prog4_time]||{state:""},capacity:this.hass.states[ne.entities.prog4_capacity]||{state:""},charge:this.hass.states[ne.entities.prog4_charge]||{state:""}},Qn={time:this.hass.states[ne.entities.prog5_time]||{state:""},capacity:this.hass.states[ne.entities.prog5_capacity]||{state:""},charge:this.hass.states[ne.entities.prog5_charge]||{state:""}},jn={time:this.hass.states[ne.entities.prog6_time]||{state:""},capacity:this.hass.states[ne.entities.prog6_capacity]||{state:""},charge:this.hass.states[ne.entities.prog6_charge]||{state:""}};let Wn={capacity:ne.battery.shutdown_soc,entityID:""};if(ne.entities.use_timer_248&&"no"!==ne.entities.use_timer_248&&"off"!==be.state)if(ne.entities.prog1_time&&ne.entities.prog2_time&&ne.entities.prog3_time&&ne.entities.prog4_time&&ne.entities.prog5_time&&ne.entities.prog6_time){Wn.show="yes";const xs=new Date,ws=[];[Yn,Un,zn,On,Qn,jn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ws[e]=new Date(xs.getTime()),ws[e].setHours(n),ws[e].setMinutes(s)}));const[ms,fs,us,qs,Ts,ks]=ws;function Ms(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Wn.charge="none":Wn.charge="both",Wn.capacity=parseInt(t.capacity.state),Wn.entityID=e}xs>=ks||xs=ms&&xs=fs&&xs=us&&xs=qs&&xs=Ts&&xs0?Gn="off"===qe.state||"no"===Wn.show||parseInt(_e.state)<=Wn.capacity?ne.battery.shutdown_soc:Wn.capacity:Cn<0&&("off"===qe.state||"no"===Wn.show||parseInt(_e.state)>=Wn.capacity?Gn=100:parseInt(_e.state)0?Xn=(parseInt(_e.state)-Gn)/100*ne.battery.energy/Cn*60*60:Cn<0&&(Xn=(Gn-parseInt(_e.state))/100*ne.battery.energy/Cn*60*60*-1);const As=new Date,Hs=1e3*Xn,bs=new Date(As.getTime()+Hs),Zs=bs.getHours(),Ls=bs.getMinutes().toString().padStart(2,"0"),Es=Zs.toString().padStart(2,"0");Kn="".concat(Es,":").concat(Ls);const Ps=Math.floor(Xn/86400),Vs=Math.floor(Xn%86400/3600),Is=Math.floor(Xn%3600/60);Ps>0&&(Jn+="".concat(Ps," days, ")),(Vs>0||Ps>0)&&(Jn+="".concat(Vs," hrs, ")),Jn+="".concat(Is," min")}let ts=-2<=parseInt(Fe.state)&&parseInt(Fe.state)<=2&&parseInt(_e.state)>=99?"True":"False",es="",ns="";switch(Te.state){case"0":case"standby":es="blue",ns="Standby";break;case"1":case"selftest":es="yellow",ns="Selftest";break;case"2":case"normal":case"ok":es="green",ns="Normal";break;case"3":case"alarm":es="orange",ns="Alarm";break;case"4":case"fault":es="red",ns="Fault";break;default:"none"!==(null===(S=null==ne?void 0:ne.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ne?void 0:ne.entities)||void 0===R?void 0:R.inverter_status_59)?(es="transparent",ns="Status"):(es="transparent",ns="")}let ss=(isNaN(parseFloat(ae.state))?0:parseFloat(ae.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=(isNaN(parseFloat(oe.state))?0:parseFloat(oe.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),os=0!=is?Math.min(Math.round(100*ss/is),100):0,ls=0!=ss?Math.min(Math.round(100*is/ss),100):0,as=Rn+parseInt("".concat(Cn>0?Cn:0))+parseInt("".concat(Ge<0?-1*Ge:0)),rs=Dn+$n+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Cn<0?-1*Cn:0)),hs=0!=rs?Math.min(Math.round(100*as/rs),100):0,ds=0!=as?Math.min(Math.round(100*rs/as),100):0,ps=(null===($=null==ne?void 0:ne.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ne&&ne.solar&&ne.solar.animation_speed){let Cs=ne.solar.animation_speed-(ne.solar.animation_speed-1)*(Rn/(ne.solar.max_power||Rn));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(Y=null==ne?void 0:ne.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ne&&ne.battery&&ne.battery.animation_speed){let Bs=ne.battery.animation_speed-(ne.battery.animation_speed-1)*((Cn<0?-1*Cn:Cn)/(ne.battery.max_power||(Cn<0?-1*Cn:Cn)));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(U=null==ne?void 0:ne.load)||void 0===U?void 0:U.animation_speed)||"4";if(ne&&ne.load&&ne.load.animation_speed){let Fs=ne.load.animation_speed-(ne.load.animation_speed-1)*(Dn/(ne.load.max_power||Dn));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(z=null==ne?void 0:ne.load)||void 0===z?void 0:z.animation_speed)||"4";if(ne&&ne.load&&ne.load.animation_speed){let Ss=ne.load.animation_speed-(ne.load.animation_speed-1)*((parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))/(ne.load.max_power||(parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(O=null==ne?void 0:ne.grid)||void 0===O?void 0:O.animation_speed)||"8";if(ne&&ne.grid&&ne.grid.animation_speed){let Rs=ne.grid.animation_speed-(ne.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(ne.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));ys="".concat(Rs>=1?Rs:1)}let gs=(null===(Q=null==ne?void 0:ne.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ne&&ne.grid&&ne.grid.animation_speed){let Ns=ne.grid.animation_speed-(ne.grid.animation_speed-1)*($n/(ne.grid.max_power||$n));gs="".concat(Ns>=1?Ns:1)}return"full"===ne.cardstyle?N(ft||(ft=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,tn,en,sn,sn,"no"===Ln?"".concat(Bn):"100%",wn,"no"===ne.show_solar?"st12":"",gn,sn,sn,tn,"no"===fn?"st12":"",Je,En,wn,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",sn,"no"===ln?"st12":"",1===vn?"":"none",sn,"no"===ln?"st12":"",2===vn?"":"none",sn,"no"===ln||1===vn?"st12":"",2===vn?"":"none",sn,"no"===ln||1===vn?"st12":"","no"===fn?"30":"143",Je,1===un?"":"none","no"===fn?"376":"373","no"===fn?"30":"143",Je,2===un?"":"none","no"===fn?"413":"410","no"===fn?"30":"143",Je,2===un?"":"none","no"===Zn?"st14":"st4",0===ne.battery.energy||"True"===ts||0===Cn?"transparent":"".concat(gn),Jn,0===ne.battery.energy||Cn<=0||"True"===ts?"transparent":"".concat(gn),mt("common.runtime_to"),Gn,Kn,0===ne.battery.energy||Cn>=0||"True"===ts?"transparent":"".concat(gn),mt("common.to"),Gn,mt("common.charge"),Kn,0===ne.battery.energy||"False"===ts?"transparent":"".concat(gn),mt("common.battery_floating"),"no"===ne.show_solar?"none":"",wn,(null===(j=null==ne?void 0:ne.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ne.solar.pv1_name):"PV1","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,(null===(W=null==ne?void 0:ne.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ne.solar.pv2_name):"PV2","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,(null===(G=null==ne?void 0:ne.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ne.solar.pv3_name):"PV3","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,(null===(X=null==ne?void 0:ne.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ne.solar.pv4_name):"PV4",sn,En,ns,1!==un&&2!==un||"yes"!==fn?"":"none",Je,"no"===un||"no"===fn?"none":"",Je,"no"===fn?"70":"181",1===un?"":"none",Je,(null===(K=null==ne?void 0:ne.load)||void 0===K?void 0:K.load1_name)?"".concat(ne.load.load1_name):"","no"===fn?"47":"158",1===un?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),"no"===fn?"393":"390","no"===fn?"59":"172",2===un?"":"none",Je,(null===(J=null==ne?void 0:ne.load)||void 0===J?void 0:J.load1_name)?"".concat(ne.load.load1_name):"","no"===fn?"394":"391","no"===fn?"42":"154",2===un?"":"none",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),"no"===fn?"429":"426","no"===fn?"59":"172",2===un?"":"none",Je,(null===(tt=null==ne?void 0:ne.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ne.load.load2_name):"","no"===fn?"430":"427","no"===fn?"42":"154",2===un?"":"none",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),"no"===nn||"no"===fn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===un?"83%":"67%","no"===un?"18.5%":"24.25%","no"===nn||"yes"===fn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===mn||"no"===ne.show_solar||"false"!=bn?"transparent":"".concat(wn),mt("common.daily_solar"),"no"===mn||"no"===ne.show_solar||"false"===bn?"transparent":"".concat(wn),"no"===xn?"transparent":"".concat(gn),mt("common.daily_charge"),"no"===xn?"transparent":"".concat(gn),mt("common.daily_discharge"),"no"===ln?"68%":"76%","no"===ln?"96%":"66%","no"===_n?"transparent":"".concat(sn),mt("common.daily_grid_buy"),"no"===ln?"68%":"76%","no"===ln?"88%":"58%","no"===yn?"transparent":"".concat(sn),mt("common.daily_grid_sell"),"no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),(null===(et=null==ne?void 0:ne.load)||void 0===et?void 0:et.aux_name)?"".concat(ne.load.aux_name):"Auxiliary","no"===ln?"none":"",sn,(null===(nt=null==ne?void 0:ne.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ne.grid.nonessential_name):"Non Essential","no"===ln||"no"===vn||2===vn?"none":"",sn,(null===(st=null==ne?void 0:ne.grid)||void 0===st?void 0:st.load1_name)?"".concat(ne.grid.load1_name):"","no"===ln||"no"===vn||1===vn?"none":"",sn,(null===(it=null==ne?void 0:ne.grid)||void 0===it?void 0:it.load1_name)?"".concat(ne.grid.load1_name):"","no"===ln||"no"===vn||1===vn?"none":"",sn,(null===(ot=null==ne?void 0:ne.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ne.grid.load2_name):"","no"===ln||"no"===vn||2===vn?"none":"",sn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===ln||"no"===vn||1===vn?"none":"",sn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===ln||"no"===vn||1===vn?"none":"",sn,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,os,"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,ls,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,hs,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,ds,"no"===Pn?"none":"",En,"no"===Pn?"none":"",En,mt("common.ratio"),es,"yes"===fn?"":"none",1===un||2===un?"":"st12",Je,"no"===fn?"":"none",1===un?"":"st12",Je,"no"===fn?"":"none",2===un?"":"st12",Je,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",0===Rn?"transparent":"".concat(wn),ps,gn,Cn<0||0===Cn?"transparent":"".concat(gn),cs,Cn>0||0===Cn?"transparent":"".concat(gn),cs,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys/2,Xe>0||0===Xe?"transparent":"".concat(sn),ys/2,sn,"no"===ln?"st12":"","no"===ln?"st12":"",$n<=0?"transparent":"".concat(sn),gs/2,sn,"no"===ln?"st12":"","no"===ln?"st12":"",$n<=0?"transparent":"".concat(sn),gs,"no"===fn?"st12":"",tn,"no"===fn||0===Ge?"st12":"",Ge<0?"transparent":"".concat(tn),_s,"no"===fn||0===Ge?"st12":"",Ge>0?"transparent":"".concat(tn),_s,"no"===fn?"st12":"",tn,sn,En,Je,0===Dn?"transparent":"".concat(Je),vs,Je,En,parseInt(_e.state)>=Fn?1:0,gn,parseInt(_e.state)>=50&&parseInt(_e.state)Sn&&parseInt(_e.state)<=49?"1":"0",gn,parseInt(_e.state)<=Sn?1:0,gn,"no"===ne.show_solar?"st12":"",wn,(t=>this.handlePopup(t,ne.entities.grid_connected_status_194)),"off"===an||"0"===an?"st12":"",sn,"on"===an||"1"===an?"st12":"",on,"default"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"oven"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"boiler"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"pump"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"aircon"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"no"===ln||2===vn||1===vn?"none":"",Tn,"default"===kn&&"default"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"default"===kn&&"default"!=Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"default"!=kn&&"default"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"boiler"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"boiler"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"pump"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"pump"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"oven"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"oven"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"aircon"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"aircon"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"no"===ln||"no"===vn||1===vn?"none":"",kn,"no"===ln||"no"===vn||1===vn?"none":"",Mn,"default"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"boiler"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"pump"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"oven"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"aircon"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"no"===ln||"no"===vn||2===vn?"none":"",kn,1!==un&&2!==un||"no"!==fn?"none":"",Je,1!==un&&2!==un||"yes"!==fn?"none":"",Je,1===un||2===un?"none":"",Je,(t=>this.handlePopup(t,ne.entities.aux_connected_status)),"default"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"gen"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"inverter"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"oven"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"boiler"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"aircon"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"pump"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"no"===fn?"none":"",qn,"on"===rn||"1"===rn?"aux-icon":"aux-off-icon","boiler"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"boiler"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"boiler"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"boiler"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"boiler"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"boiler"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"aircon"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"aircon"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"aircon"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"aircon"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"aircon"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"aircon"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"pump"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"pump"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"pump"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"pump"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"pump"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"pump"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"oven"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"oven"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"oven"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"oven"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"oven"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"oven"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"no"===un||1===un?"none":"","yes"===fn?"350":"383","yes"===fn?"140":"5",An,"no"===un||1===un?"none":"","yes"===fn?"446":"420","yes"===fn?"140":"5",Hn,"no"===un||2===un?"none":"","336","yes"===fn?"140":"27",An,(t=>this.handlePopup(t,ne.entities.use_timer_248)),"no"!=Pn?"60.5%":"65%","on"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"60.5%":"65%","off"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"63.5%":"68%","on"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"63.5%":"68%","off"==be.state&&"no"!==Vn?"":"none",En,(t=>this.handlePopup(t,ne.entities.solar_sell_247)),ne.entities.solar_sell_247&&"none"!==ne.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,ne.entities.solar_sell_247&&"none"!==ne.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,(t=>this.handlePopup(t,ne.entities.priority_load_243)),"no"!=Pn?"65.5%":"70%","off"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"65.5%":"70%","on"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"68.5%":"73%","on"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"68.5%":"73%","off"===He.state&&"no"!==In?"":"none",En,"no"===Ke?"":"st12",(t=>this.handlePopup(t,Wn.entityID)),"no"!=Pn?"60.5%":"65%","no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"st12":"",En,"no"!=Pn?"60.5%":"65%","no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"":"st12",En,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"!=bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"===bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,bn,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),"no"===nn||"no"===fn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),"no"===un?"83%":"67%","no"===un?"15%":"21%","no"===nn||"yes"===fn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_battery_charge_70)),"no"===xn?"none":"",gn,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_battery_discharge_71)),"no"===xn?"none":"",gn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_import_76)),"no"===ln?"68%":"76%","no"===ln?"92.5%":"62.5%","no"===_n?"none":"",sn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_export_77)),"no"===ln?"68%":"76%","no"===ln?"84.25%":"54.5%","no"===yn?"none":"",sn,parseFloat(Ce.state).toFixed(1)||0,(null===(lt=null==ne?void 0:ne.entities)||void 0===lt?void 0:lt.pv_total)?D(ut||(ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv_total)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0):D(qt||(qt=e([' '," W "])),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0),"none"!==ne.entities.essential_power?D(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.essential_power)),"no"===Zn?"st14":"st4",Je,Dn||"0"):D(kt||(kt=e([''," W"])),"no"===Zn?"st14":"st4",Je,Dn||0),"none"!==ne.entities.nonessential_power?D(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.nonessential_power)),"no"===ln?"none":"","no"===Zn?"st14":"st4",sn,$n||0):D(At||(At=e([''," W "])),"no"===ln?"none":"","no"===Zn?"st14":"st4",sn,$n||0),(t=>this.handlePopup(t,ne.entities.grid_ct_power_172)),"none"===ne.entities.grid_ct_power_172?"none":"","no"===Zn?"st14":"st4",sn,Xe||0,"none"!==ne.entities.aux_power_166?D(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.aux_power_166)),"no"===Zn?"st14":"st4","no"===fn?"none":"",tn,Ge<0?-1*Ge:Ge):D(bt||(bt=e([''," W "])),"no"===Zn?"st14":"st4","no"===fn?"none":"",tn,Ge<0?-1*Ge:Ge),"none"!==ne.entities.pv1_power_186?D(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv1_power_186)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,parseFloat(ce.state).toFixed(0)||0):D(Lt||(Lt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv1_power_186?"none":"",wn,parseFloat(ce.state).toFixed(0)||0),"none"!==ne.entities.pv2_power_187?D(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv2_power_187)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0):D(Pt||(Pt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv2_power_187||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0),"none"!==ne.entities.pv3_power_188?D(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv3_power_188)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0):D(It||(It=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv3_power_188||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ne.entities.pv4_power_189?D(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv4_power_189)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0):D(Bt||(Bt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv4_power_189||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,ne.entities.inverter_voltage_154)),"none"!==ne.entities.inverter_voltage_154&&ne.entities.inverter_voltage_154?"":"none","no"===Zn?"st14":"st4",sn,dn,(t=>this.handlePopup(t,ne.entities.load_frequency_192)),"none"!==ne.entities.load_frequency_192&&ne.entities.load_frequency_192?"":"none","no"===Zn?"st14":"st4",sn,hn,(t=>this.handlePopup(t,ne.entities.inverter_current_164)),"none"!==ne.entities.inverter_current_164&&ne.entities.inverter_current_164?"":"none","no"===Zn?"st14":"st4",En,pn,(t=>this.handlePopup(t,ne.entities.battery_voltage_183)),"none"!==ne.entities.battery_voltage_183&&ne.entities.battery_voltage_183?"":"none",gn,"no"===Zn?"st14":"st4",cn,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),"none"===ne.entities.battery_soc_184?"none":"",gn,parseInt(_e.state)||0,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),gn,"no"===Wn.show||"none"===ne.entities.battery_soc_184?"none":"",Wn.capacity||0,(t=>this.handlePopup(t,ne.entities.battery_power_190)),"none"===ne.entities.battery_power_190?"none":"",gn,"no"===Zn?"st14":"st4",Cn<0?-1*Cn:Cn,(t=>this.handlePopup(t,ne.entities.battery_current_191)),"none"===ne.entities.battery_current_191?"none":"",gn,"no"===Zn?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,ne.entities.inverter_power_175)),"none"===ne.entities.inverter_power_175?"none":"","no"===Zn?"st14":"st4",En,ke.state||0,(t=>this.handlePopup(t,ne.entities.grid_power_169)),"none"===ne.entities.grid_power_169?"none":"","no"===Zn?"st14":"st4",sn,Me.state||0,(t=>this.handlePopup(t,ne.entities.pv1_voltage_109)),"no"!==ne.show_solar&&ne.entities.pv1_voltage_109&&"none"!==ne.entities.pv1_voltage_109?"":"none",wn,we.state||0,(t=>this.handlePopup(t,ne.entities.pv1_current_110)),"no"!==ne.show_solar&&ne.entities.pv1_current_110&&"none"!==ne.entities.pv1_current_110?"":"none",wn,me.state||0,(t=>this.handlePopup(t,ne.entities.pv2_voltage_111)),"no"!==ne.show_solar&&ne.entities.pv2_voltage_111&&"none"!==ne.entities.pv2_voltage_111&&1!==ne.solar.mppts?"":"none",wn,fe.state||0,(t=>this.handlePopup(t,ne.entities.pv2_current_112)),"no"!==ne.show_solar&&ne.entities.pv2_current_112&&"none"!==ne.entities.pv2_current_112&&1!==ne.solar.mppts?"":"none",wn,ue.state||0,(t=>this.handlePopup(t,ne.entities.pv3_voltage_113)),"no"!==ne.show_solar&&ne.entities.pv3_voltage_113&&"none"!==ne.entities.pv3_voltage_113&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Ze.state||0,(t=>this.handlePopup(t,ne.entities.pv3_current_114)),"no"!==ne.show_solar&&ne.entities.pv3_current_114&&"none"!==ne.entities.pv3_current_114&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Le.state||0,(t=>this.handlePopup(t,ne.entities.pv4_voltage_115)),"no"!==ne.show_solar&&ne.entities.pv4_voltage_115&&"none"!==ne.entities.pv4_voltage_115&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Ee.state||0,(t=>this.handlePopup(t,ne.entities.pv4_current_116)),"no"!==ne.show_solar&&ne.entities.pv4_current_116&&"none"!==ne.entities.pv4_current_116&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Pe.state||0,(t=>this.handlePopup(t,ne.entities.battery_temp_182)),"none"===ne.entities.battery_temp_182?"st12":"st3 left-align",gn,(null===(at=null==ne?void 0:ne.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,ne.entities.radiator_temp_91)),4===(null===(rt=null==ne?void 0:ne.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=null==ne?void 0:ne.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ne.entities.radiator_temp_91?"st12":"st3 left-align",En,(null===(dt=null==ne?void 0:ne.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ne.entities.dc_transformer_temp_90)),"none"===ne.entities.dc_transformer_temp_90?"st12":"st3 left-align",En,(null===(pt=null==ne?void 0:ne.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,ne.entities.energy_cost)),"none"===ne.entities.energy_cost?"st12":"st3 left-align",sn,(null===(ct=null==ne?void 0:ne.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",ze.state||""):"lite"===ne.cardstyle?N(Ft||(Ft=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,"no"===ne.show_solar?145.33:-.5,"no"===ne.show_solar?270.67:406,"".concat("no"===Ln?"no"===ne.show_solar?"246px":"".concat(Bn):"no"===ne.show_solar?"75%":"100%"),Je,wn,"no"===ne.show_solar?"st12":"",gn,sn,wn,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",Je,1===un&&"yes"===ne.show_solar?"":"none",Je,2===un&&"yes"===ne.show_solar?"":"none",Je,2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",0===ne.battery.energy||"True"===ts||0===Cn?"transparent":"".concat(gn),Jn,0===ne.battery.energy||Cn<=0||"True"===ts?"transparent":"".concat(gn),Gn,Kn,0===ne.battery.energy||Cn>=0||"True"===ts?"transparent":"".concat(gn),Gn,Kn,0===ne.battery.energy||"False"===ts?"transparent":"".concat(gn),mt("common.battery_floating"),"no"===xn?"transparent":"".concat(gn),"no"===xn?"transparent":"".concat(gn),2===un?"365":"400.4",2===un?"182.2":"282.1","no"===nn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===_n?"transparent":"".concat(sn),mt("common.daily_grid_buy"),"no"===yn?"transparent":"".concat(sn),mt("common.daily_grid_sell"),"no"===mn||"no"===ne.show_solar||"false"!=bn?"transparent":"".concat(wn),mt("common.daily_solar"),"no"===mn||"no"===ne.show_solar||"false"===bn?"transparent":"".concat(wn),"no"===ne.show_solar?"none":"",wn,(null===(vt=null==ne?void 0:ne.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ne.solar.pv1_name):"PV1","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,(null===(_t=null==ne?void 0:ne.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(ne.solar.pv2_name):"PV2","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,(null===(yt=null==ne?void 0:ne.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(ne.solar.pv3_name):"PV3","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,(null===(gt=null==ne?void 0:ne.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(ne.solar.pv4_name):"PV4","no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,os,"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,ls,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,hs,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,ds,"no"===Pn?"none":"",En,"no"===Pn?"none":"",En,mt("common.ratio"),1===un&&"yes"===ne.show_solar?"":"none",Je,(null===(xt=null==ne?void 0:ne.load)||void 0===xt?void 0:xt.load1_name)?"".concat(ne.load.load1_name):"",1===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===un&&"yes"===ne.show_solar?"":"none",Je,(null===(wt=null==ne?void 0:ne.load)||void 0===wt?void 0:wt.load1_name)?"".concat(ne.load.load1_name):"",2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===un&&"yes"===ne.show_solar?"":"none",Je,(null===(Gt=null==ne?void 0:ne.load)||void 0===Gt?void 0:Gt.load2_name)?"".concat(ne.load.load2_name):"",2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),es,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(wn),ps,gn,Cn<0||0===Cn?"transparent":"".concat(gn),cs,Cn>0||0===Cn?"transparent":"".concat(gn),cs,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",0===Rn?"transparent":"".concat(wn),ps,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,Je,0===Dn?"transparent":"".concat(Je),vs,Je,0===Dn?"transparent":"".concat(Je),vs,1===un&&"yes"===ne.show_solar?"":"st12",Je,2===un&&"yes"===ne.show_solar?"":"st12",Je,2===un&&"yes"===ne.show_solar?"":"st12",Je,"oven"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"oven"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"pump"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"pump"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"aircon"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"aircon"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"boiler"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"boiler"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"no"===un||"no"===ne.show_solar?"none":"",An,"no"===un||1===un||"no"===ne.show_solar?"none":"",Hn,"no"===ne.show_solar?"st12":"",wn,parseInt(_e.state)>=Fn?1:0,gn,parseInt(_e.state)>=50&&parseInt(_e.state)Sn&&parseInt(_e.state)<=49?1:0,gn,parseInt(_e.state)<=Sn?1:0,gn,(t=>this.handlePopup(t,ne.entities.grid_connected_status_194)),"off"===an||"0"===an?"st12":"",sn,"on"===an||"1"===an?"st12":"",on,Je,En,(t=>this.handlePopup(t,ne.entities.use_timer_248)),"on"==be.state&&"no"!==Vn?"":"none",En,"off"==be.state&&"no"!==Vn?"":"none",En,"off"==be.state&&"no"!==Vn?"":"none",En,"on"==be.state&&"no"!==Vn?"":"none",En,(t=>this.handlePopup(t,ne.entities.priority_load_243)),"off"===He.state&&"no"!==In?"":"none",En,"on"===He.state&&"no"!==In?"":"none",En,"off"===He.state&&"no"!==In?"":"none",En,"on"===He.state&&"no"!==In?"":"none",En,(t=>this.handlePopup(t,ne.entities.solar_sell_247)),ne.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,ne.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,"no"===Ke?"":"st12",(t=>this.handlePopup(t,Wn.entityID)),"no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"st12":"",En,"no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"":"st12",En,(t=>this.handlePopup(t,ne.entities.day_battery_charge_70)),"no"===xn?"none":"",gn,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"!=bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"===bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,bn,(t=>this.handlePopup(t,ne.entities.day_battery_discharge_71)),"no"===xn?"none":"",gn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),2===un?"365":"400.4",2===un?"168":"267.9","no"===nn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_import_76)),"no"===_n?"none":"",sn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_export_77)),"no"===yn?"none":"",sn,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.inverter_voltage_154)),"none"!==ne.entities.inverter_voltage_154&&ne.entities.inverter_voltage_154?"":"none",En,dn,(t=>this.handlePopup(t,ne.entities.load_frequency_192)),"none"!==ne.entities.load_frequency_192&&ne.entities.load_frequency_192?"":"none",En,hn,(t=>this.handlePopup(t,ne.entities.inverter_current_164)),"none"!==ne.entities.inverter_current_164&&ne.entities.inverter_current_164?"":"none",En,pn,(t=>this.handlePopup(t,ne.entities.battery_voltage_183)),"none"!==ne.entities.battery_voltage_183&&ne.entities.battery_voltage_183?"":"none",gn,"no"===Zn?"st14":"st4",cn,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),"none"===ne.entities.battery_soc_184?"none":"",gn,parseInt(_e.state)||0,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),gn,"no"===Wn.show||"none"===ne.entities.battery_soc_184?"none":"",Wn.capacity||0,(t=>this.handlePopup(t,ne.entities.battery_power_190)),"none"===ne.entities.battery_power_190?"none":"",gn,"no"===Zn?"st14":"st4",Cn<0?-1*Cn:Cn,(t=>this.handlePopup(t,ne.entities.battery_current_191)),"none"===ne.entities.battery_current_191?"none":"",gn,"no"===Zn?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,ne.entities.grid_ct_power_172)),"none"===ne.entities.grid_ct_power_172?"none":"","no"===Zn?"st14":"st4",sn,Xe||0,(t=>this.handlePopup(t,ne.entities.pv1_voltage_109)),"no"!==ne.show_solar&&ne.entities.pv1_voltage_109&&"none"!==ne.entities.pv1_voltage_109?"":"none",wn,we.state||0,(t=>this.handlePopup(t,ne.entities.pv1_current_110)),"no"!==ne.show_solar&&ne.entities.pv1_current_110&&"none"!==ne.entities.pv1_current_110?"":"none",wn,me.state||0,(t=>this.handlePopup(t,ne.entities.pv2_voltage_111)),"no"!==ne.show_solar&&ne.entities.pv2_voltage_111&&"none"!==ne.entities.pv2_voltage_111&&1!==ne.solar.mppts?"":"none",wn,fe.state||0,(t=>this.handlePopup(t,ne.entities.pv2_current_112)),"no"!==ne.show_solar&&ne.entities.pv2_current_112&&"none"!==ne.entities.pv2_current_112&&1!==ne.solar.mppts?"":"none",wn,ue.state||0,(t=>this.handlePopup(t,ne.entities.pv3_voltage_113)),"no"!==ne.show_solar&&ne.entities.pv3_voltage_113&&"none"!==ne.entities.pv3_voltage_113&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Ze.state||0,(t=>this.handlePopup(t,ne.entities.pv3_current_114)),"no"!==ne.show_solar&&ne.entities.pv3_current_114&&"none"!==ne.entities.pv3_current_114&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Le.state||0,(t=>this.handlePopup(t,ne.entities.pv4_voltage_115)),"no"!==ne.show_solar&&ne.entities.pv4_voltage_115&&"none"!==ne.entities.pv4_voltage_115&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Ee.state||0,(t=>this.handlePopup(t,ne.entities.pv4_current_116)),"no"!==ne.show_solar&&ne.entities.pv4_current_116&&"none"!==ne.entities.pv4_current_116&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Pe.state||0,(t=>this.handlePopup(t,ne.entities.battery_temp_182)),"none"===ne.entities.battery_temp_182?"st12":"st3 left-align",gn,(null===(Xt=null==ne?void 0:ne.entities)||void 0===Xt?void 0:Xt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,ne.entities.radiator_temp_91)),"none"===ne.entities.radiator_temp_91?"st12":"st3 left-align",En,(null===(Kt=null==ne?void 0:ne.entities)||void 0===Kt?void 0:Kt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ne.entities.dc_transformer_temp_90)),"none"===ne.entities.dc_transformer_temp_90?"st12":"st3 left-align",En,(null===(Jt=null==ne?void 0:ne.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,ne.entities.energy_cost)),"none"===ne.entities.energy_cost?"st12":"st3 left-align",sn,(null===(te=null==ne?void 0:ne.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=null==ne?void 0:ne.entities)||void 0===ee?void 0:ee.pv_total)?D(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv_total)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0):D(Rt||(Rt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0),"none"!==ne.entities.pv1_power_186?D(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv1_power_186)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,parseFloat(ce.state).toFixed(0)||0):D(Dt||(Dt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv1_power_186?"none":"",wn,parseFloat(ce.state).toFixed(0)||0),"none"!==ne.entities.pv2_power_187?D($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv2_power_187)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0):D(Yt||(Yt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv2_power_187||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0),"none"!==ne.entities.pv3_power_188?D(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv3_power_188)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0):D(zt||(zt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv3_power_188||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ne.entities.pv4_power_189?D(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv4_power_189)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0):D(Qt||(Qt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv4_power_189||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0),"none"!==ne.entities.essential_power?D(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.essential_power)),"no"===Zn?"st14":"st4",Je,Dn||0):D(Wt||(Wt=e([''," W"])),"no"===Zn?"st14":"st4",Je,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if("yes"===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if("yes"===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),s)}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 386c2e11..86da43e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,10 +5,10 @@ import { styles } from './style'; import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; import defaultConfig from './defaults'; import { CARD_VERSION } from './const'; - +import { localize } from './localize/localize'; console.groupCollapsed( - `%c ⚡ SUNSYNK-POWER-FLOW-CARD %c v${CARD_VERSION} `, + `%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ${localize('common.version')}: ${CARD_VERSION} `, 'color: orange; font-weight: bold; background: black', 'color: white; font-weight: bold; background: dimgray', ); @@ -35,7 +35,7 @@ export class SunsynkPowerFlowCard extends LitElement { }, solar: { show_daily: 'yes', - mppts: 'two', + mppts: 2, }, load: { show_daily: 'yes', @@ -150,7 +150,7 @@ export class SunsynkPowerFlowCard extends LitElement { let battery_voltage = config?.entities?.battery_voltage_183 ? stateObj11.state : 0; let noness_dual_load = config?.grid?.additional_loads; - if (noness_dual_load !== 'no' && noness_dual_load !== 'one' && noness_dual_load !== 'two') { + if (noness_dual_load !== 'no' && noness_dual_load !== 1 && noness_dual_load !== 2) { noness_dual_load = 'no'; } @@ -167,7 +167,7 @@ export class SunsynkPowerFlowCard extends LitElement { } let additional_load = config?.load?.additional_loads; - if (additional_load !== 'no' && additional_load !== 'one' && additional_load !== 'two') { + if (additional_load !== 'no' && additional_load !== 1 && additional_load !== 2) { additional_load = 'no'; } @@ -490,83 +490,83 @@ export class SunsynkPowerFlowCard extends LitElement { - - - + + + - - - - - - + + + + + + ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING + ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} + ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} + ${localize('common.battery_floating')} ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} Grid ${inverterStateMsg} - Essential + Essential Essential - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W - DAILY LOAD - DAILY LOAD - DAILY SOLAR + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${localize('common.daily_load')} + ${localize('common.daily_load')} + ${localize('common.daily_solar')} DAILY SOLAR / LEFT TODAY - DAILY CHARGE - DAILY DISCHARGE - DAILY GRID BUY - DAILY GRID SELL + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W ${Autarky}% ${Ratio}% ${Autarkyp}% ${Ratiop}% Autarky - Ratio + ${localize('common.ratio')} - - - + + + - - + + - - + + - - + + @@ -656,13 +656,13 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - + + + + + - +
@@ -673,19 +673,19 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - - - - - - + + + + + + + + + + + + +
@@ -695,7 +695,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -705,13 +705,13 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - + + + + + - +
@@ -722,9 +722,9 @@ export class SunsynkPowerFlowCard extends LitElement { - - - + + + this.handlePopup(e, config.entities.aux_connected_status)}> @@ -747,38 +747,38 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + +
@@ -788,7 +788,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -798,7 +798,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -886,19 +886,19 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -936,28 +936,28 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj17.state || 0} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state || 0} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> ${stateObj37.state || ''}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state || ''}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> DC: ${stateObj38.state || ''}° @@ -987,40 +987,40 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - + + + + + + ${duration} RUNTIME TO ${battery_capacity}% @${formattedResultTime} TO ${battery_capacity}% CHARGE @${formattedResultTime} - BATTERY FLOATING + ${localize('common.battery_floating')} DAILY CHARGE DAILY DISCHARGE - DAILY LOAD - DAILY GRID BUY - DAILY GRID SELL - DAILY SOLAR + ${localize('common.daily_load')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} + ${localize('common.daily_solar')} DAILY SOLAR / LEFT TODAY ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} ${Autarky}% ${Ratio}% ${Autarkyp}% ${Ratiop}% Autarky - Ratio - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${localize('common.ratio')} + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W @@ -1030,20 +1030,20 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - - + + - - + + @@ -1099,18 +1099,18 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - - - - - + + + + + + + + + + + + @@ -1122,7 +1122,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -1177,7 +1177,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh @@ -1219,22 +1219,22 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj17.state || 0} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state || 0} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> ${stateObj37.state || ''}° @@ -1260,19 +1260,19 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential || 0} W @@ -1287,51 +1287,51 @@ export class SunsynkPowerFlowCard extends LitElement { setConfig(config) { if (!config.cardstyle) { - throw Error('Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple'); + throw Error(localize('errors.cardstyle')); } if (!config.show_solar) { - throw Error('Please include the show_solar attribute e.g. show_solar: yes'); + throw Error(localize('errors.show_solar')); } if (!config.battery) { - throw Error('No battery attributes defined'); + throw Error(localize('errors.battery.bat')); } else { if (!config.battery.energy) { - throw new Error('Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320'); + throw new Error(localize('errors.battery.energy')); } if (!config.battery.shutdown_soc) { - throw new Error('Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20'); + throw new Error(localize('errors.battery.shutdown_soc')); } if (config.battery.full_capacity < 80) { - throw new Error('Full capacity needs to be between 80 and 100'); + throw new Error(localize('errors.battery.full_capacity')); } if (config.battery.empty_capacity > 30) { - throw new Error('Empty capacity needs to be <= 30'); + throw new Error(localize('errors.battery.empty_capacity')); } if (config.battery.show_daily === 'yes' && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71)) { - throw Error('Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs'); + throw Error(localize('errors.battery.show_daily')); } } if (config.show_solar === 'yes' && !config.solar) { - throw Error('No solar attributes defined'); + throw Error(localize('errors.solar.sol')); } else { if (config.show_solar === 'yes' && !config.solar.mppts) { - throw Error('Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two'); + throw Error(localize('errors.solar.mppts')); } if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.day_pv_energy_108) { - throw Error('Please include the day_pv_energy_108 attribute and entity ID'); + throw Error(localize('errors.solar.show_daily')); } } if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.day_grid_export_77)) { - throw Error('Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs'); + throw Error(localize('errors.grid.show_daily')); } if ((config && config.entities && config.entities.essential_power === 'none' && !config.entities.inverter_power_175) || (config && config.entities && config.entities.essential_power === 'none' && config.entities.inverter_power_175 === 'none')) { - throw Error('The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.'); + throw Error(localize('errors.essential_power')); } if ((config && config.entities && config.entities.nonessential_power === 'none' && !config.entities.grid_power_169)) { - throw Error('The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.'); + throw Error(localize('errors.nonessential_power')); } const all_attributes = [ @@ -1393,5 +1393,5 @@ export class SunsynkPowerFlowCard extends LitElement { type: "sunsynk-power-flow-card", name: "Sunsynk Power Flow Card", preview: false, // Optional - defaults to false - description: "A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen", // Optional + description: localize('common.description'), // Optional }); diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json new file mode 100644 index 00000000..e83458dc --- /dev/null +++ b/src/localize/languages/en.json @@ -0,0 +1,39 @@ +{ + "common": { + "description": "A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen", + "version": "Version", + "runtime_to": "RUNTIME TO", + "battery_floating": "BATTERY FLOATING", + "charge": "CHARGE", + "to": "TO", + "daily_load": "DAILY LOAD", + "daily_grid_buy": "DAILY GRID BUY", + "daily_grid_sell": "DAILY GRID SELL", + "daily_solar": "DAILY SOLAR", + "daily_charge": "DAILY CHARGE", + "daily_discharge": "DAILY DISCHARGE", + "ratio": "Ratio" + }, + "errors": { + "cardstyle": "Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple", + "show_style": "Please include the show_solar attribute e.g. show_solar: yes", + "battery": { + "bat": "No battery attributes defined", + "energy": "Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320", + "shutdown_soc": "Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20", + "full_capacity": "Full capacity needs to be between 80 and 100", + "empty_capacity": "Empty capacity needs to be <= 30", + "show_daily": "Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs" + }, + "solar":{ + "sol": "No solar attributes defined", + "mppts": "Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two", + "show_daily": "Please include the day_pv_energy_108 attribute and entity ID" + }, + "grid": { + "show_daily": "Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs" + }, + "essential_power": "The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.", + "nonessential_power": "The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value." + } +} diff --git a/src/localize/localize.ts b/src/localize/localize.ts new file mode 100644 index 00000000..455ddc3e --- /dev/null +++ b/src/localize/localize.ts @@ -0,0 +1,26 @@ +import * as en from './languages/en.json'; + +const languages: any = { + en: en, +}; + +export function localize(string: string, search = '', replace = '') { + const lang = (localStorage.getItem('selectedLanguage') || 'en').replace(/['"]+/g, '').replace('-', '_'); + + let translated: string; + + try { + translated = string.split('.').reduce((o, i) => o[i], languages[lang]); + } catch (e) { + translated = string.split('.').reduce((o, i) => o[i], languages['en']); + } + + if (translated === undefined) { + translated = string.split('.').reduce((o, i) => o[i], languages['en']); + } + + if (search !== '' && replace !== '') { + translated = translated.replace(search, replace); + } + return translated; +} From f46c844dfdcd2aaeb397caa8453988c4ebcafcec Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 16:14:16 +0100 Subject: [PATCH 04/40] refactor: change yes / no to boolean --- dist/sunsynk-power-flow-card.js | 16 +- src/index.ts | 682 ++++++++++++++++---------------- src/types.ts | 6 +- 3 files changed, 352 insertions(+), 352 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 87d44205..5efc63f7 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -1,40 +1,40 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function n(t,e,n,s){var i,o=arguments.length,l=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(l=(o<3?i(l):o>3?i(e,n,l):i(e,n))||l);return o>3&&l&&Object.defineProperty(e,n,l),l}"function"==typeof SuppressedError&&SuppressedError; +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function s(t,e,s,i){var n,l=arguments.length,a=l<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,i);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(l<3?n(a):l>3?n(e,s,a):n(e,s))||a);return l>3&&a&&Object.defineProperty(e,s,a),a}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const s=window,i=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),l=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=l.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&l.set(e,t))}return t}toString(){return this.cssText}};const r=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,o))(e)})(t):t +const i=window,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),a=new WeakMap;let o=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&a.set(e,t))}return t}toString(){return this.cssText}};const r=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,l))(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const s=this._$Ep(n,e);void 0!==s&&(this._$Ev.set(s,n),t.push(s))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,n,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(s){const i=this[t];this[e]=s,this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=s.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=g){var s;const i=this.constructor._$Ep(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null===(s=n.converter)||void 0===s?void 0:s.toAttribute)?n.converter:_).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(t,e){var n;const s=this.constructor,i=s._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:_;this._$El=i,this[i]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let s=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const i=this._$Ep(s,e);void 0!==i&&(this._$Ev.set(i,s),t.push(i))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),n=i.litNonce;void 0!==n&&s.setAttribute("nonce",n),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var i;const n=this.constructor._$Ep(t,s);if(void 0!==n&&!0===s.reflect){const l=(void 0!==(null===(i=s.converter)||void 0===i?void 0:i.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==l?this.removeAttribute(n):this.setAttribute(n,l),this._$El=null}}_$AK(t,e){var s;const i=this.constructor,n=i._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=i.getPropertyOptions(n),l="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=n,this[n]=l.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var m;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),N=R(1),D=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"":"",l=P;for(let e=0;e"===r[0]?(l=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=l.lastIndex-r[2].length,a=r[1],l=void 0===r[3]?C:'"'===r[3]?F:B):l===F||l===B?l=C:l===V||l===I?l=P:(l=C,i=void 0);const p=l===C&&t[e+1].startsWith("/>")?" ":"";o+=l===P?n+A:h>=0?(s.push(a),n.slice(0,h)+T+n.slice(h)+k+p):n+k+(-2===h?(s.push(void 0),e):p)}return[O(t,o+(t[n]||"")+(2===e?"":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,o=0;const l=t.length-1,a=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,n),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length0){s.textContent=u?u.emptyScript:"";for(let n=0;nL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(O(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new G(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new X(this.k(b()),this.k(b()),this,this.options)):n=e[s],n._$AI(i),s++;s2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=W(this,t,e,0),o=!Z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const s=t;let l,a;for(t=i[0],l=0;lt}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),N=R(1),D=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const s=t.length-1,i=[];let n,l=2===e?"":"",a=P;for(let e=0;e"===r[0]?(a=null!=n?n:P,h=-1):void 0===r[1]?h=-2:(h=a.lastIndex-r[2].length,o=r[1],a=void 0===r[3]?C:'"'===r[3]?F:B):a===F||a===B?a=C:a===V||a===I?a=P:(a=C,n=void 0);const p=a===C&&t[e+1].startsWith("/>")?" ":"";l+=a===P?s+A:h>=0?(i.push(o),s.slice(0,h)+T+s.slice(h)+k+p):s+k+(-2===h?(i.push(void 0),e):p)}return[O(t,l+(t[s]||"")+(2===e?"":"")),i]};class j{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0;const a=t.length-1,o=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=z.nextNode())&&o.length0){i.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=j.createElement(O(i.h,i.h[0]),this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.v(s);else{const t=new G(n,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new X(this.k(b()),this.k(b()),this,this.options)):s=e[i],s._$AI(n),i++;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){const n=this.strings;let l=!1;if(void 0===n)t=W(this,t,e,0),l=!Z(t)||t!==this._$AH&&t!==$,l&&(this._$AH=t);else{const i=t;let a,o;for(t=n[0],a=0;a{var s,i;const o=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:e;let l=o._$litPart$;if(void 0===l){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=l=new X(e.insertBefore(b(),t),t,void 0,null!=n?n:{})}return l._$AI(t),l})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}at.finalized=!0,at._$litElement$=!0,null===(ot=globalThis.litElementHydrateSupport)||void 0===ot||ot.call(globalThis,{LitElement:at});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:at}),(null!==(lt=globalThis.litElementVersions)&&void 0!==lt?lt:globalThis.litElementVersions=[]).push("3.3.3"); +var lt,at;class ot extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{var i,n;const l=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:e;let a=l._$litPart$;if(void 0===a){const t=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:null;l._$litPart$=a=new X(e.insertBefore(b(),t),t,void 0,null!=s?s:{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}ot.finalized=!0,ot._$litElement$=!0,null===(lt=globalThis.litElementHydrateSupport)||void 0===lt||lt.call(globalThis,{LitElement:ot});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:ot}),(null!==(at=globalThis.litElementVersions)&&void 0!==at?at:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}; +const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(s){s.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function dt(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):ht(t,e) + */function dt(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):ht(t,e) /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new a(n,t,o)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function mt(t,e="",n=""){const s=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),wt[s])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==n&&(i=i.replace(e,n)),i}var ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Nt,Dt,$t,Yt,Ut,zt,Ot,Qt,jt,Wt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(mt("common.version"),": ").concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends at{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:"yes",battery:{energy:0,shutdown_soc:20,show_daily:"yes"},solar:{show_daily:"yes",mppts:2},load:{show_daily:"yes"},grid:{show_daily_buy:"yes",show_daily_sell:"no",show_nonessential:"yes"},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,n,s,i,o,l,a,r,h,d,p,c,v,_,y,g,x,w,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,nt,st,it,ot,lt,at,rt,ht,dt,pt,ct,vt,_t,yt,gt,xt,wt,Gt,Xt,Kt,Jt,te,ee;const ne=this._config,se=this.hass.states[ne.entities.day_battery_discharge_71]||{state:"0"},ie=this.hass.states[ne.entities.day_battery_charge_70]||{state:"0"},oe=this.hass.states[ne.entities.day_load_energy_84]||{state:"0"},le=this.hass.states[ne.entities.day_grid_import_76]||{state:"0"},ae=this.hass.states[ne.entities.day_pv_energy_108]||{state:"0"},re=this.hass.states[ne.entities.inverter_voltage_154]||{state:"0"},he=this.hass.states[ne.entities.load_frequency_192]||{state:"0"},de=this.hass.states[ne.entities.inverter_current_164]||{state:"0"},pe=this.hass.states[ne.entities.pv2_power_187]||{state:"0"},ce=this.hass.states[ne.entities.pv1_power_186]||{state:"0"},ve=this.hass.states[ne.entities.battery_voltage_183]||{state:"0"},_e=this.hass.states[ne.entities.battery_soc_184]||{state:"0"},ye=this.hass.states[ne.entities.battery_power_190]||{state:"0"},ge=this.hass.states[ne.entities.essential_power]||{state:"0"},xe=this.hass.states[ne.entities.grid_ct_power_172]||{state:"0"},we=this.hass.states[ne.entities.pv1_voltage_109]||{state:"0"},me=this.hass.states[ne.entities.pv1_current_110]||{state:"0"},fe=this.hass.states[ne.entities.pv2_voltage_111]||{state:"0"},ue=this.hass.states[ne.entities.pv2_current_112]||{state:"0"},qe=this.hass.states[ne.entities.grid_connected_status_194]||{state:"on"},Te=this.hass.states[ne.entities.inverter_status_59]||{state:""},ke=this.hass.states[ne.entities.inverter_power_175]||{state:"0"},Me=this.hass.states[ne.entities.grid_power_169]||{state:"0"},Ae=this.hass.states[ne.entities.aux_power_166]||{state:"0"},He=this.hass.states[ne.entities.priority_load_243]||{state:"undefined"},be=this.hass.states[ne.entities.use_timer_248]||{state:"undefined"},Ze=this.hass.states[ne.entities.pv3_voltage_113]||{state:"0"},Le=this.hass.states[ne.entities.pv3_current_114]||{state:"0"},Ee=this.hass.states[ne.entities.pv4_voltage_115]||{state:"0"},Pe=this.hass.states[ne.entities.pv4_current_116]||{state:"0"},Ve=this.hass.states[ne.entities.pv3_power_188]||{state:"0"},Ie=this.hass.states[ne.entities.pv4_power_189]||{state:"0"},Ce=this.hass.states[ne.entities.day_grid_export_77]||{state:"0"},Be=this.hass.states[ne.entities.nonessential_power]||{state:"0"},Fe=this.hass.states[ne.entities.battery_current_191]||{state:"0"},Se=this.hass.states[ne.entities.remaining_solar]||{state:"0"},Re=this.hass.states[ne.entities.battery_temp_182]||{state:""},Ne=this.hass.states[ne.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[ne.entities.radiator_temp_91]||{state:""},$e=this.hass.states[ne.entities.non_essential_load1]||{state:"0"},Ye=this.hass.states[ne.entities.non_essential_load2]||{state:"0"},Ue=this.hass.states[ne.entities.essential_load1]||{state:"0"},ze=this.hass.states[ne.entities.energy_cost]||{state:""},Oe=this.hass.states[ne.entities.solar_sell_247]||{state:"undefined"},Qe=this.hass.states[ne.entities.essential_load2]||{state:"0"},je=this.hass.states[ne.entities.pv_total]||{state:"0"},We=this.hass.states[ne.entities.aux_connected_status]||{state:"on"};let Ge="yes"===((null===(t=null==ne?void 0:ne.load)||void 0===t?void 0:t.invert_aux)||"no")?-1*parseInt(Ae.state):parseInt(Ae.state),Xe="yes"===((null===(n=null==ne?void 0:ne.grid)||void 0===n?void 0:n.invert_grid)||"no")?-1*parseInt(xe.state):parseInt(xe.state),Ke=(null===(s=null==ne?void 0:ne.inverter)||void 0===s?void 0:s.modern)||"yes",Je=(null===(i=null==ne?void 0:ne.load)||void 0===i?void 0:i.colour)||"#5fb6ad",tn=(null===(o=null==ne?void 0:ne.load)||void 0===o?void 0:o.aux_colour)||Je,en=(null===(l=null==ne?void 0:ne.load)||void 0===l?void 0:l.aux_off_colour)||Je,nn=(null===(a=null==ne?void 0:ne.load)||void 0===a?void 0:a.show_daily)||"no",sn=(null===(r=null==ne?void 0:ne.grid)||void 0===r?void 0:r.colour)||"#5490c2",on=(null===(h=null==ne?void 0:ne.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",ln=(null===(d=null==ne?void 0:ne.grid)||void 0===d?void 0:d.show_nonessential)||"yes",an=(null===(p=null==ne?void 0:ne.entities)||void 0===p?void 0:p.grid_connected_status_194)?qe.state:"on",rn=(null===(c=null==ne?void 0:ne.entities)||void 0===c?void 0:c.aux_connected_status)?We.state:"on",hn=(null===(v=null==ne?void 0:ne.entities)||void 0===v?void 0:v.load_frequency_192)?he.state:0,dn=(null===(_=null==ne?void 0:ne.entities)||void 0===_?void 0:_.inverter_voltage_154)?re.state:0,pn=(null===(y=null==ne?void 0:ne.entities)||void 0===y?void 0:y.inverter_current_164)?de.state:0,cn=(null===(g=null==ne?void 0:ne.entities)||void 0===g?void 0:g.battery_voltage_183)?ve.state:0,vn=null===(x=null==ne?void 0:ne.grid)||void 0===x?void 0:x.additional_loads;"no"!==vn&&1!==vn&&2!==vn&&(vn="no");let _n=(null===(w=null==ne?void 0:ne.grid)||void 0===w?void 0:w.show_daily_buy)||"no",yn=(null===(m=null==ne?void 0:ne.grid)||void 0===m?void 0:m.show_daily_sell)||"no",gn=(null===(f=null==ne?void 0:ne.battery)||void 0===f?void 0:f.colour)||"pink",xn=(null===(u=null==ne?void 0:ne.battery)||void 0===u?void 0:u.show_daily)||"no",wn=(null===(q=null==ne?void 0:ne.solar)||void 0===q?void 0:q.colour)||"orange",mn=(null===(T=null==ne?void 0:ne.solar)||void 0===T?void 0:T.show_daily)||"no",fn=null===(k=null==ne?void 0:ne.load)||void 0===k?void 0:k.show_aux;"no"!==fn&&"yes"!==fn&&(fn="no");let un=null===(M=null==ne?void 0:ne.load)||void 0===M?void 0:M.additional_loads;"no"!==un&&1!==un&&2!==un&&(un="no");let qn=(null===(A=null==ne?void 0:ne.load)||void 0===A?void 0:A.aux_type)||"default",Tn=(null===(H=null==ne?void 0:ne.grid)||void 0===H?void 0:H.nonessential_icon)||"default",kn=(null===(b=null==ne?void 0:ne.grid)||void 0===b?void 0:b.load1_icon)||"default",Mn=(null===(Z=null==ne?void 0:ne.grid)||void 0===Z?void 0:Z.load2_icon)||"default",An=(null===(L=null==ne?void 0:ne.load)||void 0===L?void 0:L.load1_icon)||"default",Hn=(null===(E=null==ne?void 0:ne.load)||void 0===E?void 0:E.load2_icon)||"default",bn=ne.entities.remaining_solar?parseFloat(Se.state).toFixed(1):"false",Zn=(null==ne?void 0:ne.large_font)||"no",Ln=(null==ne?void 0:ne.panel_mode)||"no",En=(null===(P=null==ne?void 0:ne.inverter)||void 0===P?void 0:P.colour)||"grey",Pn=(null===(V=null==ne?void 0:ne.inverter)||void 0===V?void 0:V.autarky)||"power",Vn="no"!==(null==ne?void 0:ne.entities.use_timer_248)&&(null==ne?void 0:ne.entities.use_timer_248)?be.state:"no",In="no"!==(null==ne?void 0:ne.entities.priority_load_243)&&(null==ne?void 0:ne.entities.priority_load_243)?He.state:"no",Cn="yes"===(null===(I=null==ne?void 0:ne.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(ye.state):parseInt(ye.state),Bn=(null==ne?void 0:ne.card_height)||"396px",Fn=(null===(C=null==ne?void 0:ne.battery)||void 0===C?void 0:C.full_capacity)||80,Sn=(null===(B=null==ne?void 0:ne.battery)||void 0===B?void 0:B.empty_capacity)||30,Rn=parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(ce.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0))+parseInt(parseFloat(Ie.state||"0").toFixed(0)),Nn=(null===(F=null==ne?void 0:ne.entities)||void 0===F?void 0:F.pv_total)?parseInt(je.state):Rn,Dn="none"!==(null==ne?void 0:ne.entities.essential_power)&&(null==ne?void 0:ne.entities.essential_power)?parseInt(ge.state):parseInt(ke.state)+parseInt(Me.state)-parseInt(Ae.state),$n="none"!==(null==ne?void 0:ne.entities.nonessential_power)&&(null==ne?void 0:ne.entities.nonessential_power)?parseInt(Be.state):parseInt(xe.state)-parseInt(Me.state);const Yn={time:this.hass.states[ne.entities.prog1_time]||{state:""},capacity:this.hass.states[ne.entities.prog1_capacity]||{state:""},charge:this.hass.states[ne.entities.prog1_charge]||{state:""}},Un={time:this.hass.states[ne.entities.prog2_time]||{state:""},capacity:this.hass.states[ne.entities.prog2_capacity]||{state:""},charge:this.hass.states[ne.entities.prog2_charge]||{state:""}},zn={time:this.hass.states[ne.entities.prog3_time]||{state:""},capacity:this.hass.states[ne.entities.prog3_capacity]||{state:""},charge:this.hass.states[ne.entities.prog3_charge]||{state:""}},On={time:this.hass.states[ne.entities.prog4_time]||{state:""},capacity:this.hass.states[ne.entities.prog4_capacity]||{state:""},charge:this.hass.states[ne.entities.prog4_charge]||{state:""}},Qn={time:this.hass.states[ne.entities.prog5_time]||{state:""},capacity:this.hass.states[ne.entities.prog5_capacity]||{state:""},charge:this.hass.states[ne.entities.prog5_charge]||{state:""}},jn={time:this.hass.states[ne.entities.prog6_time]||{state:""},capacity:this.hass.states[ne.entities.prog6_capacity]||{state:""},charge:this.hass.states[ne.entities.prog6_charge]||{state:""}};let Wn={capacity:ne.battery.shutdown_soc,entityID:""};if(ne.entities.use_timer_248&&"no"!==ne.entities.use_timer_248&&"off"!==be.state)if(ne.entities.prog1_time&&ne.entities.prog2_time&&ne.entities.prog3_time&&ne.entities.prog4_time&&ne.entities.prog5_time&&ne.entities.prog6_time){Wn.show="yes";const xs=new Date,ws=[];[Yn,Un,zn,On,Qn,jn].forEach(((t,e)=>{const[n,s]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ws[e]=new Date(xs.getTime()),ws[e].setHours(n),ws[e].setMinutes(s)}));const[ms,fs,us,qs,Ts,ks]=ws;function Ms(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Wn.charge="none":Wn.charge="both",Wn.capacity=parseInt(t.capacity.state),Wn.entityID=e}xs>=ks||xs=ms&&xs=fs&&xs=us&&xs=qs&&xs=Ts&&xs0?Gn="off"===qe.state||"no"===Wn.show||parseInt(_e.state)<=Wn.capacity?ne.battery.shutdown_soc:Wn.capacity:Cn<0&&("off"===qe.state||"no"===Wn.show||parseInt(_e.state)>=Wn.capacity?Gn=100:parseInt(_e.state)0?Xn=(parseInt(_e.state)-Gn)/100*ne.battery.energy/Cn*60*60:Cn<0&&(Xn=(Gn-parseInt(_e.state))/100*ne.battery.energy/Cn*60*60*-1);const As=new Date,Hs=1e3*Xn,bs=new Date(As.getTime()+Hs),Zs=bs.getHours(),Ls=bs.getMinutes().toString().padStart(2,"0"),Es=Zs.toString().padStart(2,"0");Kn="".concat(Es,":").concat(Ls);const Ps=Math.floor(Xn/86400),Vs=Math.floor(Xn%86400/3600),Is=Math.floor(Xn%3600/60);Ps>0&&(Jn+="".concat(Ps," days, ")),(Vs>0||Ps>0)&&(Jn+="".concat(Vs," hrs, ")),Jn+="".concat(Is," min")}let ts=-2<=parseInt(Fe.state)&&parseInt(Fe.state)<=2&&parseInt(_e.state)>=99?"True":"False",es="",ns="";switch(Te.state){case"0":case"standby":es="blue",ns="Standby";break;case"1":case"selftest":es="yellow",ns="Selftest";break;case"2":case"normal":case"ok":es="green",ns="Normal";break;case"3":case"alarm":es="orange",ns="Alarm";break;case"4":case"fault":es="red",ns="Fault";break;default:"none"!==(null===(S=null==ne?void 0:ne.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==ne?void 0:ne.entities)||void 0===R?void 0:R.inverter_status_59)?(es="transparent",ns="Status"):(es="transparent",ns="")}let ss=(isNaN(parseFloat(ae.state))?0:parseFloat(ae.state))+(isNaN(parseFloat(se.state))?0:parseFloat(se.state)),is=(isNaN(parseFloat(oe.state))?0:parseFloat(oe.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),os=0!=is?Math.min(Math.round(100*ss/is),100):0,ls=0!=ss?Math.min(Math.round(100*is/ss),100):0,as=Rn+parseInt("".concat(Cn>0?Cn:0))+parseInt("".concat(Ge<0?-1*Ge:0)),rs=Dn+$n+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Cn<0?-1*Cn:0)),hs=0!=rs?Math.min(Math.round(100*as/rs),100):0,ds=0!=as?Math.min(Math.round(100*rs/as),100):0,ps=(null===($=null==ne?void 0:ne.solar)||void 0===$?void 0:$.animation_speed)||"9";if(ne&&ne.solar&&ne.solar.animation_speed){let Cs=ne.solar.animation_speed-(ne.solar.animation_speed-1)*(Rn/(ne.solar.max_power||Rn));ps="".concat(Cs>=1?Cs:1)}let cs=(null===(Y=null==ne?void 0:ne.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(ne&&ne.battery&&ne.battery.animation_speed){let Bs=ne.battery.animation_speed-(ne.battery.animation_speed-1)*((Cn<0?-1*Cn:Cn)/(ne.battery.max_power||(Cn<0?-1*Cn:Cn)));cs="".concat(Bs>=1?Bs:1)}let vs=(null===(U=null==ne?void 0:ne.load)||void 0===U?void 0:U.animation_speed)||"4";if(ne&&ne.load&&ne.load.animation_speed){let Fs=ne.load.animation_speed-(ne.load.animation_speed-1)*(Dn/(ne.load.max_power||Dn));vs="".concat(Fs>=1?Fs:1)}let _s=(null===(z=null==ne?void 0:ne.load)||void 0===z?void 0:z.animation_speed)||"4";if(ne&&ne.load&&ne.load.animation_speed){let Ss=ne.load.animation_speed-(ne.load.animation_speed-1)*((parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))/(ne.load.max_power||(parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))));_s="".concat(Ss>=1?Ss:1)}let ys=(null===(O=null==ne?void 0:ne.grid)||void 0===O?void 0:O.animation_speed)||"8";if(ne&&ne.grid&&ne.grid.animation_speed){let Rs=ne.grid.animation_speed-(ne.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(ne.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));ys="".concat(Rs>=1?Rs:1)}let gs=(null===(Q=null==ne?void 0:ne.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(ne&&ne.grid&&ne.grid.animation_speed){let Ns=ne.grid.animation_speed-(ne.grid.animation_speed-1)*($n/(ne.grid.max_power||$n));gs="".concat(Ns>=1?Ns:1)}return"full"===ne.cardstyle?N(ft||(ft=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,tn,en,sn,sn,"no"===Ln?"".concat(Bn):"100%",wn,"no"===ne.show_solar?"st12":"",gn,sn,sn,tn,"no"===fn?"st12":"",Je,En,wn,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",sn,"no"===ln?"st12":"",1===vn?"":"none",sn,"no"===ln?"st12":"",2===vn?"":"none",sn,"no"===ln||1===vn?"st12":"",2===vn?"":"none",sn,"no"===ln||1===vn?"st12":"","no"===fn?"30":"143",Je,1===un?"":"none","no"===fn?"376":"373","no"===fn?"30":"143",Je,2===un?"":"none","no"===fn?"413":"410","no"===fn?"30":"143",Je,2===un?"":"none","no"===Zn?"st14":"st4",0===ne.battery.energy||"True"===ts||0===Cn?"transparent":"".concat(gn),Jn,0===ne.battery.energy||Cn<=0||"True"===ts?"transparent":"".concat(gn),mt("common.runtime_to"),Gn,Kn,0===ne.battery.energy||Cn>=0||"True"===ts?"transparent":"".concat(gn),mt("common.to"),Gn,mt("common.charge"),Kn,0===ne.battery.energy||"False"===ts?"transparent":"".concat(gn),mt("common.battery_floating"),"no"===ne.show_solar?"none":"",wn,(null===(j=null==ne?void 0:ne.solar)||void 0===j?void 0:j.pv1_name)?"".concat(ne.solar.pv1_name):"PV1","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,(null===(W=null==ne?void 0:ne.solar)||void 0===W?void 0:W.pv2_name)?"".concat(ne.solar.pv2_name):"PV2","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,(null===(G=null==ne?void 0:ne.solar)||void 0===G?void 0:G.pv3_name)?"".concat(ne.solar.pv3_name):"PV3","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,(null===(X=null==ne?void 0:ne.solar)||void 0===X?void 0:X.pv4_name)?"".concat(ne.solar.pv4_name):"PV4",sn,En,ns,1!==un&&2!==un||"yes"!==fn?"":"none",Je,"no"===un||"no"===fn?"none":"",Je,"no"===fn?"70":"181",1===un?"":"none",Je,(null===(K=null==ne?void 0:ne.load)||void 0===K?void 0:K.load1_name)?"".concat(ne.load.load1_name):"","no"===fn?"47":"158",1===un?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),"no"===fn?"393":"390","no"===fn?"59":"172",2===un?"":"none",Je,(null===(J=null==ne?void 0:ne.load)||void 0===J?void 0:J.load1_name)?"".concat(ne.load.load1_name):"","no"===fn?"394":"391","no"===fn?"42":"154",2===un?"":"none",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),"no"===fn?"429":"426","no"===fn?"59":"172",2===un?"":"none",Je,(null===(tt=null==ne?void 0:ne.load)||void 0===tt?void 0:tt.load2_name)?"".concat(ne.load.load2_name):"","no"===fn?"430":"427","no"===fn?"42":"154",2===un?"":"none",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),"no"===nn||"no"===fn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===un?"83%":"67%","no"===un?"18.5%":"24.25%","no"===nn||"yes"===fn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===mn||"no"===ne.show_solar||"false"!=bn?"transparent":"".concat(wn),mt("common.daily_solar"),"no"===mn||"no"===ne.show_solar||"false"===bn?"transparent":"".concat(wn),"no"===xn?"transparent":"".concat(gn),mt("common.daily_charge"),"no"===xn?"transparent":"".concat(gn),mt("common.daily_discharge"),"no"===ln?"68%":"76%","no"===ln?"96%":"66%","no"===_n?"transparent":"".concat(sn),mt("common.daily_grid_buy"),"no"===ln?"68%":"76%","no"===ln?"88%":"58%","no"===yn?"transparent":"".concat(sn),mt("common.daily_grid_sell"),"no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),(null===(et=null==ne?void 0:ne.load)||void 0===et?void 0:et.aux_name)?"".concat(ne.load.aux_name):"Auxiliary","no"===ln?"none":"",sn,(null===(nt=null==ne?void 0:ne.grid)||void 0===nt?void 0:nt.nonessential_name)?"".concat(ne.grid.nonessential_name):"Non Essential","no"===ln||"no"===vn||2===vn?"none":"",sn,(null===(st=null==ne?void 0:ne.grid)||void 0===st?void 0:st.load1_name)?"".concat(ne.grid.load1_name):"","no"===ln||"no"===vn||1===vn?"none":"",sn,(null===(it=null==ne?void 0:ne.grid)||void 0===it?void 0:it.load1_name)?"".concat(ne.grid.load1_name):"","no"===ln||"no"===vn||1===vn?"none":"",sn,(null===(ot=null==ne?void 0:ne.grid)||void 0===ot?void 0:ot.load2_name)?"".concat(ne.grid.load2_name):"","no"===ln||"no"===vn||2===vn?"none":"",sn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===ln||"no"===vn||1===vn?"none":"",sn,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),"no"===ln||"no"===vn||1===vn?"none":"",sn,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,os,"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,ls,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,hs,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,ds,"no"===Pn?"none":"",En,"no"===Pn?"none":"",En,mt("common.ratio"),es,"yes"===fn?"":"none",1===un||2===un?"":"st12",Je,"no"===fn?"":"none",1===un?"":"st12",Je,"no"===fn?"":"none",2===un?"":"st12",Je,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",0===Rn?"transparent":"".concat(wn),ps,gn,Cn<0||0===Cn?"transparent":"".concat(gn),cs,Cn>0||0===Cn?"transparent":"".concat(gn),cs,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys/2,Xe>0||0===Xe?"transparent":"".concat(sn),ys/2,sn,"no"===ln?"st12":"","no"===ln?"st12":"",$n<=0?"transparent":"".concat(sn),gs/2,sn,"no"===ln?"st12":"","no"===ln?"st12":"",$n<=0?"transparent":"".concat(sn),gs,"no"===fn?"st12":"",tn,"no"===fn||0===Ge?"st12":"",Ge<0?"transparent":"".concat(tn),_s,"no"===fn||0===Ge?"st12":"",Ge>0?"transparent":"".concat(tn),_s,"no"===fn?"st12":"",tn,sn,En,Je,0===Dn?"transparent":"".concat(Je),vs,Je,En,parseInt(_e.state)>=Fn?1:0,gn,parseInt(_e.state)>=50&&parseInt(_e.state)Sn&&parseInt(_e.state)<=49?"1":"0",gn,parseInt(_e.state)<=Sn?1:0,gn,"no"===ne.show_solar?"st12":"",wn,(t=>this.handlePopup(t,ne.entities.grid_connected_status_194)),"off"===an||"0"===an?"st12":"",sn,"on"===an||"1"===an?"st12":"",on,"default"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"oven"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"boiler"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"pump"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"aircon"===Tn?"1":"0","no"===ln||2===vn||1===vn?"none":"",sn,"no"===ln||2===vn||1===vn?"none":"",Tn,"default"===kn&&"default"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"default"===kn&&"default"!=Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"default"!=kn&&"default"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"boiler"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"boiler"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"pump"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"pump"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"oven"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"oven"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"aircon"===kn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"aircon"===Mn?"1":"0","no"===ln||"no"===vn||1===vn?"none":"",sn,"no"===ln||"no"===vn||1===vn?"none":"",kn,"no"===ln||"no"===vn||1===vn?"none":"",Mn,"default"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"boiler"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"pump"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"oven"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"aircon"===kn?"1":"0","no"===ln||"no"===vn||2===vn?"none":"",sn,"no"===ln||"no"===vn||2===vn?"none":"",kn,1!==un&&2!==un||"no"!==fn?"none":"",Je,1!==un&&2!==un||"yes"!==fn?"none":"",Je,1===un||2===un?"none":"",Je,(t=>this.handlePopup(t,ne.entities.aux_connected_status)),"default"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"gen"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"inverter"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"oven"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"boiler"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"aircon"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"pump"===qn?"":"st12","no"===fn?"none":"","".concat("on"===rn||"1"===rn?tn:en),"no"===fn?"none":"",qn,"on"===rn||"1"===rn?"aux-icon":"aux-off-icon","boiler"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"boiler"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"boiler"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"boiler"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"boiler"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"boiler"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"aircon"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"aircon"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"aircon"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"aircon"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"aircon"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"aircon"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"pump"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"pump"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"pump"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"pump"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"pump"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"pump"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"oven"===An&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"oven"===Hn&&2===un?"1":"0","no"===fn||"no"===un||1===un?"none":"",Je,"oven"===An&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"oven"===Hn&&2===un&&"no"===fn?"1":"0","no"===un||1===un?"none":"",Je,"oven"===An&&1===un&&"no"===fn?"1":"0","no"===un||2===un?"none":"",Je,"oven"===An&&1===un?"1":"0","no"===fn||"no"===un||2===un?"none":"",Je,"no"===un||1===un?"none":"","yes"===fn?"350":"383","yes"===fn?"140":"5",An,"no"===un||1===un?"none":"","yes"===fn?"446":"420","yes"===fn?"140":"5",Hn,"no"===un||2===un?"none":"","336","yes"===fn?"140":"27",An,(t=>this.handlePopup(t,ne.entities.use_timer_248)),"no"!=Pn?"60.5%":"65%","on"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"60.5%":"65%","off"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"63.5%":"68%","on"==be.state&&"no"!==Vn?"":"none",En,"no"!=Pn?"63.5%":"68%","off"==be.state&&"no"!==Vn?"":"none",En,(t=>this.handlePopup(t,ne.entities.solar_sell_247)),ne.entities.solar_sell_247&&"none"!==ne.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,ne.entities.solar_sell_247&&"none"!==ne.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,(t=>this.handlePopup(t,ne.entities.priority_load_243)),"no"!=Pn?"65.5%":"70%","off"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"65.5%":"70%","on"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"68.5%":"73%","on"===He.state&&"no"!==In?"":"none",En,"no"!=Pn?"68.5%":"73%","off"===He.state&&"no"!==In?"":"none",En,"no"===Ke?"":"st12",(t=>this.handlePopup(t,Wn.entityID)),"no"!=Pn?"60.5%":"65%","no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"st12":"",En,"no"!=Pn?"60.5%":"65%","no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"":"st12",En,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"!=bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"===bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,bn,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),"no"===nn||"no"===fn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),"no"===un?"83%":"67%","no"===un?"15%":"21%","no"===nn||"yes"===fn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_battery_charge_70)),"no"===xn?"none":"",gn,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_battery_discharge_71)),"no"===xn?"none":"",gn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_import_76)),"no"===ln?"68%":"76%","no"===ln?"92.5%":"62.5%","no"===_n?"none":"",sn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_export_77)),"no"===ln?"68%":"76%","no"===ln?"84.25%":"54.5%","no"===yn?"none":"",sn,parseFloat(Ce.state).toFixed(1)||0,(null===(lt=null==ne?void 0:ne.entities)||void 0===lt?void 0:lt.pv_total)?D(ut||(ut=e(['
\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv_total)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0):D(qt||(qt=e([' '," W "])),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0),"none"!==ne.entities.essential_power?D(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.essential_power)),"no"===Zn?"st14":"st4",Je,Dn||"0"):D(kt||(kt=e([''," W"])),"no"===Zn?"st14":"st4",Je,Dn||0),"none"!==ne.entities.nonessential_power?D(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.nonessential_power)),"no"===ln?"none":"","no"===Zn?"st14":"st4",sn,$n||0):D(At||(At=e([''," W "])),"no"===ln?"none":"","no"===Zn?"st14":"st4",sn,$n||0),(t=>this.handlePopup(t,ne.entities.grid_ct_power_172)),"none"===ne.entities.grid_ct_power_172?"none":"","no"===Zn?"st14":"st4",sn,Xe||0,"none"!==ne.entities.aux_power_166?D(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.aux_power_166)),"no"===Zn?"st14":"st4","no"===fn?"none":"",tn,Ge<0?-1*Ge:Ge):D(bt||(bt=e([''," W "])),"no"===Zn?"st14":"st4","no"===fn?"none":"",tn,Ge<0?-1*Ge:Ge),"none"!==ne.entities.pv1_power_186?D(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv1_power_186)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,parseFloat(ce.state).toFixed(0)||0):D(Lt||(Lt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv1_power_186?"none":"",wn,parseFloat(ce.state).toFixed(0)||0),"none"!==ne.entities.pv2_power_187?D(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv2_power_187)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0):D(Pt||(Pt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv2_power_187||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0),"none"!==ne.entities.pv3_power_188?D(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv3_power_188)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0):D(It||(It=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv3_power_188||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ne.entities.pv4_power_189?D(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv4_power_189)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0):D(Bt||(Bt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv4_power_189||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,ne.entities.inverter_voltage_154)),"none"!==ne.entities.inverter_voltage_154&&ne.entities.inverter_voltage_154?"":"none","no"===Zn?"st14":"st4",sn,dn,(t=>this.handlePopup(t,ne.entities.load_frequency_192)),"none"!==ne.entities.load_frequency_192&&ne.entities.load_frequency_192?"":"none","no"===Zn?"st14":"st4",sn,hn,(t=>this.handlePopup(t,ne.entities.inverter_current_164)),"none"!==ne.entities.inverter_current_164&&ne.entities.inverter_current_164?"":"none","no"===Zn?"st14":"st4",En,pn,(t=>this.handlePopup(t,ne.entities.battery_voltage_183)),"none"!==ne.entities.battery_voltage_183&&ne.entities.battery_voltage_183?"":"none",gn,"no"===Zn?"st14":"st4",cn,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),"none"===ne.entities.battery_soc_184?"none":"",gn,parseInt(_e.state)||0,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),gn,"no"===Wn.show||"none"===ne.entities.battery_soc_184?"none":"",Wn.capacity||0,(t=>this.handlePopup(t,ne.entities.battery_power_190)),"none"===ne.entities.battery_power_190?"none":"",gn,"no"===Zn?"st14":"st4",Cn<0?-1*Cn:Cn,(t=>this.handlePopup(t,ne.entities.battery_current_191)),"none"===ne.entities.battery_current_191?"none":"",gn,"no"===Zn?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,ne.entities.inverter_power_175)),"none"===ne.entities.inverter_power_175?"none":"","no"===Zn?"st14":"st4",En,ke.state||0,(t=>this.handlePopup(t,ne.entities.grid_power_169)),"none"===ne.entities.grid_power_169?"none":"","no"===Zn?"st14":"st4",sn,Me.state||0,(t=>this.handlePopup(t,ne.entities.pv1_voltage_109)),"no"!==ne.show_solar&&ne.entities.pv1_voltage_109&&"none"!==ne.entities.pv1_voltage_109?"":"none",wn,we.state||0,(t=>this.handlePopup(t,ne.entities.pv1_current_110)),"no"!==ne.show_solar&&ne.entities.pv1_current_110&&"none"!==ne.entities.pv1_current_110?"":"none",wn,me.state||0,(t=>this.handlePopup(t,ne.entities.pv2_voltage_111)),"no"!==ne.show_solar&&ne.entities.pv2_voltage_111&&"none"!==ne.entities.pv2_voltage_111&&1!==ne.solar.mppts?"":"none",wn,fe.state||0,(t=>this.handlePopup(t,ne.entities.pv2_current_112)),"no"!==ne.show_solar&&ne.entities.pv2_current_112&&"none"!==ne.entities.pv2_current_112&&1!==ne.solar.mppts?"":"none",wn,ue.state||0,(t=>this.handlePopup(t,ne.entities.pv3_voltage_113)),"no"!==ne.show_solar&&ne.entities.pv3_voltage_113&&"none"!==ne.entities.pv3_voltage_113&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Ze.state||0,(t=>this.handlePopup(t,ne.entities.pv3_current_114)),"no"!==ne.show_solar&&ne.entities.pv3_current_114&&"none"!==ne.entities.pv3_current_114&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Le.state||0,(t=>this.handlePopup(t,ne.entities.pv4_voltage_115)),"no"!==ne.show_solar&&ne.entities.pv4_voltage_115&&"none"!==ne.entities.pv4_voltage_115&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Ee.state||0,(t=>this.handlePopup(t,ne.entities.pv4_current_116)),"no"!==ne.show_solar&&ne.entities.pv4_current_116&&"none"!==ne.entities.pv4_current_116&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Pe.state||0,(t=>this.handlePopup(t,ne.entities.battery_temp_182)),"none"===ne.entities.battery_temp_182?"st12":"st3 left-align",gn,(null===(at=null==ne?void 0:ne.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,ne.entities.radiator_temp_91)),4===(null===(rt=null==ne?void 0:ne.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=null==ne?void 0:ne.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===ne.entities.radiator_temp_91?"st12":"st3 left-align",En,(null===(dt=null==ne?void 0:ne.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ne.entities.dc_transformer_temp_90)),"none"===ne.entities.dc_transformer_temp_90?"st12":"st3 left-align",En,(null===(pt=null==ne?void 0:ne.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,ne.entities.energy_cost)),"none"===ne.entities.energy_cost?"st12":"st3 left-align",sn,(null===(ct=null==ne?void 0:ne.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",ze.state||""):"lite"===ne.cardstyle?N(Ft||(Ft=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,"no"===ne.show_solar?145.33:-.5,"no"===ne.show_solar?270.67:406,"".concat("no"===Ln?"no"===ne.show_solar?"246px":"".concat(Bn):"no"===ne.show_solar?"75%":"100%"),Je,wn,"no"===ne.show_solar?"st12":"",gn,sn,wn,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",Je,1===un&&"yes"===ne.show_solar?"":"none",Je,2===un&&"yes"===ne.show_solar?"":"none",Je,2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",0===ne.battery.energy||"True"===ts||0===Cn?"transparent":"".concat(gn),Jn,0===ne.battery.energy||Cn<=0||"True"===ts?"transparent":"".concat(gn),Gn,Kn,0===ne.battery.energy||Cn>=0||"True"===ts?"transparent":"".concat(gn),Gn,Kn,0===ne.battery.energy||"False"===ts?"transparent":"".concat(gn),mt("common.battery_floating"),"no"===xn?"transparent":"".concat(gn),"no"===xn?"transparent":"".concat(gn),2===un?"365":"400.4",2===un?"182.2":"282.1","no"===nn?"transparent":"".concat(Je),mt("common.daily_load"),"no"===_n?"transparent":"".concat(sn),mt("common.daily_grid_buy"),"no"===yn?"transparent":"".concat(sn),mt("common.daily_grid_sell"),"no"===mn||"no"===ne.show_solar||"false"!=bn?"transparent":"".concat(wn),mt("common.daily_solar"),"no"===mn||"no"===ne.show_solar||"false"===bn?"transparent":"".concat(wn),"no"===ne.show_solar?"none":"",wn,(null===(vt=null==ne?void 0:ne.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(ne.solar.pv1_name):"PV1","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,(null===(_t=null==ne?void 0:ne.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(ne.solar.pv2_name):"PV2","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,(null===(yt=null==ne?void 0:ne.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(ne.solar.pv3_name):"PV3","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,(null===(gt=null==ne?void 0:ne.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(ne.solar.pv4_name):"PV4","no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,os,"no"===Pn?"none":"","energy"===Pn?"st4 st8 left-align":"st12",En,ls,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,hs,"no"===Pn?"none":"","power"===Pn?"st4 st8 left-align":"st12",En,ds,"no"===Pn?"none":"",En,"no"===Pn?"none":"",En,mt("common.ratio"),1===un&&"yes"===ne.show_solar?"":"none",Je,(null===(xt=null==ne?void 0:ne.load)||void 0===xt?void 0:xt.load1_name)?"".concat(ne.load.load1_name):"",1===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===un&&"yes"===ne.show_solar?"":"none",Je,(null===(wt=null==ne?void 0:ne.load)||void 0===wt?void 0:wt.load1_name)?"".concat(ne.load.load1_name):"",2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===un&&"yes"===ne.show_solar?"":"none",Je,(null===(Gt=null==ne?void 0:ne.load)||void 0===Gt?void 0:Gt.load2_name)?"".concat(ne.load.load2_name):"",2===un&&"yes"===ne.show_solar?"":"none","no"===Zn?"st14":"st4",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),es,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(wn),ps,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",wn,"no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(wn),ps,gn,Cn<0||0===Cn?"transparent":"".concat(gn),cs,Cn>0||0===Cn?"transparent":"".concat(gn),cs,"no"===ne.show_solar?"st12":"",wn,"no"===ne.show_solar?"st12":"",0===Rn?"transparent":"".concat(wn),ps,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,sn,Xe<0||0===Xe?"transparent":"".concat(sn),ys,Xe>0||0===Xe?"transparent":"".concat(sn),ys,Je,0===Dn?"transparent":"".concat(Je),vs,Je,0===Dn?"transparent":"".concat(Je),vs,1===un&&"yes"===ne.show_solar?"":"st12",Je,2===un&&"yes"===ne.show_solar?"":"st12",Je,2===un&&"yes"===ne.show_solar?"":"st12",Je,"oven"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"oven"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"pump"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"pump"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"aircon"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"aircon"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"boiler"!==An||1!==un&&2!==un?"0":"1","no"===un||"no"===ne.show_solar?"none":"",Je,"boiler"===Hn&&2===un?"1":"0","no"===un||"no"===ne.show_solar?"none":"",Je,"no"===un||"no"===ne.show_solar?"none":"",An,"no"===un||1===un||"no"===ne.show_solar?"none":"",Hn,"no"===ne.show_solar?"st12":"",wn,parseInt(_e.state)>=Fn?1:0,gn,parseInt(_e.state)>=50&&parseInt(_e.state)Sn&&parseInt(_e.state)<=49?1:0,gn,parseInt(_e.state)<=Sn?1:0,gn,(t=>this.handlePopup(t,ne.entities.grid_connected_status_194)),"off"===an||"0"===an?"st12":"",sn,"on"===an||"1"===an?"st12":"",on,Je,En,(t=>this.handlePopup(t,ne.entities.use_timer_248)),"on"==be.state&&"no"!==Vn?"":"none",En,"off"==be.state&&"no"!==Vn?"":"none",En,"off"==be.state&&"no"!==Vn?"":"none",En,"on"==be.state&&"no"!==Vn?"":"none",En,(t=>this.handlePopup(t,ne.entities.priority_load_243)),"off"===He.state&&"no"!==In?"":"none",En,"on"===He.state&&"no"!==In?"":"none",En,"off"===He.state&&"no"!==In?"":"none",En,"on"===He.state&&"no"!==In?"":"none",En,(t=>this.handlePopup(t,ne.entities.solar_sell_247)),ne.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,ne.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&"no"!==ne.show_solar?"":"none",wn,"no"===Ke?"":"st12",(t=>this.handlePopup(t,Wn.entityID)),"no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"st12":"",En,"no"===Wn.show||"none"===ne.entities.use_timer_248?"none":"","none"===Wn.charge?"":"st12",En,(t=>this.handlePopup(t,ne.entities.day_battery_charge_70)),"no"===xn?"none":"",gn,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"!=bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_pv_energy_108)),"no"===mn||"no"===ne.show_solar||"false"===bn?"none":"",wn,parseFloat(ae.state).toFixed(1)||0,bn,(t=>this.handlePopup(t,ne.entities.day_battery_discharge_71)),"no"===xn?"none":"",gn,parseFloat(se.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_load_energy_84)),2===un?"365":"400.4",2===un?"168":"267.9","no"===nn?"none":"",Je,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_import_76)),"no"===_n?"none":"",sn,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.day_grid_export_77)),"no"===yn?"none":"",sn,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,ne.entities.inverter_voltage_154)),"none"!==ne.entities.inverter_voltage_154&&ne.entities.inverter_voltage_154?"":"none",En,dn,(t=>this.handlePopup(t,ne.entities.load_frequency_192)),"none"!==ne.entities.load_frequency_192&&ne.entities.load_frequency_192?"":"none",En,hn,(t=>this.handlePopup(t,ne.entities.inverter_current_164)),"none"!==ne.entities.inverter_current_164&&ne.entities.inverter_current_164?"":"none",En,pn,(t=>this.handlePopup(t,ne.entities.battery_voltage_183)),"none"!==ne.entities.battery_voltage_183&&ne.entities.battery_voltage_183?"":"none",gn,"no"===Zn?"st14":"st4",cn,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),"none"===ne.entities.battery_soc_184?"none":"",gn,parseInt(_e.state)||0,(t=>this.handlePopup(t,ne.entities.battery_soc_184)),gn,"no"===Wn.show||"none"===ne.entities.battery_soc_184?"none":"",Wn.capacity||0,(t=>this.handlePopup(t,ne.entities.battery_power_190)),"none"===ne.entities.battery_power_190?"none":"",gn,"no"===Zn?"st14":"st4",Cn<0?-1*Cn:Cn,(t=>this.handlePopup(t,ne.entities.battery_current_191)),"none"===ne.entities.battery_current_191?"none":"",gn,"no"===Zn?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,ne.entities.grid_ct_power_172)),"none"===ne.entities.grid_ct_power_172?"none":"","no"===Zn?"st14":"st4",sn,Xe||0,(t=>this.handlePopup(t,ne.entities.pv1_voltage_109)),"no"!==ne.show_solar&&ne.entities.pv1_voltage_109&&"none"!==ne.entities.pv1_voltage_109?"":"none",wn,we.state||0,(t=>this.handlePopup(t,ne.entities.pv1_current_110)),"no"!==ne.show_solar&&ne.entities.pv1_current_110&&"none"!==ne.entities.pv1_current_110?"":"none",wn,me.state||0,(t=>this.handlePopup(t,ne.entities.pv2_voltage_111)),"no"!==ne.show_solar&&ne.entities.pv2_voltage_111&&"none"!==ne.entities.pv2_voltage_111&&1!==ne.solar.mppts?"":"none",wn,fe.state||0,(t=>this.handlePopup(t,ne.entities.pv2_current_112)),"no"!==ne.show_solar&&ne.entities.pv2_current_112&&"none"!==ne.entities.pv2_current_112&&1!==ne.solar.mppts?"":"none",wn,ue.state||0,(t=>this.handlePopup(t,ne.entities.pv3_voltage_113)),"no"!==ne.show_solar&&ne.entities.pv3_voltage_113&&"none"!==ne.entities.pv3_voltage_113&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Ze.state||0,(t=>this.handlePopup(t,ne.entities.pv3_current_114)),"no"!==ne.show_solar&&ne.entities.pv3_current_114&&"none"!==ne.entities.pv3_current_114&&1!==ne.solar.mppts&&2!==ne.solar.mppts?"":"none",wn,Le.state||0,(t=>this.handlePopup(t,ne.entities.pv4_voltage_115)),"no"!==ne.show_solar&&ne.entities.pv4_voltage_115&&"none"!==ne.entities.pv4_voltage_115&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Ee.state||0,(t=>this.handlePopup(t,ne.entities.pv4_current_116)),"no"!==ne.show_solar&&ne.entities.pv4_current_116&&"none"!==ne.entities.pv4_current_116&&1!==ne.solar.mppts&&2!==ne.solar.mppts&&3!==ne.solar.mppts?"":"none",wn,Pe.state||0,(t=>this.handlePopup(t,ne.entities.battery_temp_182)),"none"===ne.entities.battery_temp_182?"st12":"st3 left-align",gn,(null===(Xt=null==ne?void 0:ne.entities)||void 0===Xt?void 0:Xt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,ne.entities.radiator_temp_91)),"none"===ne.entities.radiator_temp_91?"st12":"st3 left-align",En,(null===(Kt=null==ne?void 0:ne.entities)||void 0===Kt?void 0:Kt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,ne.entities.dc_transformer_temp_90)),"none"===ne.entities.dc_transformer_temp_90?"st12":"st3 left-align",En,(null===(Jt=null==ne?void 0:ne.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,ne.entities.energy_cost)),"none"===ne.entities.energy_cost?"st12":"st3 left-align",sn,(null===(te=null==ne?void 0:ne.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=null==ne?void 0:ne.entities)||void 0===ee?void 0:ee.pv_total)?D(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv_total)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0):D(Rt||(Rt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,Nn||0),"none"!==ne.entities.pv1_power_186?D(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv1_power_186)),"no"===Zn?"st14":"st4","no"===ne.show_solar?"none":"",wn,parseFloat(ce.state).toFixed(0)||0):D(Dt||(Dt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv1_power_186?"none":"",wn,parseFloat(ce.state).toFixed(0)||0),"none"!==ne.entities.pv2_power_187?D($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv2_power_187)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0):D(Yt||(Yt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv2_power_187||1===ne.solar.mppts?"none":"",wn,parseFloat(pe.state).toFixed(0)||0),"none"!==ne.entities.pv3_power_188?D(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv3_power_188)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0):D(zt||(zt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv3_power_188||1===ne.solar.mppts||2===ne.solar.mppts?"none":"",wn,parseFloat(Ve.state).toFixed(0)||0),"none"!==ne.entities.pv4_power_189?D(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.pv4_power_189)),"no"===Zn?"st14":"st4","no"===ne.show_solar||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0):D(Qt||(Qt=e([''," W"])),"no"===Zn?"st14":"st4","no"===ne.show_solar||"none"===ne.entities.pv4_power_189||1===ne.solar.mppts||2===ne.solar.mppts||3===ne.solar.mppts?"none":"",wn,parseFloat(Ie.state).toFixed(0)||0),"none"!==ne.entities.essential_power?D(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,ne.entities.essential_power)),"no"===Zn?"st14":"st4",Je,Dn||0):D(Wt||(Wt=e([''," W"])),"no"===Zn?"st14":"st4",Je,Dn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!("yes"!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if("yes"===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if("yes"===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&"yes"===t.show_solar&&"yes"===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&"yes"===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&"yes"===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const n of e)if(!t.entities[n])throw new Error("Please include the ".concat(n," attribute and entity ID e.g. ").concat(n,": sensor.example"));const n=["pv1_power_186"];for(const e of n)if("yes"===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),s)}handlePopup(t,e){t.stopPropagation();const n=e;this._handleClick(this,{action:"more-info"},n)}_handleClick(t,e,n){let s;if("more-info"===e.action)s=new Event("hass-more-info",{composed:!0}),s.detail={entityId:n},t.dispatchEvent(s)}getCardSize(){return 2}},n([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),n([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=n([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); + */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new o(s,t,l)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function mt(t,e="",s=""){const i=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let n;try{n=t.split(".").reduce(((t,e)=>t[e]),wt[i])}catch(e){n=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===n&&(n=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==s&&(n=n.replace(e,s)),n}var ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Nt,Dt,$t,Yt,Ut,zt,Ot,Qt,jt,Wt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(mt("common.version"),": ").concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends ot{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{show_daily:!0,mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,s,i,n,l,a,o,r,h,d,p,c,v,_,y,g,x,w,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,st,it,nt,lt,at,ot,rt,ht,dt,pt,ct,vt,_t,yt,gt,xt,wt,Gt,Xt,Kt,Jt,te,ee;const se=this._config,ie=this.hass.states[se.entities.day_battery_discharge_71]||{state:"0"},ne=this.hass.states[se.entities.day_battery_charge_70]||{state:"0"},le=this.hass.states[se.entities.day_load_energy_84]||{state:"0"},ae=this.hass.states[se.entities.day_grid_import_76]||{state:"0"},oe=this.hass.states[se.entities.day_pv_energy_108]||{state:"0"},re=this.hass.states[se.entities.inverter_voltage_154]||{state:"0"},he=this.hass.states[se.entities.load_frequency_192]||{state:"0"},de=this.hass.states[se.entities.inverter_current_164]||{state:"0"},pe=this.hass.states[se.entities.pv2_power_187]||{state:"0"},ce=this.hass.states[se.entities.pv1_power_186]||{state:"0"},ve=this.hass.states[se.entities.battery_voltage_183]||{state:"0"},_e=this.hass.states[se.entities.battery_soc_184]||{state:"0"},ye=this.hass.states[se.entities.battery_power_190]||{state:"0"},ge=this.hass.states[se.entities.essential_power]||{state:"0"},xe=this.hass.states[se.entities.grid_ct_power_172]||{state:"0"},we=this.hass.states[se.entities.pv1_voltage_109]||{state:"0"},me=this.hass.states[se.entities.pv1_current_110]||{state:"0"},fe=this.hass.states[se.entities.pv2_voltage_111]||{state:"0"},ue=this.hass.states[se.entities.pv2_current_112]||{state:"0"},qe=this.hass.states[se.entities.grid_connected_status_194]||{state:"on"},Te=this.hass.states[se.entities.inverter_status_59]||{state:""},ke=this.hass.states[se.entities.inverter_power_175]||{state:"0"},Me=this.hass.states[se.entities.grid_power_169]||{state:"0"},Ae=this.hass.states[se.entities.aux_power_166]||{state:"0"},He=this.hass.states[se.entities.priority_load_243]||{state:"undefined"},be=this.hass.states[se.entities.use_timer_248]||{state:"undefined"},Ze=this.hass.states[se.entities.pv3_voltage_113]||{state:"0"},Le=this.hass.states[se.entities.pv3_current_114]||{state:"0"},Ee=this.hass.states[se.entities.pv4_voltage_115]||{state:"0"},Pe=this.hass.states[se.entities.pv4_current_116]||{state:"0"},Ve=this.hass.states[se.entities.pv3_power_188]||{state:"0"},Ie=this.hass.states[se.entities.pv4_power_189]||{state:"0"},Ce=this.hass.states[se.entities.day_grid_export_77]||{state:"0"},Be=this.hass.states[se.entities.nonessential_power]||{state:"0"},Fe=this.hass.states[se.entities.battery_current_191]||{state:"0"},Se=this.hass.states[se.entities.remaining_solar]||{state:"0"},Re=this.hass.states[se.entities.battery_temp_182]||{state:""},Ne=this.hass.states[se.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[se.entities.radiator_temp_91]||{state:""},$e=this.hass.states[se.entities.non_essential_load1]||{state:"0"},Ye=this.hass.states[se.entities.non_essential_load2]||{state:"0"},Ue=this.hass.states[se.entities.essential_load1]||{state:"0"},ze=this.hass.states[se.entities.energy_cost]||{state:""},Oe=this.hass.states[se.entities.solar_sell_247]||{state:"undefined"},Qe=this.hass.states[se.entities.essential_load2]||{state:"0"},je=this.hass.states[se.entities.pv_total]||{state:"0"},We=this.hass.states[se.entities.aux_connected_status]||{state:"on"};let Ge=!0===((null===(t=null==se?void 0:se.load)||void 0===t?void 0:t.invert_aux)||!1)?-1*parseInt(Ae.state):parseInt(Ae.state),Xe=!0===((null===(s=null==se?void 0:se.grid)||void 0===s?void 0:s.invert_grid)||!1)?-1*parseInt(xe.state):parseInt(xe.state),Ke=(null===(i=null==se?void 0:se.inverter)||void 0===i?void 0:i.modern)||!0,Je=(null===(n=null==se?void 0:se.load)||void 0===n?void 0:n.colour)||"#5fb6ad",ts=(null===(l=null==se?void 0:se.load)||void 0===l?void 0:l.aux_colour)||Je,es=(null===(a=null==se?void 0:se.load)||void 0===a?void 0:a.aux_off_colour)||Je,ss=(null===(o=null==se?void 0:se.load)||void 0===o?void 0:o.show_daily)||!1,is=(null===(r=null==se?void 0:se.grid)||void 0===r?void 0:r.colour)||"#5490c2",ns=(null===(h=null==se?void 0:se.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",ls=(null===(d=null==se?void 0:se.grid)||void 0===d?void 0:d.show_nonessential)||!0,as=(null===(p=null==se?void 0:se.entities)||void 0===p?void 0:p.grid_connected_status_194)?qe.state:"on",os=(null===(c=null==se?void 0:se.entities)||void 0===c?void 0:c.aux_connected_status)?We.state:"on",rs=(null===(v=null==se?void 0:se.entities)||void 0===v?void 0:v.load_frequency_192)?he.state:0,hs=(null===(_=null==se?void 0:se.entities)||void 0===_?void 0:_.inverter_voltage_154)?re.state:0,ds=(null===(y=null==se?void 0:se.entities)||void 0===y?void 0:y.inverter_current_164)?de.state:0,ps=(null===(g=null==se?void 0:se.entities)||void 0===g?void 0:g.battery_voltage_183)?ve.state:0,cs=null===(x=null==se?void 0:se.grid)||void 0===x?void 0:x.additional_loads;!1!==cs&&1!==cs&&2!==cs&&(cs=!1);let vs=(null===(w=null==se?void 0:se.grid)||void 0===w?void 0:w.show_daily_buy)||!1,_s=(null===(m=null==se?void 0:se.grid)||void 0===m?void 0:m.show_daily_sell)||!1,ys=(null===(f=null==se?void 0:se.battery)||void 0===f?void 0:f.colour)||"pink",gs=(null===(u=null==se?void 0:se.battery)||void 0===u?void 0:u.show_daily)||!1,xs=(null===(q=null==se?void 0:se.solar)||void 0===q?void 0:q.colour)||"orange",ws=(null===(T=null==se?void 0:se.solar)||void 0===T?void 0:T.show_daily)||!1,ms=null===(k=null==se?void 0:se.load)||void 0===k?void 0:k.show_aux;!1!==ms&&!0!==ms&&(ms=!1);let fs=null===(M=null==se?void 0:se.load)||void 0===M?void 0:M.additional_loads;!1!==fs&&1!==fs&&2!==fs&&(fs=!1);let us=(null===(A=null==se?void 0:se.load)||void 0===A?void 0:A.aux_type)||"default",qs=(null===(H=null==se?void 0:se.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Ts=(null===(b=null==se?void 0:se.grid)||void 0===b?void 0:b.load1_icon)||"default",ks=(null===(Z=null==se?void 0:se.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Ms=(null===(L=null==se?void 0:se.load)||void 0===L?void 0:L.load1_icon)||"default",As=(null===(E=null==se?void 0:se.load)||void 0===E?void 0:E.load2_icon)||"default",Hs=se.entities.remaining_solar?parseFloat(Se.state).toFixed(1):"false",bs=(null==se?void 0:se.large_font)||!1,Zs=(null==se?void 0:se.panel_mode)||!1,Ls=(null===(P=null==se?void 0:se.inverter)||void 0===P?void 0:P.colour)||"grey",Es=(null===(V=null==se?void 0:se.inverter)||void 0===V?void 0:V.autarky)||"power",Ps=!(!1===(null==se?void 0:se.entities.use_timer_248)||!(null==se?void 0:se.entities.use_timer_248))&&be.state,Vs=!(!1===(null==se?void 0:se.entities.priority_load_243)||!(null==se?void 0:se.entities.priority_load_243))&&He.state,Is=!0===(null===(I=null==se?void 0:se.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(ye.state):parseInt(ye.state),Cs=(null==se?void 0:se.card_height)||"396px",Bs=(null===(C=null==se?void 0:se.battery)||void 0===C?void 0:C.full_capacity)||80,Fs=(null===(B=null==se?void 0:se.battery)||void 0===B?void 0:B.empty_capacity)||30,Ss=parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(ce.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0))+parseInt(parseFloat(Ie.state||"0").toFixed(0)),Rs=(null===(F=null==se?void 0:se.entities)||void 0===F?void 0:F.pv_total)?parseInt(je.state):Ss,Ns="none"!==(null==se?void 0:se.entities.essential_power)&&(null==se?void 0:se.entities.essential_power)?parseInt(ge.state):parseInt(ke.state)+parseInt(Me.state)-parseInt(Ae.state),Ds="none"!==(null==se?void 0:se.entities.nonessential_power)&&(null==se?void 0:se.entities.nonessential_power)?parseInt(Be.state):parseInt(xe.state)-parseInt(Me.state);const $s={time:this.hass.states[se.entities.prog1_time]||{state:""},capacity:this.hass.states[se.entities.prog1_capacity]||{state:""},charge:this.hass.states[se.entities.prog1_charge]||{state:""}},Ys={time:this.hass.states[se.entities.prog2_time]||{state:""},capacity:this.hass.states[se.entities.prog2_capacity]||{state:""},charge:this.hass.states[se.entities.prog2_charge]||{state:""}},Us={time:this.hass.states[se.entities.prog3_time]||{state:""},capacity:this.hass.states[se.entities.prog3_capacity]||{state:""},charge:this.hass.states[se.entities.prog3_charge]||{state:""}},zs={time:this.hass.states[se.entities.prog4_time]||{state:""},capacity:this.hass.states[se.entities.prog4_capacity]||{state:""},charge:this.hass.states[se.entities.prog4_charge]||{state:""}},Os={time:this.hass.states[se.entities.prog5_time]||{state:""},capacity:this.hass.states[se.entities.prog5_capacity]||{state:""},charge:this.hass.states[se.entities.prog5_charge]||{state:""}},Qs={time:this.hass.states[se.entities.prog6_time]||{state:""},capacity:this.hass.states[se.entities.prog6_capacity]||{state:""},charge:this.hass.states[se.entities.prog6_charge]||{state:""}};let js={capacity:se.battery.shutdown_soc,entityID:""};if(se.entities.use_timer_248&&!1!==se.entities.use_timer_248&&"off"!==be.state)if(se.entities.prog1_time&&se.entities.prog2_time&&se.entities.prog3_time&&se.entities.prog4_time&&se.entities.prog5_time&&se.entities.prog6_time){js.show=!0;const gi=new Date,xi=[];[$s,Ys,Us,zs,Os,Qs].forEach(((t,e)=>{const[s,i]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));xi[e]=new Date(gi.getTime()),xi[e].setHours(s),xi[e].setMinutes(i)}));const[wi,mi,fi,ui,qi,Ti]=xi;function ki(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?js.charge="none":js.charge="both",js.capacity=parseInt(t.capacity.state),js.entityID=e}gi>=Ti||gi=wi&&gi=mi&&gi=fi&&gi=ui&&gi=qi&&gi0?Ws="off"===qe.state||!1===js.show||parseInt(_e.state)<=js.capacity?se.battery.shutdown_soc:js.capacity:Is<0&&("off"===qe.state||!1===js.show||parseInt(_e.state)>=js.capacity?Ws=100:parseInt(_e.state)0?Gs=(parseInt(_e.state)-Ws)/100*se.battery.energy/Is*60*60:Is<0&&(Gs=(Ws-parseInt(_e.state))/100*se.battery.energy/Is*60*60*-1);const Mi=new Date,Ai=1e3*Gs,Hi=new Date(Mi.getTime()+Ai),bi=Hi.getHours(),Zi=Hi.getMinutes().toString().padStart(2,"0"),Li=bi.toString().padStart(2,"0");Xs="".concat(Li,":").concat(Zi);const Ei=Math.floor(Gs/86400),Pi=Math.floor(Gs%86400/3600),Vi=Math.floor(Gs%3600/60);Ei>0&&(Ks+="".concat(Ei," days, ")),(Pi>0||Ei>0)&&(Ks+="".concat(Pi," hrs, ")),Ks+="".concat(Vi," min")}let Js=-2<=parseInt(Fe.state)&&parseInt(Fe.state)<=2&&parseInt(_e.state)>=99?"True":"False",ti="",ei="";switch(Te.state){case"0":case"standby":ti="blue",ei="Standby";break;case"1":case"selftest":ti="yellow",ei="Selftest";break;case"2":case"normal":case"ok":ti="green",ei="Normal";break;case"3":case"alarm":ti="orange",ei="Alarm";break;case"4":case"fault":ti="red",ei="Fault";break;default:"none"!==(null===(S=null==se?void 0:se.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==se?void 0:se.entities)||void 0===R?void 0:R.inverter_status_59)?(ti="transparent",ei="Status"):(ti="transparent",ei="")}let si=(isNaN(parseFloat(oe.state))?0:parseFloat(oe.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),ii=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ni=0!=ii?Math.min(Math.round(100*si/ii),100):0,li=0!=si?Math.min(Math.round(100*ii/si),100):0,ai=Ss+parseInt("".concat(Is>0?Is:0))+parseInt("".concat(Ge<0?-1*Ge:0)),oi=Ns+Ds+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Is<0?-1*Is:0)),ri=0!=oi?Math.min(Math.round(100*ai/oi),100):0,hi=0!=ai?Math.min(Math.round(100*oi/ai),100):0,di=(null===($=null==se?void 0:se.solar)||void 0===$?void 0:$.animation_speed)||"9";if(se&&se.solar&&se.solar.animation_speed){let Ii=se.solar.animation_speed-(se.solar.animation_speed-1)*(Ss/(se.solar.max_power||Ss));di="".concat(Ii>=1?Ii:1)}let pi=(null===(Y=null==se?void 0:se.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(se&&se.battery&&se.battery.animation_speed){let Ci=se.battery.animation_speed-(se.battery.animation_speed-1)*((Is<0?-1*Is:Is)/(se.battery.max_power||(Is<0?-1*Is:Is)));pi="".concat(Ci>=1?Ci:1)}let ci=(null===(U=null==se?void 0:se.load)||void 0===U?void 0:U.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Bi=se.load.animation_speed-(se.load.animation_speed-1)*(Ns/(se.load.max_power||Ns));ci="".concat(Bi>=1?Bi:1)}let vi=(null===(z=null==se?void 0:se.load)||void 0===z?void 0:z.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Fi=se.load.animation_speed-(se.load.animation_speed-1)*((parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))/(se.load.max_power||(parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))));vi="".concat(Fi>=1?Fi:1)}let _i=(null===(O=null==se?void 0:se.grid)||void 0===O?void 0:O.animation_speed)||"8";if(se&&se.grid&&se.grid.animation_speed){let Si=se.grid.animation_speed-(se.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(se.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));_i="".concat(Si>=1?Si:1)}let yi=(null===(Q=null==se?void 0:se.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(se&&se.grid&&se.grid.animation_speed){let Ri=se.grid.animation_speed-(se.grid.animation_speed-1)*(Ds/(se.grid.max_power||Ds));yi="".concat(Ri>=1?Ri:1)}return"full"===se.cardstyle?N(ft||(ft=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,ts,es,is,is,!1===Zs?"".concat(Cs):"100%",xs,!1===se.show_solar?"st12":"",ys,is,is,ts,!1===ms?"st12":"",Je,Ls,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",is,!1===ls?"st12":"",1===cs?"":"none",is,!1===ls?"st12":"",2===cs?"":"none",is,!1===ls||1===cs?"st12":"",2===cs?"":"none",is,!1===ls||1===cs?"st12":"",!1===ms?"30":"143",Je,1===fs?"":"none",!1===ms?"376":"373",!1===ms?"30":"143",Je,2===fs?"":"none",!1===ms?"413":"410",!1===ms?"30":"143",Je,2===fs?"":"none",!1===bs?"st14":"st4",0===se.battery.energy||"True"===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||"True"===Js?"transparent":"".concat(ys),mt("common.runtime_to"),Ws,Xs,0===se.battery.energy||Is>=0||"True"===Js?"transparent":"".concat(ys),mt("common.to"),Ws,mt("common.charge"),Xs,0===se.battery.energy||"False"===Js?"transparent":"".concat(ys),mt("common.battery_floating"),!1===se.show_solar?"none":"",xs,(null===(j=null==se?void 0:se.solar)||void 0===j?void 0:j.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(W=null==se?void 0:se.solar)||void 0===W?void 0:W.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(G=null==se?void 0:se.solar)||void 0===G?void 0:G.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(X=null==se?void 0:se.solar)||void 0===X?void 0:X.pv4_name)?"".concat(se.solar.pv4_name):"PV4",is,Ls,ei,1!==fs&&2!==fs||!0!==ms?"":"none",Je,!1===fs||!1===ms?"none":"",Je,!1===ms?"70":"181",1===fs?"":"none",Je,(null===(K=null==se?void 0:se.load)||void 0===K?void 0:K.load1_name)?"".concat(se.load.load1_name):"",!1===ms?"47":"158",1===fs?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),!1===ms?"393":"390",!1===ms?"59":"172",2===fs?"":"none",Je,(null===(J=null==se?void 0:se.load)||void 0===J?void 0:J.load1_name)?"".concat(se.load.load1_name):"",!1===ms?"394":"391",!1===ms?"42":"154",2===fs?"":"none",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),!1===ms?"429":"426",!1===ms?"59":"172",2===fs?"":"none",Je,(null===(tt=null==se?void 0:se.load)||void 0===tt?void 0:tt.load2_name)?"".concat(se.load.load2_name):"",!1===ms?"430":"427",!1===ms?"42":"154",2===fs?"":"none",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),!1===ss||!1===ms?"transparent":"".concat(Je),mt("common.daily_load"),!1===fs?"83%":"67%",!1===fs?"18.5%":"24.25%",!1===ss||!0===ms?"transparent":"".concat(Je),mt("common.daily_load"),!1===ws||!1===se.show_solar||"false"!=Hs?"transparent":"".concat(xs),mt("common.daily_solar"),!1===ws||!1===se.show_solar||"false"===Hs?"transparent":"".concat(xs),!1===gs?"transparent":"".concat(ys),mt("common.daily_charge"),!1===gs?"transparent":"".concat(ys),mt("common.daily_discharge"),!1===ls?"68%":"76%",!1===ls?"96%":"66%",!1===vs?"transparent":"".concat(is),mt("common.daily_grid_buy"),!1===ls?"68%":"76%",!1===ls?"88%":"58%",!1===_s?"transparent":"".concat(is),mt("common.daily_grid_sell"),!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),(null===(et=null==se?void 0:se.load)||void 0===et?void 0:et.aux_name)?"".concat(se.load.aux_name):"Auxiliary",!1===ls?"none":"",is,(null===(st=null==se?void 0:se.grid)||void 0===st?void 0:st.nonessential_name)?"".concat(se.grid.nonessential_name):"Non Essential",!1===ls||!1===cs||2===cs?"none":"",is,(null===(it=null==se?void 0:se.grid)||void 0===it?void 0:it.load1_name)?"".concat(se.grid.load1_name):"",!1===ls||!1===cs||1===cs?"none":"",is,(null===(nt=null==se?void 0:se.grid)||void 0===nt?void 0:nt.load1_name)?"".concat(se.grid.load1_name):"",!1===ls||!1===cs||1===cs?"none":"",is,(null===(lt=null==se?void 0:se.grid)||void 0===lt?void 0:lt.load2_name)?"".concat(se.grid.load2_name):"",!1===ls||!1===cs||2===cs?"none":"",is,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===ls||!1===cs||1===cs?"none":"",is,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===ls||!1===cs||1===cs?"none":"",is,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,ni,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,li,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,ri,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hi,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,mt("common.ratio"),ti,!0===ms?"":"none",1===fs||2===fs?"":"st12",Je,!1===ms?"":"none",1===fs?"":"st12",Je,!1===ms?"":"none",2===fs?"":"st12",Je,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Ss?"transparent":"".concat(xs),di,ys,Is<0||0===Is?"transparent":"".concat(ys),pi,Is>0||0===Is?"transparent":"".concat(ys),pi,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,is,Xe<0||0===Xe?"transparent":"".concat(is),_i/2,Xe>0||0===Xe?"transparent":"".concat(is),_i/2,is,!1===ls?"st12":"",!1===ls?"st12":"",Ds<=0?"transparent":"".concat(is),yi/2,is,!1===ls?"st12":"",!1===ls?"st12":"",Ds<=0?"transparent":"".concat(is),yi,!1===ms?"st12":"",ts,!1===ms||0===Ge?"st12":"",Ge<0?"transparent":"".concat(ts),vi,!1===ms||0===Ge?"st12":"",Ge>0?"transparent":"".concat(ts),vi,!1===ms?"st12":"",ts,is,Ls,Je,0===Ns?"transparent":"".concat(Je),ci,Je,Ls,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Fs&&parseInt(_e.state)<=49?"1":"0",ys,parseInt(_e.state)<=Fs?1:0,ys,!1===se.show_solar?"st12":"",xs,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===as||"0"===as?"st12":"",is,"on"===as||"1"===as?"st12":"",ns,"default"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"oven"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"boiler"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"pump"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"aircon"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,!1===ls||2===cs||1===cs?"none":"",qs,"default"===Ts&&"default"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"default"===Ts&&"default"!=ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"default"!=Ts&&"default"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"boiler"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"boiler"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"pump"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"pump"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"oven"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"oven"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"aircon"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"aircon"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,!1===ls||!1===cs||1===cs?"none":"",Ts,!1===ls||!1===cs||1===cs?"none":"",ks,"default"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"boiler"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"pump"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"oven"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"aircon"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,!1===ls||!1===cs||2===cs?"none":"",Ts,1!==fs&&2!==fs||!1!==ms?"none":"",Je,1!==fs&&2!==fs||!0!==ms?"none":"",Je,1===fs||2===fs?"none":"",Je,(t=>this.handlePopup(t,se.entities.aux_connected_status)),"default"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"gen"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"inverter"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"oven"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"boiler"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"aircon"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"pump"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),!1===ms?"none":"",us,"on"===os||"1"===os?"aux-icon":"aux-off-icon","boiler"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"boiler"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"boiler"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"boiler"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"boiler"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"boiler"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"aircon"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"aircon"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"aircon"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"aircon"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"aircon"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"aircon"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"pump"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"pump"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"pump"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"pump"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"pump"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"pump"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"oven"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"oven"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"oven"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"oven"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"oven"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"oven"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,!1===fs||1===fs?"none":"",!0===ms?"350":"383",!0===ms?"140":"5",Ms,!1===fs||1===fs?"none":"",!0===ms?"446":"420",!0===ms?"140":"5",As,!1===fs||2===fs?"none":"","336",!0===ms?"140":"27",Ms,(t=>this.handlePopup(t,se.entities.use_timer_248)),0!=Es?"60.5%":"65%","on"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"60.5%":"65%","off"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","on"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","off"==be.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&!1!==se.show_solar?"":"none",xs,(t=>this.handlePopup(t,se.entities.priority_load_243)),0!=Es?"65.5%":"70%","off"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"65.5%":"70%","on"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","on"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","off"===He.state&&!1!==Vs?"":"none",Ls,!1===Ke?"":"st12",(t=>this.handlePopup(t,js.entityID)),0!=Es?"60.5%":"65%",!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"st12":"",Ls,0!=Es?"60.5%":"65%",!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"!=Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"===Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,Hs,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===ss||!1===ms?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===fs?"83%":"67%",!1===fs?"15%":"21%",!1===ss||!0===ms?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===ls?"68%":"76%",!1===ls?"92.5%":"62.5%",!1===vs?"none":"",is,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===ls?"68%":"76%",!1===ls?"84.25%":"54.5%",!1===_s?"none":"",is,parseFloat(Ce.state).toFixed(1)||0,(null===(at=null==se?void 0:se.entities)||void 0===at?void 0:at.pv_total)?D(ut||(ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):D(qt||(qt=e([' '," W "])),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.essential_power?D(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===bs?"st14":"st4",Je,Ns||"0"):D(kt||(kt=e([''," W"])),!1===bs?"st14":"st4",Je,Ns||0),"none"!==se.entities.nonessential_power?D(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.nonessential_power)),!1===ls?"none":"",!1===bs?"st14":"st4",is,Ds||0):D(At||(At=e([''," W "])),!1===ls?"none":"",!1===bs?"st14":"st4",is,Ds||0),(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",is,Xe||0,"none"!==se.entities.aux_power_166?D(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.aux_power_166)),!1===bs?"st14":"st4",!1===ms?"none":"",ts,Ge<0?-1*Ge:Ge):D(bt||(bt=e([''," W "])),!1===bs?"st14":"st4",!1===ms?"none":"",ts,Ge<0?-1*Ge:Ge),"none"!==se.entities.pv1_power_186?D(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):D(Lt||(Lt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?D(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):D(Pt||(Pt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?D(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):D(It||(It=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?D(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):D(Bt||(Bt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",is,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",is,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===bs?"st14":"st4",ps,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===js.show||"none"===se.entities.battery_soc_184?"none":"",js.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===bs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===bs?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,se.entities.inverter_power_175)),"none"===se.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Ls,ke.state||0,(t=>this.handlePopup(t,se.entities.grid_power_169)),"none"===se.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",is,Me.state||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(ot=null==se?void 0:se.entities)||void 0===ot?void 0:ot.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),4===(null===(rt=null==se?void 0:se.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=null==se?void 0:se.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(dt=null==se?void 0:se.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(pt=null==se?void 0:se.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",is,(null===(ct=null==se?void 0:se.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",ze.state||""):"lite"===se.cardstyle?N(Ft||(Ft=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,!1===se.show_solar?145.33:-.5,!1===se.show_solar?270.67:406,"".concat(!1===Zs?!1===se.show_solar?"246px":"".concat(Cs):!1===se.show_solar?"75%":"100%"),Je,xs,!1===se.show_solar?"st12":"",ys,is,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",Je,1===fs&&!0===se.show_solar?"":"none",Je,2===fs&&!0===se.show_solar?"":"none",Je,2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",0===se.battery.energy||"True"===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||"True"===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||Is>=0||"True"===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||"False"===Js?"transparent":"".concat(ys),mt("common.battery_floating"),!1===gs?"transparent":"".concat(ys),!1===gs?"transparent":"".concat(ys),2===fs?"365":"400.4",2===fs?"182.2":"282.1",!1===ss?"transparent":"".concat(Je),mt("common.daily_load"),!1===vs?"transparent":"".concat(is),mt("common.daily_grid_buy"),!1===_s?"transparent":"".concat(is),mt("common.daily_grid_sell"),!1===ws||!1===se.show_solar||"false"!=Hs?"transparent":"".concat(xs),mt("common.daily_solar"),!1===ws||!1===se.show_solar||"false"===Hs?"transparent":"".concat(xs),!1===se.show_solar?"none":"",xs,(null===(vt=null==se?void 0:se.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(_t=null==se?void 0:se.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(yt=null==se?void 0:se.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(gt=null==se?void 0:se.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(se.solar.pv4_name):"PV4",!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,ni,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,li,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,ri,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hi,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,mt("common.ratio"),1===fs&&!0===se.show_solar?"":"none",Je,(null===(xt=null==se?void 0:se.load)||void 0===xt?void 0:xt.load1_name)?"".concat(se.load.load1_name):"",1===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===fs&&!0===se.show_solar?"":"none",Je,(null===(wt=null==se?void 0:se.load)||void 0===wt?void 0:wt.load1_name)?"".concat(se.load.load1_name):"",2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===fs&&!0===se.show_solar?"":"none",Je,(null===(Gt=null==se?void 0:se.load)||void 0===Gt?void 0:Gt.load2_name)?"".concat(se.load.load2_name):"",2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),ti,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),di,ys,Is<0||0===Is?"transparent":"".concat(ys),pi,Is>0||0===Is?"transparent":"".concat(ys),pi,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Ss?"transparent":"".concat(xs),di,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,Je,0===Ns?"transparent":"".concat(Je),ci,Je,0===Ns?"transparent":"".concat(Je),ci,1===fs&&!0===se.show_solar?"":"st12",Je,2===fs&&!0===se.show_solar?"":"st12",Je,2===fs&&!0===se.show_solar?"":"st12",Je,"oven"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"oven"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"pump"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"pump"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"aircon"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"aircon"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"boiler"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"boiler"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,!1===fs||!1===se.show_solar?"none":"",Ms,!1===fs||1===fs||!1===se.show_solar?"none":"",As,!1===se.show_solar?"st12":"",xs,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Fs&&parseInt(_e.state)<=49?1:0,ys,parseInt(_e.state)<=Fs?1:0,ys,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===as||"0"===as?"st12":"",is,"on"===as||"1"===as?"st12":"",ns,Je,Ls,(t=>this.handlePopup(t,se.entities.use_timer_248)),"on"==be.state&&!1!==Ps?"":"none",Ls,"off"==be.state&&!1!==Ps?"":"none",Ls,"off"==be.state&&!1!==Ps?"":"none",Ls,"on"==be.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.priority_load_243)),"off"===He.state&&!1!==Vs?"":"none",Ls,"on"===He.state&&!1!==Vs?"":"none",Ls,"off"===He.state&&!1!==Vs?"":"none",Ls,"on"===He.state&&!1!==Vs?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&!1!==se.show_solar?"":"none",xs,!1===Ke?"":"st12",(t=>this.handlePopup(t,js.entityID)),!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"st12":"",Ls,!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"!=Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"===Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,Hs,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),2===fs?"365":"400.4",2===fs?"168":"267.9",!1===ss?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===vs?"none":"",is,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===_s?"none":"",is,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",Ls,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",Ls,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===bs?"st14":"st4",ps,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===js.show||"none"===se.entities.battery_soc_184?"none":"",js.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===bs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===bs?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",is,Xe||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(Xt=null==se?void 0:se.entities)||void 0===Xt?void 0:Xt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),"none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(Kt=null==se?void 0:se.entities)||void 0===Kt?void 0:Kt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(Jt=null==se?void 0:se.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",is,(null===(te=null==se?void 0:se.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=null==se?void 0:se.entities)||void 0===ee?void 0:ee.pv_total)?D(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):D(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.pv1_power_186?D(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):D(Dt||(Dt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?D($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):D(Yt||(Yt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?D(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):D(zt||(zt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?D(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):D(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),"none"!==se.entities.essential_power?D(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===bs?"st14":"st4",Je,Ns||0):D(Wt||(Wt=e([''," W"])),!1===bs?"st14":"st4",Je,Ns||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const i=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),i)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let i;if("more-info"===e.action)i=new Event("hass-more-info",{composed:!0}),i.detail={entityId:s},t.dispatchEvent(i)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 86da43e3..246da96d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,23 +27,23 @@ export class SunsynkPowerFlowCard extends LitElement { static getStubConfig() { return { cardstyle: 'lite', - show_solar: 'yes', + show_solar: true, battery: { energy: 0, shutdown_soc: 20, - show_daily: 'yes', + show_daily: true, }, solar: { - show_daily: 'yes', + show_daily: true, mppts: 2, }, load: { - show_daily: 'yes', + show_daily: true, }, grid: { - show_daily_buy: 'yes', - show_daily_sell: 'no', - show_nonessential: 'yes', + show_daily_buy: true, + show_daily_sell: false, + show_nonessential: true, }, entities: { use_timer_248: 'switch.sunsynk_toggle_system_timer', @@ -130,18 +130,18 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; //Set defaults - let invert_aux = config?.load?.invert_aux || 'no'; - let aux_power = (invert_aux === 'yes') ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); - let invert_grid = config?.grid?.invert_grid || 'no'; - let grid_power = (invert_grid === 'yes') ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); - let inverter_modern = config?.inverter?.modern || 'yes'; + let invert_aux = config?.load?.invert_aux || false; + let aux_power = (invert_aux === true) ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); + let invert_grid = config?.grid?.invert_grid || false; + let grid_power = (invert_grid === true) ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); + let inverter_modern = config?.inverter?.modern || true; let load_colour = config?.load?.colour || '#5fb6ad'; let aux_colour = config?.load?.aux_colour || load_colour; let aux_off_colour = config?.load?.aux_off_colour || load_colour; - let load_showdaily = config?.load?.show_daily || 'no'; + let load_showdaily = config?.load?.show_daily || false; let grid_colour = config?.grid?.colour || '#5490c2'; let no_grid_colour = config?.grid?.no_grid_colour || '#a40013'; - let grid_show_noness = config?.grid?.show_nonessential || 'yes'; + let grid_show_noness = config?.grid?.show_nonessential || true; let grid_status = config?.entities?.grid_connected_status_194 ? stateObj20.state : 'on'; let aux_status = config?.entities?.aux_connected_status ? stateObj47.state : 'on'; let load_frequency = config?.entities?.load_frequency_192 ? stateObj6.state : 0; @@ -150,25 +150,25 @@ export class SunsynkPowerFlowCard extends LitElement { let battery_voltage = config?.entities?.battery_voltage_183 ? stateObj11.state : 0; let noness_dual_load = config?.grid?.additional_loads; - if (noness_dual_load !== 'no' && noness_dual_load !== 1 && noness_dual_load !== 2) { - noness_dual_load = 'no'; + if (noness_dual_load !== false && noness_dual_load !== 1 && noness_dual_load !== 2) { + noness_dual_load = false; } - let grid_showdailybuy = config?.grid?.show_daily_buy || 'no'; - let grid_showdailysell = config?.grid?.show_daily_sell || 'no'; + let grid_showdailybuy = config?.grid?.show_daily_buy || false; + let grid_showdailysell = config?.grid?.show_daily_sell || false; let battery_colour = config?.battery?.colour || 'pink'; - let battery_showdaily = config?.battery?.show_daily || 'no'; + let battery_showdaily = config?.battery?.show_daily || false; let solar_colour = config?.solar?.colour || 'orange'; - let solar_showdaily = config?.solar?.show_daily || 'no'; + let solar_showdaily = config?.solar?.show_daily || false; let show_aux = config?.load?.show_aux; - if (show_aux !== 'no' && show_aux !== 'yes') { - show_aux = 'no'; + if (show_aux !== false && show_aux !== true) { + show_aux = false; } let additional_load = config?.load?.additional_loads; - if (additional_load !== 'no' && additional_load !== 1 && additional_load !== 2) { - additional_load = 'no'; + if (additional_load !== false && additional_load !== 1 && additional_load !== 2) { + additional_load = false; } let aux_type = config?.load?.aux_type || 'default'; //valid options are gen,inverter, default, gen, boiler, pump, aircon @@ -178,13 +178,13 @@ export class SunsynkPowerFlowCard extends LitElement { let load1e_icon = config?.load?.load1_icon || 'default'; //valid options are boiler, aircon, pump let load2e_icon = config?.load?.load2_icon || 'default'; //valid options are boiler, aircon, pump let remaining_solar = config.entities.remaining_solar ? parseFloat(stateObj36.state).toFixed(1) : 'false'; - let font = config?.large_font || 'no'; - let panel = config?.panel_mode || 'no'; + let font = config?.large_font || false; + let panel = config?.panel_mode || false; let inverter_colour = config?.inverter?.colour || 'grey'; let useautarky = config?.inverter?.autarky || 'power'; - let usetimer = (config?.entities.use_timer_248 === 'no' || !config?.entities.use_timer_248) ? 'no' : stateObj26.state; - let priority = (config?.entities.priority_load_243 === 'no' || !config?.entities.priority_load_243) ? 'no' : stateObj25.state; - let battery_power = (config?.battery?.invert_power === 'yes') ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); + let usetimer = (config?.entities.use_timer_248 === false || !config?.entities.use_timer_248) ? false : stateObj26.state; + let priority = (config?.entities.priority_load_243 === false || !config?.entities.priority_load_243) ? false : stateObj25.state; + let battery_power = (config?.battery?.invert_power === true) ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); let height = config?.card_height || '396px' let bat_full = config?.battery?.full_capacity || 80 let bat_empty = config?.battery?.empty_capacity || 30 @@ -246,8 +246,8 @@ export class SunsynkPowerFlowCard extends LitElement { capacity: config.battery.shutdown_soc, entityID: '' }; - if (!config.entities.use_timer_248 || config.entities.use_timer_248 === 'no' || stateObj26.state === 'off') { - inverter_prog.show = 'no'; + if (!config.entities.use_timer_248 || config.entities.use_timer_248 === false || stateObj26.state === 'off') { + inverter_prog.show = false; } else if (!config.entities.prog1_time || !config.entities.prog2_time || !config.entities.prog3_time @@ -255,9 +255,9 @@ export class SunsynkPowerFlowCard extends LitElement { || !config.entities.prog5_time || !config.entities.prog6_time ) { - inverter_prog.show = 'no'; + inverter_prog.show = false; } else { - inverter_prog.show = 'yes'; + inverter_prog.show = true; const timer_now = new Date(); // Create a new Date object representing the current time @@ -302,13 +302,13 @@ export class SunsynkPowerFlowCard extends LitElement { //calculate battery capacity let battery_capacity: number = 0; if (battery_power > 0) { - if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) <= inverter_prog.capacity) { + if (stateObj20.state === "off" || inverter_prog.show === false || parseInt(stateObj12.state) <= inverter_prog.capacity) { battery_capacity = config.battery.shutdown_soc; } else { battery_capacity = inverter_prog.capacity; } } else if (battery_power < 0) { - if (stateObj20.state === "off" || inverter_prog.show === "no" || parseInt(stateObj12.state) >= inverter_prog.capacity) { + if (stateObj20.state === "off" || inverter_prog.show === false || parseInt(stateObj12.state) >= inverter_prog.capacity) { battery_capacity = 100; } else if (parseInt(stateObj12.state) < inverter_prog.capacity) { battery_capacity = inverter_prog.capacity; @@ -481,98 +481,98 @@ export class SunsynkPowerFlowCard extends LitElement {
- - + + - + - - - - - - - - - - - - - ${duration} + + + + + + + + + + + + + ${duration} ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} ${localize('common.battery_floating')} - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} Grid ${inverterStateMsg} - Essential - Essential - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W - ${localize('common.daily_load')} - ${localize('common.daily_load')} - ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY - ${localize('common.daily_charge')} - ${localize('common.daily_discharge')} - ${localize('common.daily_grid_buy')} - ${localize('common.daily_grid_sell')} - ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} - ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - ${localize('common.ratio')} + Essential + Essential + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${localize('common.daily_load')} + ${localize('common.daily_load')} + ${localize('common.daily_solar')} + DAILY SOLAR / LEFT TODAY + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} + ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} + ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + ${localize('common.ratio')} - - - - - + + + + + - - + + - - + + - - + + - - + + @@ -610,30 +610,30 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - - + + - - + + - + - + @@ -649,20 +649,20 @@ export class SunsynkPowerFlowCard extends LitElement { - + this.handlePopup(e, config.entities.grid_connected_status_194)}> - - - - - + + + + + - +
@@ -673,19 +673,19 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - - - - - - + + + + + + + + + + + + +
@@ -695,7 +695,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -705,13 +705,13 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - + + + + + - +
@@ -722,21 +722,21 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + this.handlePopup(e, config.entities.aux_connected_status)}> - - - - - - - - - + + + + + + + + +
@@ -747,39 +747,39 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + +
@@ -788,8 +788,8 @@ export class SunsynkPowerFlowCard extends LitElement { - - + +
@@ -798,8 +798,8 @@ export class SunsynkPowerFlowCard extends LitElement { - - + +
@@ -809,149 +809,149 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - - - Timer On - Timer Off + + + Timer On + Timer Off this.handlePopup(e, config.entities.solar_sell_247)}> - - + + this.handlePopup(e, config.entities.priority_load_243)}> - - - Priority Load - Priority Batt + + + Priority Load + Priority Batt - + this.handlePopup(e, inverter_prog.entityID)}> - - + + this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh ${config?.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv || 0} W + ${total_pv || 0} W ` - : svg` ${total_pv || 0} W `} + : svg` ${total_pv || 0} W `} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential || '0'} W + ${essential || '0'} W ` - : svg`${essential || 0} W`} + : svg`${essential || 0} W`} ${config.entities.nonessential_power !== 'none' ? svg` this.handlePopup(e, config.entities.nonessential_power)}> - ${nonessential || 0} W + ${nonessential || 0} W ` - : svg`${nonessential || 0} W `} + : svg`${nonessential || 0} W `} this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power || 0} W + ${grid_power || 0} W ${config.entities.aux_power_166 !== 'none' ? svg` this.handlePopup(e, config.entities.aux_power_166)}> - ${aux_power < 0 ? aux_power * -1 : aux_power} W + ${aux_power < 0 ? aux_power * -1 : aux_power} W ` - : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} + : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ${parseFloat(stateObj9.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> - ${inverter_voltage} V + ${inverter_voltage} V this.handlePopup(e, config.entities.load_frequency_192)}> - ${load_frequency} Hz + ${load_frequency} Hz this.handlePopup(e, config.entities.inverter_current_164)}> - ${inverter_current} A + ${inverter_current} A this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V + ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> ${parseInt(stateObj12.state) || 0} % this.handlePopup(e, config.entities.battery_soc_184)}> - | ${inverter_prog.capacity || 0} % + | ${inverter_prog.capacity || 0} % this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < 0 ? battery_power * -1 : battery_power} W + ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state || 0} A + ${stateObj35.state || 0} A this.handlePopup(e, config.entities.inverter_power_175)}> - ${stateObj22.state || 0} W + ${stateObj22.state || 0} W this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state || 0} W + ${stateObj23.state || 0} W this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state || 0} V + ${stateObj16.state || 0} V this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state || 0} A + ${stateObj17.state || 0} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state || 0} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> ${stateObj37.state || ''}° @@ -981,69 +981,69 @@ export class SunsynkPowerFlowCard extends LitElement { }
- + - + - - - - - - - - - ${duration} + + + + + + + + + ${duration} RUNTIME TO ${battery_capacity}% @${formattedResultTime} TO ${battery_capacity}% CHARGE @${formattedResultTime} ${localize('common.battery_floating')} - DAILY CHARGE - DAILY DISCHARGE - ${localize('common.daily_load')} - ${localize('common.daily_grid_buy')} - ${localize('common.daily_grid_sell')} - ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - ${localize('common.ratio')} - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + DAILY CHARGE + DAILY DISCHARGE + ${localize('common.daily_load')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} + ${localize('common.daily_solar')} + DAILY SOLAR / LEFT TODAY + ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + ${localize('common.ratio')} + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W - - + + - - + + - - + + - - + + @@ -1059,8 +1059,8 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + @@ -1099,20 +1099,20 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - - - - - - - + + + + + + + + + + + + + +
@@ -1122,7 +1122,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -1132,7 +1132,7 @@ export class SunsynkPowerFlowCard extends LitElement { - + @@ -1144,46 +1144,46 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - - - Timer off - Timer on + + + Timer off + Timer on this.handlePopup(e, config.entities.priority_load_243)}> - - - Priority Batt - Priority Load + + + Priority Batt + Priority Load this.handlePopup(e, config.entities.solar_sell_247)}> - - + + - + this.handlePopup(e, inverter_prog.entityID)}> - - + + this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -1195,46 +1195,46 @@ export class SunsynkPowerFlowCard extends LitElement { ${inverter_current} A this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V + ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> ${parseInt(stateObj12.state) || 0} % this.handlePopup(e, config.entities.battery_soc_184)}> - | ${inverter_prog.capacity || 0} % + | ${inverter_prog.capacity || 0} % this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < 0 ? battery_power * -1 : battery_power} W + ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state || 0} A + ${stateObj35.state || 0} A this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power || 0} W + ${grid_power || 0} W this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state || 0} V + ${stateObj16.state || 0} V this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state || 0} A + ${stateObj17.state || 0} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state || 0} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> ${stateObj37.state || ''}° @@ -1250,34 +1250,34 @@ export class SunsynkPowerFlowCard extends LitElement { ${config?.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv || 0} W + ${total_pv || 0} W ` - : svg`${total_pv || 0} W`} + : svg`${total_pv || 0} W`} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ${parseFloat(stateObj9.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential || 0} W + ${essential || 0} W ` - : svg`${essential || 0} W`} + : svg`${essential || 0} W`}
@@ -1307,22 +1307,22 @@ export class SunsynkPowerFlowCard extends LitElement { if (config.battery.empty_capacity > 30) { throw new Error(localize('errors.battery.empty_capacity')); } - if (config.battery.show_daily === 'yes' && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71)) { + if (config.battery.show_daily === true && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71)) { throw Error(localize('errors.battery.show_daily')); } } - if (config.show_solar === 'yes' && !config.solar) { + if (config.show_solar === true && !config.solar) { throw Error(localize('errors.solar.sol')); } else { - if (config.show_solar === 'yes' && !config.solar.mppts) { + if (config.show_solar === true && !config.solar.mppts) { throw Error(localize('errors.solar.mppts')); } - if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.day_pv_energy_108) { + if (config && config.solar && config.show_solar === true && config.solar.show_daily === true && !config.entities.day_pv_energy_108) { throw Error(localize('errors.solar.show_daily')); } } - if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.day_grid_export_77)) { + if ((config && config.grid && config.grid.show_daily_buy === true && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === true && !config.entities.day_grid_export_77)) { throw Error(localize('errors.grid.show_daily')); } @@ -1349,7 +1349,7 @@ export class SunsynkPowerFlowCard extends LitElement { ]; for (const attr1 of solar_attributes) { - if (config.show_solar === 'yes' && !config.entities[attr1]) { + if (config.show_solar === true && !config.entities[attr1]) { throw new Error(`Please include the ${attr1} attribute and entity ID e.g. ${attr1}: sensor.example`); } } diff --git a/src/types.ts b/src/types.ts index 4ff8233d..28dee699 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,9 +10,9 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { battery: { energy: number; shutdown_soc: number; - invert_power: string; + invert_power: boolean; colour: string; - show_daily: string; + show_daily: boolean; animation_speed: number; max_power: number; full_capacity: number; @@ -22,7 +22,7 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { export interface inverterProg { entityID: string; - show?: string; + show?: boolean; charge?: string; capacity: number; } From 7965f983d27b4602e4e62952a4090fd2ae053d92 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 16:19:12 +0100 Subject: [PATCH 05/40] chore: add workflows for release notes and release --- .github/release.yml | 26 ++++++++++++++++++++++++++ .github/workflows/pull_requests.yaml | 24 ++++++++++++++++++++++++ .github/workflows/release.yml | 23 +++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .github/release.yml create mode 100644 .github/workflows/pull_requests.yaml create mode 100644 .github/workflows/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..212a8aa2 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,26 @@ +changelog: + categories: + - title: 💥 Breaking Changes + labels: + - semver/major + - flag/breaking changes + - title: 🚀 Exciting New Features + labels: + - semver/minor + - type/feature + - title: 🐛 Patches & Bug Fixes + labels: + - semver/patch + - type/bug + - title: 📚 Documentation + labels: + - type/docs + - title: 📔 Language + labels: + - type/language + - title: ⬆️ Dependencies + labels: + - type/dependencies + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/pull_requests.yaml b/.github/workflows/pull_requests.yaml new file mode 100644 index 00000000..6cc89894 --- /dev/null +++ b/.github/workflows/pull_requests.yaml @@ -0,0 +1,24 @@ +--- + +name: Pull Requests + +on: + pull_request: + branches: + - master + workflow_dispatch: +jobs: + checkVersion: + if: github.event_name == 'pull_request' + + name: Check version updated + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + # Use this GitHub Action + - name: Check package version + uses: dudo/tag_check@master + with: + git_tag_prefix: v diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..51cda091 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: release + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + release: + name: Create release + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Getting your configuration from GitHub + uses: actions/checkout@v2 + - name: 🛎️ Create release + id: create_release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + - name: 🏷️ Update latest tag + uses: EndBug/latest-tag@latest From 4b63aee7b9add81dc96e0c86b4a684c3079ea84a Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Mon, 14 Aug 2023 16:44:04 +0100 Subject: [PATCH 06/40] chore: add templates --- .github/ISSUE_TEMPLATE/bug_report.yml | 76 ++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 3 + .github/ISSUE_TEMPLATE/feature_request.yml | 54 +++++++++ .github/release.yml | 7 +- docs/conf.py | 130 +++++++++++++++++++++ docs/contribute/bugs.rst | 55 +++++++++ docs/contribute/devcycle.rst | 125 ++++++++++++++++++++ docs/contribute/docs.rst | 24 ++++ docs/index.rst | 12 ++ docs/requirements.txt | 2 + docs/toc.rst | 22 ++++ 11 files changed, 509 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 docs/conf.py create mode 100644 docs/contribute/bugs.rst create mode 100644 docs/contribute/devcycle.rst create mode 100644 docs/contribute/docs.rst create mode 100644 docs/index.rst create mode 100644 docs/requirements.txt create mode 100644 docs/toc.rst diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..2fe9e2ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,76 @@ +name: Bug report +description: File a bug report +labels: ["type/bug"] +body: + - type: markdown + attributes: + value: | + **NOTE:** Before you start, the following should be completed. + + - Read the documentation to ensure the correct setup. + - Make sure no [similar issues(including closed ones)](https://github.com/slipx06/sunsynk-power-flow-card/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fbug) exists. + - Make sure the request is based on the latest release. + + Thanks for taking the time to assist with improving this project! + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true + - type: textarea + id: current-behavior + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: false + - type: textarea + id: expected-behaviour + attributes: + label: Expected behaviour + description: A concise description of what you expected to happen. + placeholder: Tell us what you should see! + validations: + required: true + - type: input + id: card-version + attributes: + label: Card Version + description: The version of the card you have installed + validations: + required: true + - type: input + id: ha-version + attributes: + label: Home Assistant Version + description: The version of Home Assistant you have installed + validations: + required: true + - type: textarea + id: config + attributes: + label: Configuration + description: Please copy and paste your configuration. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..f3aad969 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,3 @@ +--- + +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..a0c683bf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,54 @@ +name: Feature request +description: Suggest an idea for this project +labels: ['type/feature'] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to assist with improving this project! + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the feature you are requesting. + options: + - label: I have searched the existing issues + required: true + - type: textarea + id: current-behavior + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: expected-behaviour + attributes: + label: Expected behaviour + description: A concise description of what you expected to happen. + placeholder: Tell us what you should see! + validations: + required: true + - type: textarea + attributes: + label: Possible Solutions + description: If you have an idea on how to implement this please let us know. + validations: + required: false + - type: dropdown + id: mode + attributes: + label: Mode + description: What mode does this feature apply to? + options: + - Event (default) + - Calendar + - Both + validations: + required: true + - type: textarea + attributes: + label: Context / Reason + description: Providing context helps us come up with a solution that is most useful in the real world. + validations: + required: true diff --git a/.github/release.yml b/.github/release.yml index 212a8aa2..de2f33eb 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -7,20 +7,25 @@ changelog: - title: 🚀 Exciting New Features labels: - semver/minor - - type/feature + - type/feat + - enhancement - title: 🐛 Patches & Bug Fixes labels: - semver/patch - type/bug + - bug - title: 📚 Documentation labels: - type/docs + - documentation - title: 📔 Language labels: - type/language + - language - title: ⬆️ Dependencies labels: - type/dependencies + - dependencies - title: Other Changes labels: - "*" diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..e885f2f6 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- + +import re +import os +import sys +import json + +sys.path.insert(0, os.path.abspath("..")) + +project = "sunsynk-power-flow-card" +slug = re.sub(r"\W+", "-", project.lower()) +copyright = "2021, slipx06" +author = "slipx06" + +# Get version from package.json file +with open('../package.json') as json_file: + data = json.load(json_file) + version = data['version'] + +# The full version, including alpha/beta/rc tags +release = "" + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.coverage", + "sphinx.ext.viewcode", + "sphinx_rtd_theme", + "sphinx.ext.napoleon", + "sphinx.ext.autosectionlabel", + "myst_parser", +] + +# -- Napoleon Settings ----------------------------------------------------- +napoleon_google_docstring = True +napoleon_numpy_docstring = False +napoleon_include_init_with_doc = False +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = False +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = True +napoleon_use_param = True +napoleon_use_rtype = True +napoleon_use_keyword = True +autodoc_member_order = "bysource" + + +templates_path = ["_templates"] +source_suffix = ".rst" + +master_doc = "index" +language = "en" +gettext_compact = False + +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +pygments_style = "default" + + +html_theme = "sphinx_rtd_theme" +html_theme_options = { + "logo_only": True, + "navigation_depth": 5, + "display_version": True, +} + +htmlhelp_basename = slug + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +latex_documents = [ + ("index", "{0}.tex".format(slug), project, author, "manual"), +] + + +man_pages = [("index", slug, project, [author], 1)] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + master_doc, + author, + "slipx06", + "", + "Miscellaneous", + ), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ["search.html"] + + +# -- Extension configuration ------------------------------------------------- diff --git a/docs/contribute/bugs.rst b/docs/contribute/bugs.rst new file mode 100644 index 00000000..d167966f --- /dev/null +++ b/docs/contribute/bugs.rst @@ -0,0 +1,55 @@ +############## +Reporting Bugs +############## + +This section guides you through submitting a bug report for Atomic Calendar Revive. +Following these guidelines helps maintainers and the community understand your report +:pencil:, reproduce the behaviour :computer: :computer:, and find related reports +:mag_right:. + +Before creating bug reports, please check the below information as you might find out +that you don't need to create one. When you are creating a bug report, +please :ref:include as many details as possible:, the information it asks for helps +us resolve issues faster. + +.. note: + If you find a **Closed** issue that seems like it is the same thing that you're + experiencing, open a new issue and include a link to the original issue in the + body of your new one. + + +****************************** +Before Submitting A Bug Report +****************************** + +* **Check the :ref:`qucikstart`** You may have miss-configured the plugin and + this is resulting in the issue you see +* **Check the :ref:`FAQs`** for a list of common questions and problems. +* **Perform a `cursory search `_ ** + to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to + the existing issue instead of opening a new one. + +***************************** +How do i submit a bug report? +***************************** + +Bugs are tracked as `GitHub issues `_. +After you've determined this is not a configuration issue, create an issue on github +and provide the following information by filling in `the template `_. + +Explain the problem and include additional details to help maintainers reproduce the problem: + +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you installed the plugin. When listing steps, **don't just say what you did, but explain how you did it**. For example, did you use the Lovelace Editor or do the change in YAML directly. +- **Provide specific examples to demonstrate the steps**. Include screenshots, or copy/pasteable configuration snippets, which you use in those examples. If you're providing snippets in the issue, use `Markdown code blocks `_. +- **Describe the behaviour you observed after following the steps** and point out what exactly is the problem with that behaviour. +- **Explain which behaviour you expected to see instead and why.** +- **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. +- **If Chrome's developer tools pane is showing errors**, include these in your report +- **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below. + +Provide more context by answering these questions: + +- **Did the problem start happening recently** (e.g. after updating to a new version of HA / Atomic Calendar Revive) or was this always a problem? +- If the problem started happening recently, **can you reproduce the problem in an older version of Atomic Calendar Revive?** What's the most recent version in which the problem doesn't happen? You can install older versions of Atomic Calendar Revive via HACS or from the releases page on github +- **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. diff --git a/docs/contribute/devcycle.rst b/docs/contribute/devcycle.rst new file mode 100644 index 00000000..43f972b5 --- /dev/null +++ b/docs/contribute/devcycle.rst @@ -0,0 +1,125 @@ +################# +Development Cycle +################# + +The below will provide a guide on how you should develop for this plugin to have your +code reviewed and accepted. + +**************** +Setup Repository +**************** + +* Fork the repo in `github `_ +* Clone the project to your development machine + +.. code-block:: bash + + git clone https://github.com/your-username/sunsynk-power-flow-card.git + +******************* +Create Topic Branch +******************* + +You should always work on a new topic branch for each feature / bug you are working on. +Also you must ensure that you have pulled the latest version from upstream see below. + +Start by setting up an upstream remote, this will be used to pull the latest version +from the main repository: + +.. code-block:: bash + + git remote add upstream https://github.com/slipx06/sunsynk-power-flow-card + + +Checkout the master branch and pull the latest upstream version: + +.. code-block:: bash + + git checkout master + git fetch upstream + git merge upstream/master + git push + +Your fork should now be in sync with the main totaldebug repository, now a new branch +is required for development. + +.. code-block:: bash + + git checkout -b _ + git checkout -b 100_Fix-the-bug + + +.. note:: + + The branch should have a relevant short name starting with the issue number + and then having a name for the fix / feature as shown in the example above. + +******************** +Install Dependencies +******************** + +From the cloned repository, run the command to install the requirements: + +.. code-block:: bash + + yarn install + +******************** +Make changes & Build +******************** + +#. Any changes to the card should be made in the folder ``src`` +#. Update the version number in ``package.json`` +#. Run the command ``yarn run build`` to create the latest distribution file + +******* +Testing +******* + +There are no automated tests for this project, however it is expected that any +development work is tested against a HA Server with both CalDav and Google Calendar +attached, this ensures no adverse impact is added with the feature or bugfix. + +********** +Versioning +********** + +This project follows `Semantic Versioning `_ + +**MAJOR.MINOR.PATCH** + +In the context of semantic versioning, the following should apply: + +* **Major** - A breaking change that requires user invervention, or a change to a + default value. +* **Minor** - A change that does not require intervention, or adds additional + functionality in a backwards compatible manner. +* **Patch** - A change that resolves a specific bug. + +All changes are tracked in the `release notes `_ + + +************** +Commit Changes +************** + +Once you are happy with the changes, these can be committed: + +.. code-block:: bash + + git add . + git commit -v -m "feat: 100 Added new feature" + +.. note:: + + Commit messages should follow `conventional commits `_ + this ensures clear commit messages within the repository. + + +******************* +Submit Pull Request +******************* + +Once development & testing are completed a pull request can be submitted for +the change that is required, ensure that all tests are passing and once they +are a member of the team will review the request, test and merge if appropriate diff --git a/docs/contribute/docs.rst b/docs/contribute/docs.rst new file mode 100644 index 00000000..3be9deda --- /dev/null +++ b/docs/contribute/docs.rst @@ -0,0 +1,24 @@ +############# +Documentation +############# + +The documentation for this repo is built using Sphinx, the site is re-built +on each release of the card and pushed to github pages. + +***************** +How to Contribute +***************** + +There are two ways of contributing to the documentation: + +#. Editing the files within the ``docs`` folder. +#. Raising an issue for something to be fixed on the next release. + +The documentation utilises `Sphinx RestructuredText `_ + +************ +Adding pages +************ + +To add new pages, add a new file in the appropriate directory, and then add a reference +to the ``toc.rst`` file under the correct heading. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..4124174d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,12 @@ +.. include:: ../README.md + :parser: myst_parser.sphinx_ + +***************** +Table of Contents +***************** + +.. include:: toc.rst + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..7719dbc4 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx_rtd_theme>=^1.2.2 +myst-parser>=^2.0.0 diff --git a/docs/toc.rst b/docs/toc.rst new file mode 100644 index 00000000..d69586e0 --- /dev/null +++ b/docs/toc.rst @@ -0,0 +1,22 @@ + +.. toctree:: + :caption: Overview + :titlesonly: + + overview/quickstart + +.. toctree:: + :caption: Configuration + :titlesonly: + + configuration/main + configuration/examples/sunsynk + configuration/examples/lux + +.. toctree:: + :caption: Contribute + :titlesonly: + + contribute/bugs + contribute/devcycle + contribute/docs From f2e367378686b8237824b5987715ccefdb9009cb Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Tue, 15 Aug 2023 10:19:59 +0100 Subject: [PATCH 07/40] refactor: added defaults file --- dist/sunsynk-power-flow-card.js | 12 +- package.json | 1 + src/defaults.ts | 38 ++++- src/index.ts | 268 ++++++++++++++++---------------- 4 files changed, 175 insertions(+), 144 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 5efc63f7..f409de0b 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -1,27 +1,27 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function s(t,e,s,i){var n,l=arguments.length,a=l<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,i);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(l<3?n(a):l>3?n(e,s,a):n(e,s))||a);return l>3&&a&&Object.defineProperty(e,s,a),a}"function"==typeof SuppressedError&&SuppressedError; +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function s(t,e,s,n){var i,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,n);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(o=(a<3?i(o):a>3?i(e,s,o):i(e,s))||o);return a>3&&o&&Object.defineProperty(e,s,o),o}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const i=window,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),a=new WeakMap;let o=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&a.set(e,t))}return t}toString(){return this.cssText}};const r=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,l))(e)})(t):t +const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;let l=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&o.set(e,t))}return t}toString(){return this.cssText}};const r=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,a))(e)})(t):t /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,p=d.trustedTypes,c=p?p.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const i=this._$Ep(s,e);void 0!==i&&(this._$Ev.set(i,s),t.push(i))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),n=i.litNonce;void 0!==n&&s.setAttribute("nonce",n),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var i;const n=this.constructor._$Ep(t,s);if(void 0!==n&&!0===s.reflect){const l=(void 0!==(null===(i=s.converter)||void 0===i?void 0:i.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==l?this.removeAttribute(n):this.setAttribute(n,l),this._$El=null}}_$AK(t,e){var s;const i=this.constructor,n=i._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=i.getPropertyOptions(n),l="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=n,this[n]=l.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var m;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,A=`<${M}>`,H=document,b=()=>H.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),N=R(1),D=R(2),$=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),U=new WeakMap,z=H.createTreeWalker(H,129,null,!1);function O(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Q=(t,e)=>{const s=t.length-1,i=[];let n,l=2===e?"":"",a=P;for(let e=0;e"===r[0]?(a=null!=n?n:P,h=-1):void 0===r[1]?h=-2:(h=a.lastIndex-r[2].length,o=r[1],a=void 0===r[3]?C:'"'===r[3]?F:B):a===F||a===B?a=C:a===V||a===I?a=P:(a=C,n=void 0);const p=a===C&&t[e+1].startsWith("/>")?" ":"";l+=a===P?s+A:h>=0?(i.push(o),s.slice(0,h)+T+s.slice(h)+k+p):s+k+(-2===h?(i.push(void 0),e):p)}return[O(t,l+(t[s]||"")+(2===e?"":"")),i]};class j{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0;const a=t.length-1,o=this.parts,[r,h]=Q(t,e);if(this.el=j.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=z.nextNode())&&o.length0){i.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Y&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(H.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=j.createElement(O(i.h,i.h[0]),this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.v(s);else{const t=new G(n,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new j(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new X(this.k(b()),this.k(b()),this,this.options)):s=e[i],s._$AI(n),i++;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){const n=this.strings;let l=!1;if(void 0===n)t=W(this,t,e,0),l=!Z(t)||t!==this._$AH&&t!==$,l&&(this._$AH=t);else{const i=t;let a,o;for(t=n[0],a=0;at}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,S=/"/g,F=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?S:B):o===S||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o{var i,n;const l=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:e;let a=l._$litPart$;if(void 0===a){const t=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:null;l._$litPart$=a=new X(e.insertBefore(b(),t),t,void 0,null!=s?s:{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $}}ot.finalized=!0,ot._$litElement$=!0,null===(lt=globalThis.litElementHydrateSupport)||void 0===lt||lt.call(globalThis,{LitElement:ot});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:ot}),(null!==(at=globalThis.litElementVersions)&&void 0!==at?at:globalThis.litElementVersions=[]).push("3.3.3"); +var at,ot;class lt extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{var n,i;const a=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=a._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;a._$litPart$=o=new X(e.insertBefore(H(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return D}}lt.finalized=!0,lt._$litElement$=!0,null===(at=globalThis.litElementHydrateSupport)||void 0===at||at.call(globalThis,{LitElement:lt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:lt}),(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var pt,ct;null===(pt=window.HTMLSlotElement)||void 0===pt||pt.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new o(s,t,l)})(ct||(ct=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={battery:{energy:0}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function mt(t,e="",s=""){const i=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let n;try{n=t.split(".").reduce(((t,e)=>t[e]),wt[i])}catch(e){n=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===n&&(n=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==s&&(n=n.replace(e,s)),n}var ft,ut,qt,Tt,kt,Mt,At,Ht,bt,Zt,Lt,Et,Pt,Vt,It,Ct,Bt,Ft,St,Rt,Nt,Dt,$t,Yt,Ut,zt,Ot,Qt,jt,Wt;console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(mt("common.version"),": ").concat("2.0.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends ot{static get styles(){return vt}static getStubConfig(){return{cardstyle:"lite",show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{show_daily:!0,mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){var t,s,i,n,l,a,o,r,h,d,p,c,v,_,y,g,x,w,m,f,u,q,T,k,M,A,H,b,Z,L,E,P,V,I,C,B,F,S,R,$,Y,U,z,O,Q,j,W,G,X,K,J,tt,et,st,it,nt,lt,at,ot,rt,ht,dt,pt,ct,vt,_t,yt,gt,xt,wt,Gt,Xt,Kt,Jt,te,ee;const se=this._config,ie=this.hass.states[se.entities.day_battery_discharge_71]||{state:"0"},ne=this.hass.states[se.entities.day_battery_charge_70]||{state:"0"},le=this.hass.states[se.entities.day_load_energy_84]||{state:"0"},ae=this.hass.states[se.entities.day_grid_import_76]||{state:"0"},oe=this.hass.states[se.entities.day_pv_energy_108]||{state:"0"},re=this.hass.states[se.entities.inverter_voltage_154]||{state:"0"},he=this.hass.states[se.entities.load_frequency_192]||{state:"0"},de=this.hass.states[se.entities.inverter_current_164]||{state:"0"},pe=this.hass.states[se.entities.pv2_power_187]||{state:"0"},ce=this.hass.states[se.entities.pv1_power_186]||{state:"0"},ve=this.hass.states[se.entities.battery_voltage_183]||{state:"0"},_e=this.hass.states[se.entities.battery_soc_184]||{state:"0"},ye=this.hass.states[se.entities.battery_power_190]||{state:"0"},ge=this.hass.states[se.entities.essential_power]||{state:"0"},xe=this.hass.states[se.entities.grid_ct_power_172]||{state:"0"},we=this.hass.states[se.entities.pv1_voltage_109]||{state:"0"},me=this.hass.states[se.entities.pv1_current_110]||{state:"0"},fe=this.hass.states[se.entities.pv2_voltage_111]||{state:"0"},ue=this.hass.states[se.entities.pv2_current_112]||{state:"0"},qe=this.hass.states[se.entities.grid_connected_status_194]||{state:"on"},Te=this.hass.states[se.entities.inverter_status_59]||{state:""},ke=this.hass.states[se.entities.inverter_power_175]||{state:"0"},Me=this.hass.states[se.entities.grid_power_169]||{state:"0"},Ae=this.hass.states[se.entities.aux_power_166]||{state:"0"},He=this.hass.states[se.entities.priority_load_243]||{state:"undefined"},be=this.hass.states[se.entities.use_timer_248]||{state:"undefined"},Ze=this.hass.states[se.entities.pv3_voltage_113]||{state:"0"},Le=this.hass.states[se.entities.pv3_current_114]||{state:"0"},Ee=this.hass.states[se.entities.pv4_voltage_115]||{state:"0"},Pe=this.hass.states[se.entities.pv4_current_116]||{state:"0"},Ve=this.hass.states[se.entities.pv3_power_188]||{state:"0"},Ie=this.hass.states[se.entities.pv4_power_189]||{state:"0"},Ce=this.hass.states[se.entities.day_grid_export_77]||{state:"0"},Be=this.hass.states[se.entities.nonessential_power]||{state:"0"},Fe=this.hass.states[se.entities.battery_current_191]||{state:"0"},Se=this.hass.states[se.entities.remaining_solar]||{state:"0"},Re=this.hass.states[se.entities.battery_temp_182]||{state:""},Ne=this.hass.states[se.entities.dc_transformer_temp_90]||{state:""},De=this.hass.states[se.entities.radiator_temp_91]||{state:""},$e=this.hass.states[se.entities.non_essential_load1]||{state:"0"},Ye=this.hass.states[se.entities.non_essential_load2]||{state:"0"},Ue=this.hass.states[se.entities.essential_load1]||{state:"0"},ze=this.hass.states[se.entities.energy_cost]||{state:""},Oe=this.hass.states[se.entities.solar_sell_247]||{state:"undefined"},Qe=this.hass.states[se.entities.essential_load2]||{state:"0"},je=this.hass.states[se.entities.pv_total]||{state:"0"},We=this.hass.states[se.entities.aux_connected_status]||{state:"on"};let Ge=!0===((null===(t=null==se?void 0:se.load)||void 0===t?void 0:t.invert_aux)||!1)?-1*parseInt(Ae.state):parseInt(Ae.state),Xe=!0===((null===(s=null==se?void 0:se.grid)||void 0===s?void 0:s.invert_grid)||!1)?-1*parseInt(xe.state):parseInt(xe.state),Ke=(null===(i=null==se?void 0:se.inverter)||void 0===i?void 0:i.modern)||!0,Je=(null===(n=null==se?void 0:se.load)||void 0===n?void 0:n.colour)||"#5fb6ad",ts=(null===(l=null==se?void 0:se.load)||void 0===l?void 0:l.aux_colour)||Je,es=(null===(a=null==se?void 0:se.load)||void 0===a?void 0:a.aux_off_colour)||Je,ss=(null===(o=null==se?void 0:se.load)||void 0===o?void 0:o.show_daily)||!1,is=(null===(r=null==se?void 0:se.grid)||void 0===r?void 0:r.colour)||"#5490c2",ns=(null===(h=null==se?void 0:se.grid)||void 0===h?void 0:h.no_grid_colour)||"#a40013",ls=(null===(d=null==se?void 0:se.grid)||void 0===d?void 0:d.show_nonessential)||!0,as=(null===(p=null==se?void 0:se.entities)||void 0===p?void 0:p.grid_connected_status_194)?qe.state:"on",os=(null===(c=null==se?void 0:se.entities)||void 0===c?void 0:c.aux_connected_status)?We.state:"on",rs=(null===(v=null==se?void 0:se.entities)||void 0===v?void 0:v.load_frequency_192)?he.state:0,hs=(null===(_=null==se?void 0:se.entities)||void 0===_?void 0:_.inverter_voltage_154)?re.state:0,ds=(null===(y=null==se?void 0:se.entities)||void 0===y?void 0:y.inverter_current_164)?de.state:0,ps=(null===(g=null==se?void 0:se.entities)||void 0===g?void 0:g.battery_voltage_183)?ve.state:0,cs=null===(x=null==se?void 0:se.grid)||void 0===x?void 0:x.additional_loads;!1!==cs&&1!==cs&&2!==cs&&(cs=!1);let vs=(null===(w=null==se?void 0:se.grid)||void 0===w?void 0:w.show_daily_buy)||!1,_s=(null===(m=null==se?void 0:se.grid)||void 0===m?void 0:m.show_daily_sell)||!1,ys=(null===(f=null==se?void 0:se.battery)||void 0===f?void 0:f.colour)||"pink",gs=(null===(u=null==se?void 0:se.battery)||void 0===u?void 0:u.show_daily)||!1,xs=(null===(q=null==se?void 0:se.solar)||void 0===q?void 0:q.colour)||"orange",ws=(null===(T=null==se?void 0:se.solar)||void 0===T?void 0:T.show_daily)||!1,ms=null===(k=null==se?void 0:se.load)||void 0===k?void 0:k.show_aux;!1!==ms&&!0!==ms&&(ms=!1);let fs=null===(M=null==se?void 0:se.load)||void 0===M?void 0:M.additional_loads;!1!==fs&&1!==fs&&2!==fs&&(fs=!1);let us=(null===(A=null==se?void 0:se.load)||void 0===A?void 0:A.aux_type)||"default",qs=(null===(H=null==se?void 0:se.grid)||void 0===H?void 0:H.nonessential_icon)||"default",Ts=(null===(b=null==se?void 0:se.grid)||void 0===b?void 0:b.load1_icon)||"default",ks=(null===(Z=null==se?void 0:se.grid)||void 0===Z?void 0:Z.load2_icon)||"default",Ms=(null===(L=null==se?void 0:se.load)||void 0===L?void 0:L.load1_icon)||"default",As=(null===(E=null==se?void 0:se.load)||void 0===E?void 0:E.load2_icon)||"default",Hs=se.entities.remaining_solar?parseFloat(Se.state).toFixed(1):"false",bs=(null==se?void 0:se.large_font)||!1,Zs=(null==se?void 0:se.panel_mode)||!1,Ls=(null===(P=null==se?void 0:se.inverter)||void 0===P?void 0:P.colour)||"grey",Es=(null===(V=null==se?void 0:se.inverter)||void 0===V?void 0:V.autarky)||"power",Ps=!(!1===(null==se?void 0:se.entities.use_timer_248)||!(null==se?void 0:se.entities.use_timer_248))&&be.state,Vs=!(!1===(null==se?void 0:se.entities.priority_load_243)||!(null==se?void 0:se.entities.priority_load_243))&&He.state,Is=!0===(null===(I=null==se?void 0:se.battery)||void 0===I?void 0:I.invert_power)?-1*parseInt(ye.state):parseInt(ye.state),Cs=(null==se?void 0:se.card_height)||"396px",Bs=(null===(C=null==se?void 0:se.battery)||void 0===C?void 0:C.full_capacity)||80,Fs=(null===(B=null==se?void 0:se.battery)||void 0===B?void 0:B.empty_capacity)||30,Ss=parseInt(parseFloat(pe.state||"0").toFixed(0))+parseInt(parseFloat(ce.state||"0").toFixed(0))+parseInt(parseFloat(Ve.state||"0").toFixed(0))+parseInt(parseFloat(Ie.state||"0").toFixed(0)),Rs=(null===(F=null==se?void 0:se.entities)||void 0===F?void 0:F.pv_total)?parseInt(je.state):Ss,Ns="none"!==(null==se?void 0:se.entities.essential_power)&&(null==se?void 0:se.entities.essential_power)?parseInt(ge.state):parseInt(ke.state)+parseInt(Me.state)-parseInt(Ae.state),Ds="none"!==(null==se?void 0:se.entities.nonessential_power)&&(null==se?void 0:se.entities.nonessential_power)?parseInt(Be.state):parseInt(xe.state)-parseInt(Me.state);const $s={time:this.hass.states[se.entities.prog1_time]||{state:""},capacity:this.hass.states[se.entities.prog1_capacity]||{state:""},charge:this.hass.states[se.entities.prog1_charge]||{state:""}},Ys={time:this.hass.states[se.entities.prog2_time]||{state:""},capacity:this.hass.states[se.entities.prog2_capacity]||{state:""},charge:this.hass.states[se.entities.prog2_charge]||{state:""}},Us={time:this.hass.states[se.entities.prog3_time]||{state:""},capacity:this.hass.states[se.entities.prog3_capacity]||{state:""},charge:this.hass.states[se.entities.prog3_charge]||{state:""}},zs={time:this.hass.states[se.entities.prog4_time]||{state:""},capacity:this.hass.states[se.entities.prog4_capacity]||{state:""},charge:this.hass.states[se.entities.prog4_charge]||{state:""}},Os={time:this.hass.states[se.entities.prog5_time]||{state:""},capacity:this.hass.states[se.entities.prog5_capacity]||{state:""},charge:this.hass.states[se.entities.prog5_charge]||{state:""}},Qs={time:this.hass.states[se.entities.prog6_time]||{state:""},capacity:this.hass.states[se.entities.prog6_capacity]||{state:""},charge:this.hass.states[se.entities.prog6_charge]||{state:""}};let js={capacity:se.battery.shutdown_soc,entityID:""};if(se.entities.use_timer_248&&!1!==se.entities.use_timer_248&&"off"!==be.state)if(se.entities.prog1_time&&se.entities.prog2_time&&se.entities.prog3_time&&se.entities.prog4_time&&se.entities.prog5_time&&se.entities.prog6_time){js.show=!0;const gi=new Date,xi=[];[$s,Ys,Us,zs,Os,Qs].forEach(((t,e)=>{const[s,i]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));xi[e]=new Date(gi.getTime()),xi[e].setHours(s),xi[e].setMinutes(i)}));const[wi,mi,fi,ui,qi,Ti]=xi;function ki(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?js.charge="none":js.charge="both",js.capacity=parseInt(t.capacity.state),js.entityID=e}gi>=Ti||gi=wi&&gi=mi&&gi=fi&&gi=ui&&gi=qi&&gi0?Ws="off"===qe.state||!1===js.show||parseInt(_e.state)<=js.capacity?se.battery.shutdown_soc:js.capacity:Is<0&&("off"===qe.state||!1===js.show||parseInt(_e.state)>=js.capacity?Ws=100:parseInt(_e.state)0?Gs=(parseInt(_e.state)-Ws)/100*se.battery.energy/Is*60*60:Is<0&&(Gs=(Ws-parseInt(_e.state))/100*se.battery.energy/Is*60*60*-1);const Mi=new Date,Ai=1e3*Gs,Hi=new Date(Mi.getTime()+Ai),bi=Hi.getHours(),Zi=Hi.getMinutes().toString().padStart(2,"0"),Li=bi.toString().padStart(2,"0");Xs="".concat(Li,":").concat(Zi);const Ei=Math.floor(Gs/86400),Pi=Math.floor(Gs%86400/3600),Vi=Math.floor(Gs%3600/60);Ei>0&&(Ks+="".concat(Ei," days, ")),(Pi>0||Ei>0)&&(Ks+="".concat(Pi," hrs, ")),Ks+="".concat(Vi," min")}let Js=-2<=parseInt(Fe.state)&&parseInt(Fe.state)<=2&&parseInt(_e.state)>=99?"True":"False",ti="",ei="";switch(Te.state){case"0":case"standby":ti="blue",ei="Standby";break;case"1":case"selftest":ti="yellow",ei="Selftest";break;case"2":case"normal":case"ok":ti="green",ei="Normal";break;case"3":case"alarm":ti="orange",ei="Alarm";break;case"4":case"fault":ti="red",ei="Fault";break;default:"none"!==(null===(S=null==se?void 0:se.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=null==se?void 0:se.entities)||void 0===R?void 0:R.inverter_status_59)?(ti="transparent",ei="Status"):(ti="transparent",ei="")}let si=(isNaN(parseFloat(oe.state))?0:parseFloat(oe.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),ii=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),ni=0!=ii?Math.min(Math.round(100*si/ii),100):0,li=0!=si?Math.min(Math.round(100*ii/si),100):0,ai=Ss+parseInt("".concat(Is>0?Is:0))+parseInt("".concat(Ge<0?-1*Ge:0)),oi=Ns+Ds+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Is<0?-1*Is:0)),ri=0!=oi?Math.min(Math.round(100*ai/oi),100):0,hi=0!=ai?Math.min(Math.round(100*oi/ai),100):0,di=(null===($=null==se?void 0:se.solar)||void 0===$?void 0:$.animation_speed)||"9";if(se&&se.solar&&se.solar.animation_speed){let Ii=se.solar.animation_speed-(se.solar.animation_speed-1)*(Ss/(se.solar.max_power||Ss));di="".concat(Ii>=1?Ii:1)}let pi=(null===(Y=null==se?void 0:se.battery)||void 0===Y?void 0:Y.animation_speed)||"6";if(se&&se.battery&&se.battery.animation_speed){let Ci=se.battery.animation_speed-(se.battery.animation_speed-1)*((Is<0?-1*Is:Is)/(se.battery.max_power||(Is<0?-1*Is:Is)));pi="".concat(Ci>=1?Ci:1)}let ci=(null===(U=null==se?void 0:se.load)||void 0===U?void 0:U.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Bi=se.load.animation_speed-(se.load.animation_speed-1)*(Ns/(se.load.max_power||Ns));ci="".concat(Bi>=1?Bi:1)}let vi=(null===(z=null==se?void 0:se.load)||void 0===z?void 0:z.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Fi=se.load.animation_speed-(se.load.animation_speed-1)*((parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))/(se.load.max_power||(parseInt(Ae.state)<0?-1*parseInt(Ae.state):parseInt(Ae.state))));vi="".concat(Fi>=1?Fi:1)}let _i=(null===(O=null==se?void 0:se.grid)||void 0===O?void 0:O.animation_speed)||"8";if(se&&se.grid&&se.grid.animation_speed){let Si=se.grid.animation_speed-(se.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(se.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));_i="".concat(Si>=1?Si:1)}let yi=(null===(Q=null==se?void 0:se.grid)||void 0===Q?void 0:Q.animation_speed)||"4";if(se&&se.grid&&se.grid.animation_speed){let Ri=se.grid.animation_speed-(se.grid.animation_speed-1)*(Ds/(se.grid.max_power||Ds));yi="".concat(Ri>=1?Ri:1)}return"full"===se.cardstyle?N(ft||(ft=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,ts,es,is,is,!1===Zs?"".concat(Cs):"100%",xs,!1===se.show_solar?"st12":"",ys,is,is,ts,!1===ms?"st12":"",Je,Ls,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",is,!1===ls?"st12":"",1===cs?"":"none",is,!1===ls?"st12":"",2===cs?"":"none",is,!1===ls||1===cs?"st12":"",2===cs?"":"none",is,!1===ls||1===cs?"st12":"",!1===ms?"30":"143",Je,1===fs?"":"none",!1===ms?"376":"373",!1===ms?"30":"143",Je,2===fs?"":"none",!1===ms?"413":"410",!1===ms?"30":"143",Je,2===fs?"":"none",!1===bs?"st14":"st4",0===se.battery.energy||"True"===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||"True"===Js?"transparent":"".concat(ys),mt("common.runtime_to"),Ws,Xs,0===se.battery.energy||Is>=0||"True"===Js?"transparent":"".concat(ys),mt("common.to"),Ws,mt("common.charge"),Xs,0===se.battery.energy||"False"===Js?"transparent":"".concat(ys),mt("common.battery_floating"),!1===se.show_solar?"none":"",xs,(null===(j=null==se?void 0:se.solar)||void 0===j?void 0:j.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(W=null==se?void 0:se.solar)||void 0===W?void 0:W.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(G=null==se?void 0:se.solar)||void 0===G?void 0:G.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(X=null==se?void 0:se.solar)||void 0===X?void 0:X.pv4_name)?"".concat(se.solar.pv4_name):"PV4",is,Ls,ei,1!==fs&&2!==fs||!0!==ms?"":"none",Je,!1===fs||!1===ms?"none":"",Je,!1===ms?"70":"181",1===fs?"":"none",Je,(null===(K=null==se?void 0:se.load)||void 0===K?void 0:K.load1_name)?"".concat(se.load.load1_name):"",!1===ms?"47":"158",1===fs?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),!1===ms?"393":"390",!1===ms?"59":"172",2===fs?"":"none",Je,(null===(J=null==se?void 0:se.load)||void 0===J?void 0:J.load1_name)?"".concat(se.load.load1_name):"",!1===ms?"394":"391",!1===ms?"42":"154",2===fs?"":"none",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),!1===ms?"429":"426",!1===ms?"59":"172",2===fs?"":"none",Je,(null===(tt=null==se?void 0:se.load)||void 0===tt?void 0:tt.load2_name)?"".concat(se.load.load2_name):"",!1===ms?"430":"427",!1===ms?"42":"154",2===fs?"":"none",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),!1===ss||!1===ms?"transparent":"".concat(Je),mt("common.daily_load"),!1===fs?"83%":"67%",!1===fs?"18.5%":"24.25%",!1===ss||!0===ms?"transparent":"".concat(Je),mt("common.daily_load"),!1===ws||!1===se.show_solar||"false"!=Hs?"transparent":"".concat(xs),mt("common.daily_solar"),!1===ws||!1===se.show_solar||"false"===Hs?"transparent":"".concat(xs),!1===gs?"transparent":"".concat(ys),mt("common.daily_charge"),!1===gs?"transparent":"".concat(ys),mt("common.daily_discharge"),!1===ls?"68%":"76%",!1===ls?"96%":"66%",!1===vs?"transparent":"".concat(is),mt("common.daily_grid_buy"),!1===ls?"68%":"76%",!1===ls?"88%":"58%",!1===_s?"transparent":"".concat(is),mt("common.daily_grid_sell"),!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),(null===(et=null==se?void 0:se.load)||void 0===et?void 0:et.aux_name)?"".concat(se.load.aux_name):"Auxiliary",!1===ls?"none":"",is,(null===(st=null==se?void 0:se.grid)||void 0===st?void 0:st.nonessential_name)?"".concat(se.grid.nonessential_name):"Non Essential",!1===ls||!1===cs||2===cs?"none":"",is,(null===(it=null==se?void 0:se.grid)||void 0===it?void 0:it.load1_name)?"".concat(se.grid.load1_name):"",!1===ls||!1===cs||1===cs?"none":"",is,(null===(nt=null==se?void 0:se.grid)||void 0===nt?void 0:nt.load1_name)?"".concat(se.grid.load1_name):"",!1===ls||!1===cs||1===cs?"none":"",is,(null===(lt=null==se?void 0:se.grid)||void 0===lt?void 0:lt.load2_name)?"".concat(se.grid.load2_name):"",!1===ls||!1===cs||2===cs?"none":"",is,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===ls||!1===cs||1===cs?"none":"",is,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===ls||!1===cs||1===cs?"none":"",is,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,ni,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,li,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,ri,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hi,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,mt("common.ratio"),ti,!0===ms?"":"none",1===fs||2===fs?"":"st12",Je,!1===ms?"":"none",1===fs?"":"st12",Je,!1===ms?"":"none",2===fs?"":"st12",Je,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Ss?"transparent":"".concat(xs),di,ys,Is<0||0===Is?"transparent":"".concat(ys),pi,Is>0||0===Is?"transparent":"".concat(ys),pi,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,is,Xe<0||0===Xe?"transparent":"".concat(is),_i/2,Xe>0||0===Xe?"transparent":"".concat(is),_i/2,is,!1===ls?"st12":"",!1===ls?"st12":"",Ds<=0?"transparent":"".concat(is),yi/2,is,!1===ls?"st12":"",!1===ls?"st12":"",Ds<=0?"transparent":"".concat(is),yi,!1===ms?"st12":"",ts,!1===ms||0===Ge?"st12":"",Ge<0?"transparent":"".concat(ts),vi,!1===ms||0===Ge?"st12":"",Ge>0?"transparent":"".concat(ts),vi,!1===ms?"st12":"",ts,is,Ls,Je,0===Ns?"transparent":"".concat(Je),ci,Je,Ls,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Fs&&parseInt(_e.state)<=49?"1":"0",ys,parseInt(_e.state)<=Fs?1:0,ys,!1===se.show_solar?"st12":"",xs,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===as||"0"===as?"st12":"",is,"on"===as||"1"===as?"st12":"",ns,"default"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"oven"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"boiler"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"pump"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,"aircon"===qs?"1":"0",!1===ls||2===cs||1===cs?"none":"",is,!1===ls||2===cs||1===cs?"none":"",qs,"default"===Ts&&"default"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"default"===Ts&&"default"!=ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"default"!=Ts&&"default"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"boiler"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"boiler"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"pump"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"pump"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"oven"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"oven"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"aircon"===Ts?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,"aircon"===ks?"1":"0",!1===ls||!1===cs||1===cs?"none":"",is,!1===ls||!1===cs||1===cs?"none":"",Ts,!1===ls||!1===cs||1===cs?"none":"",ks,"default"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"boiler"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"pump"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"oven"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,"aircon"===Ts?"1":"0",!1===ls||!1===cs||2===cs?"none":"",is,!1===ls||!1===cs||2===cs?"none":"",Ts,1!==fs&&2!==fs||!1!==ms?"none":"",Je,1!==fs&&2!==fs||!0!==ms?"none":"",Je,1===fs||2===fs?"none":"",Je,(t=>this.handlePopup(t,se.entities.aux_connected_status)),"default"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"gen"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"inverter"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"oven"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"boiler"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"aircon"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),"pump"===us?"":"st12",!1===ms?"none":"","".concat("on"===os||"1"===os?ts:es),!1===ms?"none":"",us,"on"===os||"1"===os?"aux-icon":"aux-off-icon","boiler"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"boiler"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"boiler"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"boiler"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"boiler"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"boiler"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"aircon"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"aircon"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"aircon"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"aircon"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"aircon"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"aircon"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"pump"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"pump"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"pump"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"pump"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"pump"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,"pump"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"oven"===Ms&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"oven"===As&&2===fs?"1":"0",!1===ms||!1===fs||1===fs?"none":"",Je,"oven"===Ms&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"oven"===As&&2===fs&&!1===ms?"1":"0",!1===fs||1===fs?"none":"",Je,"oven"===Ms&&1===fs&&!1===ms?"1":"0",!1===fs||2===fs?"none":"",Je,"oven"===Ms&&1===fs?"1":"0",!1===ms||!1===fs||2===fs?"none":"",Je,!1===fs||1===fs?"none":"",!0===ms?"350":"383",!0===ms?"140":"5",Ms,!1===fs||1===fs?"none":"",!0===ms?"446":"420",!0===ms?"140":"5",As,!1===fs||2===fs?"none":"","336",!0===ms?"140":"27",Ms,(t=>this.handlePopup(t,se.entities.use_timer_248)),0!=Es?"60.5%":"65%","on"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"60.5%":"65%","off"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","on"==be.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","off"==be.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&!1!==se.show_solar?"":"none",xs,(t=>this.handlePopup(t,se.entities.priority_load_243)),0!=Es?"65.5%":"70%","off"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"65.5%":"70%","on"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","on"===He.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","off"===He.state&&!1!==Vs?"":"none",Ls,!1===Ke?"":"st12",(t=>this.handlePopup(t,js.entityID)),0!=Es?"60.5%":"65%",!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"st12":"",Ls,0!=Es?"60.5%":"65%",!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"!=Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"===Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,Hs,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===ss||!1===ms?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===fs?"83%":"67%",!1===fs?"15%":"21%",!1===ss||!0===ms?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===ls?"68%":"76%",!1===ls?"92.5%":"62.5%",!1===vs?"none":"",is,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===ls?"68%":"76%",!1===ls?"84.25%":"54.5%",!1===_s?"none":"",is,parseFloat(Ce.state).toFixed(1)||0,(null===(at=null==se?void 0:se.entities)||void 0===at?void 0:at.pv_total)?D(ut||(ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):D(qt||(qt=e([' '," W "])),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.essential_power?D(Tt||(Tt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===bs?"st14":"st4",Je,Ns||"0"):D(kt||(kt=e([''," W"])),!1===bs?"st14":"st4",Je,Ns||0),"none"!==se.entities.nonessential_power?D(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.nonessential_power)),!1===ls?"none":"",!1===bs?"st14":"st4",is,Ds||0):D(At||(At=e([''," W "])),!1===ls?"none":"",!1===bs?"st14":"st4",is,Ds||0),(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",is,Xe||0,"none"!==se.entities.aux_power_166?D(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.aux_power_166)),!1===bs?"st14":"st4",!1===ms?"none":"",ts,Ge<0?-1*Ge:Ge):D(bt||(bt=e([''," W "])),!1===bs?"st14":"st4",!1===ms?"none":"",ts,Ge<0?-1*Ge:Ge),"none"!==se.entities.pv1_power_186?D(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):D(Lt||(Lt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?D(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):D(Pt||(Pt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?D(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):D(It||(It=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?D(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):D(Bt||(Bt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",is,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",is,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===bs?"st14":"st4",ps,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===js.show||"none"===se.entities.battery_soc_184?"none":"",js.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===bs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===bs?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,se.entities.inverter_power_175)),"none"===se.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Ls,ke.state||0,(t=>this.handlePopup(t,se.entities.grid_power_169)),"none"===se.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",is,Me.state||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(ot=null==se?void 0:se.entities)||void 0===ot?void 0:ot.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),4===(null===(rt=null==se?void 0:se.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=null==se?void 0:se.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(dt=null==se?void 0:se.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(pt=null==se?void 0:se.entities)||void 0===pt?void 0:pt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",is,(null===(ct=null==se?void 0:se.entities)||void 0===ct?void 0:ct.energy_cost)?"":"none",ze.state||""):"lite"===se.cardstyle?N(Ft||(Ft=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,!1===se.show_solar?145.33:-.5,!1===se.show_solar?270.67:406,"".concat(!1===Zs?!1===se.show_solar?"246px":"".concat(Cs):!1===se.show_solar?"75%":"100%"),Je,xs,!1===se.show_solar?"st12":"",ys,is,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",Je,1===fs&&!0===se.show_solar?"":"none",Je,2===fs&&!0===se.show_solar?"":"none",Je,2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",0===se.battery.energy||"True"===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||"True"===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||Is>=0||"True"===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||"False"===Js?"transparent":"".concat(ys),mt("common.battery_floating"),!1===gs?"transparent":"".concat(ys),!1===gs?"transparent":"".concat(ys),2===fs?"365":"400.4",2===fs?"182.2":"282.1",!1===ss?"transparent":"".concat(Je),mt("common.daily_load"),!1===vs?"transparent":"".concat(is),mt("common.daily_grid_buy"),!1===_s?"transparent":"".concat(is),mt("common.daily_grid_sell"),!1===ws||!1===se.show_solar||"false"!=Hs?"transparent":"".concat(xs),mt("common.daily_solar"),!1===ws||!1===se.show_solar||"false"===Hs?"transparent":"".concat(xs),!1===se.show_solar?"none":"",xs,(null===(vt=null==se?void 0:se.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(_t=null==se?void 0:se.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(yt=null==se?void 0:se.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(gt=null==se?void 0:se.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(se.solar.pv4_name):"PV4",!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,ni,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,li,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,ri,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hi,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,mt("common.ratio"),1===fs&&!0===se.show_solar?"":"none",Je,(null===(xt=null==se?void 0:se.load)||void 0===xt?void 0:xt.load1_name)?"".concat(se.load.load1_name):"",1===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===fs&&!0===se.show_solar?"":"none",Je,(null===(wt=null==se?void 0:se.load)||void 0===wt?void 0:wt.load1_name)?"".concat(se.load.load1_name):"",2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Ue.state))?0:parseFloat(Ue.state).toFixed(0),2===fs&&!0===se.show_solar?"":"none",Je,(null===(Gt=null==se?void 0:se.load)||void 0===Gt?void 0:Gt.load2_name)?"".concat(se.load.load2_name):"",2===fs&&!0===se.show_solar?"":"none",!1===bs?"st14":"st4",Je,isNaN(parseFloat(Qe.state))?0:parseFloat(Qe.state).toFixed(0),ti,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),di,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),di,ys,Is<0||0===Is?"transparent":"".concat(ys),pi,Is>0||0===Is?"transparent":"".concat(ys),pi,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Ss?"transparent":"".concat(xs),di,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,is,Xe<0||0===Xe?"transparent":"".concat(is),_i,Xe>0||0===Xe?"transparent":"".concat(is),_i,Je,0===Ns?"transparent":"".concat(Je),ci,Je,0===Ns?"transparent":"".concat(Je),ci,1===fs&&!0===se.show_solar?"":"st12",Je,2===fs&&!0===se.show_solar?"":"st12",Je,2===fs&&!0===se.show_solar?"":"st12",Je,"oven"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"oven"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"pump"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"pump"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"aircon"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"aircon"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,"boiler"!==Ms||1!==fs&&2!==fs?"0":"1",!1===fs||!1===se.show_solar?"none":"",Je,"boiler"===As&&2===fs?"1":"0",!1===fs||!1===se.show_solar?"none":"",Je,!1===fs||!1===se.show_solar?"none":"",Ms,!1===fs||1===fs||!1===se.show_solar?"none":"",As,!1===se.show_solar?"st12":"",xs,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Fs&&parseInt(_e.state)<=49?1:0,ys,parseInt(_e.state)<=Fs?1:0,ys,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===as||"0"===as?"st12":"",is,"on"===as||"1"===as?"st12":"",ns,Je,Ls,(t=>this.handlePopup(t,se.entities.use_timer_248)),"on"==be.state&&!1!==Ps?"":"none",Ls,"off"==be.state&&!1!==Ps?"":"none",Ls,"off"==be.state&&!1!==Ps?"":"none",Ls,"on"==be.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.priority_load_243)),"off"===He.state&&!1!==Vs?"":"none",Ls,"on"===He.state&&!1!==Vs?"":"none",Ls,"off"===He.state&&!1!==Vs?"":"none",Ls,"on"===He.state&&!1!==Vs?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"off"!==Oe.state&&"0"!==Oe.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"on"!==Oe.state&&"1"!==Oe.state&&!1!==se.show_solar?"":"none",xs,!1===Ke?"":"st12",(t=>this.handlePopup(t,js.entityID)),!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"st12":"",Ls,!1===js.show||"none"===se.entities.use_timer_248?"none":"","none"===js.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"!=Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||"false"===Hs?"none":"",xs,parseFloat(oe.state).toFixed(1)||0,Hs,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),2===fs?"365":"400.4",2===fs?"168":"267.9",!1===ss?"none":"",Je,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===vs?"none":"",is,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===_s?"none":"",is,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",Ls,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",Ls,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===bs?"st14":"st4",ps,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===js.show||"none"===se.entities.battery_soc_184?"none":"",js.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===bs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===bs?"st14":"st4",Fe.state||0,(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",is,Xe||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(Xt=null==se?void 0:se.entities)||void 0===Xt?void 0:Xt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),"none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(Kt=null==se?void 0:se.entities)||void 0===Kt?void 0:Kt.radiator_temp_91)?"":"none",De.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(Jt=null==se?void 0:se.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",is,(null===(te=null==se?void 0:se.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=null==se?void 0:se.entities)||void 0===ee?void 0:ee.pv_total)?D(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):D(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.pv1_power_186?D(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):D(Dt||(Dt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?D($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):D(Yt||(Yt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?D(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):D(zt||(zt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?D(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):D(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),"none"!==se.entities.essential_power?D(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===bs?"st14":"st4",Je,Ns||0):D(Wt||(Wt=e([''," W"])),!1===bs?"st14":"st4",Je,Ns||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const i=JSON.parse(JSON.stringify(t));this._config=Object.assign(Object.assign({},_t),i)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let i;if("more-info"===e.action)i=new Event("hass-more-info",{composed:!0}),i.detail={entityId:s},t.dispatchEvent(i)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={large_font:!1,panel_mode:!1,card_height:"396px",battery:{energy:0,show_daily:!1,colour:"pink",full_capacity:80,empty_capacity:30},grid:{colour:"#5490c2",no_grid_colour:"#a40013",invert_grid:!1,show_nonessential:!0,show_daily_buy:!1,show_daily_sell:!1,nonessential_icon:"default",load1_icon:"default",load2_icon:"default"},inverter:{modern:!0,colour:"grey",autarky:"power"},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,aux_type:"default",load1_icon:"default",load2_icon:"default"},solar:{colour:"orange",show_daily:!1}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function ft(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),wt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof ut&&ut&&ut.Object===Object&&ut,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,u=f&&f.exports===w,m=u&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=u?x.Buffer:void 0,F=x.Symbol,R=x.Uint8Array,j=S?S.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=F?F.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=S?S.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(u=l)&&At(u)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));wn[e]=new Date(xn.getTime()),wn[e].setHours(s),wn[e].setMinutes(n)}));const[fn,un,mn,qn,Tn,kn]=wn;function Mn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Qs.charge="none":Qs.charge="both",Qs.capacity=parseInt(t.capacity.state),Qs.entityID=e}xn>=kn||xn=fn&&xn=un&&xn=mn&&xn=qn&&xn=Tn&&xn0?Ws="off"===qe.state||!1===Qs.show||parseInt(_e.state)<=Qs.capacity?se.battery.shutdown_soc:Qs.capacity:Is<0&&("off"===qe.state||!1===Qs.show||parseInt(_e.state)>=Qs.capacity?Ws=100:parseInt(_e.state)0?Gs=(parseInt(_e.state)-Ws)/100*se.battery.energy/Is*60*60:Is<0&&(Gs=(Ws-parseInt(_e.state))/100*se.battery.energy/Is*60*60*-1);const bn=new Date,An=1e3*Gs,Hn=new Date(bn.getTime()+An),Zn=Hn.getHours(),Ln=Hn.getMinutes().toString().padStart(2,"0"),En=Zn.toString().padStart(2,"0");Xs="".concat(En,":").concat(Ln);const Pn=Math.floor(Gs/86400),Vn=Math.floor(Gs%86400/3600),In=Math.floor(Gs%3600/60);Pn>0&&(Ks+="".concat(Pn," days, ")),(Vn>0||Pn>0)&&(Ks+="".concat(Vn," hrs, ")),Ks+="".concat(In," min")}let Js=!!(-2<=parseInt(Se.state)&&parseInt(Se.state)<=2&&parseInt(_e.state)>=99),tn="",en="";switch(Te.state){case"0":case"standby":tn="blue",en="Standby";break;case"1":case"selftest":tn="yellow",en="Selftest";break;case"2":case"normal":case"ok":tn="green",en="Normal";break;case"3":case"alarm":tn="orange",en="Alarm";break;case"4":case"fault":tn="red",en="Fault";break;default:"none"!==(null===(F=se.entities)||void 0===F?void 0:F.inverter_status_59)&&(null===(R=se.entities)||void 0===R?void 0:R.inverter_status_59)?(tn="transparent",en="Status"):(tn="transparent",en="")}let sn=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),nn=(isNaN(parseFloat(ae.state))?0:parseFloat(ae.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),an=0!=nn?Math.min(Math.round(100*sn/nn),100):0,on=0!=sn?Math.min(Math.round(100*nn/sn),100):0,ln=Fs+parseInt("".concat(Is>0?Is:0))+parseInt("".concat(Ge<0?-1*Ge:0)),rn=js+Ns+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Is<0?-1*Is:0)),hn=0!=rn?Math.min(Math.round(100*ln/rn),100):0,dn=0!=ln?Math.min(Math.round(100*rn/ln),100):0,cn=(null===(D=se.solar)||void 0===D?void 0:D.animation_speed)||"9";if(se&&se.solar&&se.solar.animation_speed){let Cn=se.solar.animation_speed-(se.solar.animation_speed-1)*(Fs/(se.solar.max_power||Fs));cn="".concat(Cn>=1?Cn:1)}let pn=(null===($=se.battery)||void 0===$?void 0:$.animation_speed)||"6";if(se&&se.battery&&se.battery.animation_speed){let Bn=se.battery.animation_speed-(se.battery.animation_speed-1)*((Is<0?-1*Is:Is)/(se.battery.max_power||(Is<0?-1*Is:Is)));pn="".concat(Bn>=1?Bn:1)}let vn=(null===(O=se.load)||void 0===O?void 0:O.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Sn=se.load.animation_speed-(se.load.animation_speed-1)*(js/(se.load.max_power||js));vn="".concat(Sn>=1?Sn:1)}let _n=(null===(z=se.load)||void 0===z?void 0:z.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Fn=se.load.animation_speed-(se.load.animation_speed-1)*((parseInt(be.state)<0?-1*parseInt(be.state):parseInt(be.state))/(se.load.max_power||(parseInt(be.state)<0?-1*parseInt(be.state):parseInt(be.state))));_n="".concat(Fn>=1?Fn:1)}let yn=(null===(U=se.grid)||void 0===U?void 0:U.animation_speed)||"8";if(se&&se.grid&&se.grid.animation_speed){let Rn=se.grid.animation_speed-(se.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(se.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn="".concat(Rn>=1?Rn:1)}let gn=(null===(Y=se.grid)||void 0===Y?void 0:Y.animation_speed)||"4";if(se&&se.grid&&se.grid.animation_speed){let jn=se.grid.animation_speed-(se.grid.animation_speed-1)*(Ns/(se.grid.max_power||Ns));gn="".concat(jn>=1?jn:1)}return"full"===se.cardstyle?j(Tt||(Tt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,ts,es,ns,ns,!1===Zs?"".concat(Cs):"100%",xs,!1===se.show_solar?"st12":"",ys,ns,ns,ts,!1===fs?"st12":"",Je,Ls,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",ns,!1===as?"st12":"",1===ps?"":"none",ns,!1===as?"st12":"",2===ps?"":"none",ns,!1===as||1===ps?"st12":"",2===ps?"":"none",ns,!1===as||1===ps?"st12":"",!1===fs?"30":"143",Je,1===us?"":"none",!1===fs?"376":"373",!1===fs?"30":"143",Je,2===us?"":"none",!1===fs?"413":"410",!1===fs?"30":"143",Je,2===us?"":"none",!1===Hs?"st14":"st4",0===se.battery.energy||!0===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||!0===Js?"transparent":"".concat(ys),ft("common.runtime_to"),Ws,Xs,0===se.battery.energy||Is>=0||!0===Js?"transparent":"".concat(ys),ft("common.to"),Ws,ft("common.charge"),Xs,0===se.battery.energy||!1===Js?"transparent":"".concat(ys),ft("common.battery_floating"),!1===se.show_solar?"none":"",xs,(null===(Q=se.solar)||void 0===Q?void 0:Q.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(W=se.solar)||void 0===W?void 0:W.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(G=se.solar)||void 0===G?void 0:G.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(X=se.solar)||void 0===X?void 0:X.pv4_name)?"".concat(se.solar.pv4_name):"PV4",ns,Ls,en,1!==us&&2!==us||!0!==fs?"":"none",Je,!1===us||!1===fs?"none":"",Je,!1===fs?"70":"181",1===us?"":"none",Je,(null===(K=se.load)||void 0===K?void 0:K.load1_name)?"".concat(se.load.load1_name):"",!1===fs?"47":"158",1===us?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),!1===fs?"393":"390",!1===fs?"59":"172",2===us?"":"none",Je,(null===(J=se.load)||void 0===J?void 0:J.load1_name)?"".concat(se.load.load1_name):"",!1===fs?"394":"391",!1===fs?"42":"154",2===us?"":"none",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),!1===fs?"429":"426",!1===fs?"59":"172",2===us?"":"none",Je,(null===(tt=se.load)||void 0===tt?void 0:tt.load2_name)?"".concat(se.load.load2_name):"",!1===fs?"430":"427",!1===fs?"42":"154",2===us?"":"none",Je,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),!1===ss||!1===fs?"transparent":"".concat(Je),ft("common.daily_load"),!1===us?"83%":"67%",!1===us?"18.5%":"24.25%",!1===ss||!0===fs?"transparent":"".concat(Je),ft("common.daily_load"),!1===ws||!1===se.show_solar||0!=As?"transparent":"".concat(xs),ft("common.daily_solar"),!1===ws||!1===se.show_solar||!1===As?"transparent":"".concat(xs),!1===gs?"transparent":"".concat(ys),ft("common.daily_charge"),!1===gs?"transparent":"".concat(ys),ft("common.daily_discharge"),!1===as?"68%":"76%",!1===as?"96%":"66%",!1===vs?"transparent":"".concat(ns),ft("common.daily_grid_buy"),!1===as?"68%":"76%",!1===as?"88%":"58%",!1===_s?"transparent":"".concat(ns),ft("common.daily_grid_sell"),!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),(null===(et=se.load)||void 0===et?void 0:et.aux_name)?"".concat(se.load.aux_name):"Auxiliary",!1===as?"none":"",ns,(null===(st=se.grid)||void 0===st?void 0:st.nonessential_name)?"".concat(se.grid.nonessential_name):"Non Essential",!1===as||!1===ps||2===ps?"none":"",ns,(null===(nt=se.grid)||void 0===nt?void 0:nt.load1_name)?"".concat(se.grid.load1_name):"",!1===as||!1===ps||1===ps?"none":"",ns,(null===(it=se.grid)||void 0===it?void 0:it.load1_name)?"".concat(se.grid.load1_name):"",!1===as||!1===ps||1===ps?"none":"",ns,(null===(at=se.grid)||void 0===at?void 0:at.load2_name)?"".concat(se.grid.load2_name):"",!1===as||!1===ps||2===ps?"none":"",ns,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),!1===as||!1===ps||1===ps?"none":"",ns,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),!1===as||!1===ps||1===ps?"none":"",ns,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,an,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,on,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hn,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,dn,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,ft("common.ratio"),tn,!0===fs?"":"none",1===us||2===us?"":"st12",Je,!1===fs?"":"none",1===us?"":"st12",Je,!1===fs?"":"none",2===us?"":"st12",Je,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Fs?"transparent":"".concat(xs),cn,ys,Is<0||0===Is?"transparent":"".concat(ys),pn,Is>0||0===Is?"transparent":"".concat(ys),pn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn/2,Xe>0||0===Xe?"transparent":"".concat(ns),yn/2,ns,!1===as?"st12":"",!1===as?"st12":"",Ns<=0?"transparent":"".concat(ns),gn/2,ns,!1===as?"st12":"",!1===as?"st12":"",Ns<=0?"transparent":"".concat(ns),gn,!1===fs?"st12":"",ts,!1===fs||0===Ge?"st12":"",Ge<0?"transparent":"".concat(ts),_n,!1===fs||0===Ge?"st12":"",Ge>0?"transparent":"".concat(ts),_n,!1===fs?"st12":"",ts,ns,Ls,Je,0===js?"transparent":"".concat(Je),vn,Je,Ls,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Ss&&parseInt(_e.state)<=49?"1":"0",ys,parseInt(_e.state)<=Ss?1:0,ys,!1===se.show_solar?"st12":"",xs,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===os||"0"===os?"st12":"",ns,"on"===os||"1"===os?"st12":"",is,"default"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"oven"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"boiler"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"pump"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"aircon"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,!1===as||2===ps||1===ps?"none":"",qs,"default"===Ts&&"default"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"default"===Ts&&"default"!=ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"default"!=Ts&&"default"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"boiler"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"boiler"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"pump"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"pump"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"oven"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"oven"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"aircon"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"aircon"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,!1===as||!1===ps||1===ps?"none":"",Ts,!1===as||!1===ps||1===ps?"none":"",ks,"default"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"boiler"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"pump"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"oven"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"aircon"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,!1===as||!1===ps||2===ps?"none":"",Ts,1!==us&&2!==us||!1!==fs?"none":"",Je,1!==us&&2!==us||!0!==fs?"none":"",Je,1===us||2===us?"none":"",Je,(t=>this.handlePopup(t,se.entities.aux_connected_status)),"default"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"gen"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"inverter"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"oven"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"boiler"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"aircon"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"pump"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),!1===fs?"none":"",ms,"on"===ls||"1"===ls?"aux-icon":"aux-off-icon","boiler"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"boiler"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"boiler"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"boiler"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"boiler"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"boiler"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"aircon"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"aircon"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"aircon"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"aircon"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"aircon"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"aircon"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"pump"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"pump"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"pump"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"pump"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"pump"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"pump"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"oven"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"oven"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"oven"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"oven"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"oven"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"oven"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,!1===us||1===us?"none":"",!0===fs?"350":"383",!0===fs?"140":"5",Ms,!1===us||1===us?"none":"",!0===fs?"446":"420",!0===fs?"140":"5",bs,!1===us||2===us?"none":"","336",!0===fs?"140":"27",Ms,(t=>this.handlePopup(t,se.entities.use_timer_248)),0!=Es?"60.5%":"65%","on"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"60.5%":"65%","off"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","on"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","off"==He.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&!1!==se.show_solar?"":"none",xs,(t=>this.handlePopup(t,se.entities.priority_load_243)),0!=Es?"65.5%":"70%","off"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"65.5%":"70%","on"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","on"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","off"===Ae.state&&!1!==Vs?"":"none",Ls,!1===Ke?"":"st12",(t=>this.handlePopup(t,Qs.entityID)),0!=Es?"60.5%":"65%",!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"st12":"",Ls,0!=Es?"60.5%":"65%",!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||0!=As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||!1===As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,As,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===ss||!1===fs?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===us?"83%":"67%",!1===us?"15%":"21%",!1===ss||!0===fs?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===as?"68%":"76%",!1===as?"92.5%":"62.5%",!1===vs?"none":"",ns,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===as?"68%":"76%",!1===as?"84.25%":"54.5%",!1===_s?"none":"",ns,parseFloat(Ce.state).toFixed(1)||0,(null===(ot=se.entities)||void 0===ot?void 0:ot.pv_total)?N(kt||(kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):N(Mt||(Mt=e([' '," W "])),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.essential_power?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===Hs?"st14":"st4",Je,js||"0"):N(At||(At=e([''," W"])),!1===Hs?"st14":"st4",Je,js||0),"none"!==se.entities.nonessential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.nonessential_power)),!1===as?"none":"",!1===Hs?"st14":"st4",ns,Ns||0):N(Zt||(Zt=e([''," W "])),!1===as?"none":"",!1===Hs?"st14":"st4",ns,Ns||0),(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===Hs?"st14":"st4",ns,Xe||0,"none"!==se.entities.aux_power_166?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.aux_power_166)),!1===Hs?"st14":"st4",!1===fs?"none":"",ts,Ge<0?-1*Ge:Ge):N(Et||(Et=e([''," W "])),!1===Hs?"st14":"st4",!1===fs?"none":"",ts,Ge<0?-1*Ge:Ge),"none"!==se.entities.pv1_power_186?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):N(Vt||(Vt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):N(St||(St=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",!1===Hs?"st14":"st4",ns,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",!1===Hs?"st14":"st4",ns,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",!1===Hs?"st14":"st4",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===Hs?"st14":"st4",cs,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===Qs.show||"none"===se.entities.battery_soc_184?"none":"",Qs.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===Hs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===Hs?"st14":"st4",Se.state||0,(t=>this.handlePopup(t,se.entities.inverter_power_175)),"none"===se.entities.inverter_power_175?"none":"",!1===Hs?"st14":"st4",Ls,ke.state||0,(t=>this.handlePopup(t,se.entities.grid_power_169)),"none"===se.entities.grid_power_169?"none":"",!1===Hs?"st14":"st4",ns,Me.state||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(lt=se.entities)||void 0===lt?void 0:lt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),4===(null===(rt=se.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=se.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(dt=se.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(ct=se.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",je.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",ns,(null===(pt=se.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",ze.state||""):"lite"===se.cardstyle?j(jt||(jt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,!1===se.show_solar?145.33:-.5,!1===se.show_solar?270.67:406,"".concat(!1===Zs?!1===se.show_solar?"246px":"".concat(Cs):!1===se.show_solar?"75%":"100%"),Je,xs,!1===se.show_solar?"st12":"",ys,ns,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",Je,1===us&&!0===se.show_solar?"":"none",Je,2===us&&!0===se.show_solar?"":"none",Je,2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",0===se.battery.energy||!0===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||!0===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||Is>=0||!0===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||!1===Js?"transparent":"".concat(ys),ft("common.battery_floating"),!1===gs?"transparent":"".concat(ys),!1===gs?"transparent":"".concat(ys),2===us?"365":"400.4",2===us?"182.2":"282.1",!1===ss?"transparent":"".concat(Je),ft("common.daily_load"),!1===vs?"transparent":"".concat(ns),ft("common.daily_grid_buy"),!1===_s?"transparent":"".concat(ns),ft("common.daily_grid_sell"),!1===ws||!1===se.show_solar||0!=As?"transparent":"".concat(xs),ft("common.daily_solar"),!1===ws||!1===se.show_solar||!1===As?"transparent":"".concat(xs),!1===se.show_solar?"none":"",xs,(null===(vt=se.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(_t=se.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(yt=se.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(gt=se.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(se.solar.pv4_name):"PV4",!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,an,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,on,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hn,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,dn,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,ft("common.ratio"),1===us&&!0===se.show_solar?"":"none",Je,(null===(xt=se.load)||void 0===xt?void 0:xt.load1_name)?"".concat(se.load.load1_name):"",1===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),2===us&&!0===se.show_solar?"":"none",Je,(null===(wt=se.load)||void 0===wt?void 0:wt.load1_name)?"".concat(se.load.load1_name):"",2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),2===us&&!0===se.show_solar?"":"none",Je,(null===(ut=se.load)||void 0===ut?void 0:ut.load2_name)?"".concat(se.load.load2_name):"",2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),tn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),cn,ys,Is<0||0===Is?"transparent":"".concat(ys),pn,Is>0||0===Is?"transparent":"".concat(ys),pn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Fs?"transparent":"".concat(xs),cn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,Je,0===js?"transparent":"".concat(Je),vn,Je,0===js?"transparent":"".concat(Je),vn,1===us&&!0===se.show_solar?"":"st12",Je,2===us&&!0===se.show_solar?"":"st12",Je,2===us&&!0===se.show_solar?"":"st12",Je,"oven"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"oven"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"pump"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"pump"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"aircon"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"aircon"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"boiler"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"boiler"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,!1===us||!1===se.show_solar?"none":"",Ms,!1===us||1===us||!1===se.show_solar?"none":"",bs,!1===se.show_solar?"st12":"",xs,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Ss&&parseInt(_e.state)<=49?1:0,ys,parseInt(_e.state)<=Ss?1:0,ys,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===os||"0"===os?"st12":"",ns,"on"===os||"1"===os?"st12":"",is,Je,Ls,(t=>this.handlePopup(t,se.entities.use_timer_248)),"on"==He.state&&!1!==Ps?"":"none",Ls,"off"==He.state&&!1!==Ps?"":"none",Ls,"off"==He.state&&!1!==Ps?"":"none",Ls,"on"==He.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.priority_load_243)),"off"===Ae.state&&!1!==Vs?"":"none",Ls,"on"===Ae.state&&!1!==Vs?"":"none",Ls,"off"===Ae.state&&!1!==Vs?"":"none",Ls,"on"===Ae.state&&!1!==Vs?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&!1!==se.show_solar?"":"none",xs,!1===Ke?"":"st12",(t=>this.handlePopup(t,Qs.entityID)),!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"st12":"",Ls,!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||0!=As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||!1===As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,As,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),2===us?"365":"400.4",2===us?"168":"267.9",!1===ss?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===vs?"none":"",ns,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===_s?"none":"",ns,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",Ls,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",Ls,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===Hs?"st14":"st4",cs,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===Qs.show||"none"===se.entities.battery_soc_184?"none":"",Qs.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===Hs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===Hs?"st14":"st4",Se.state||0,(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===Hs?"st14":"st4",ns,Xe||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(mt=se.entities)||void 0===mt?void 0:mt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),"none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(qt=se.entities)||void 0===qt?void 0:qt.radiator_temp_91)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(Jt=se.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",je.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",ns,(null===(te=se.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=se.entities)||void 0===ee?void 0:ee.pv_total)?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):N(Dt||(Dt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.pv1_power_186?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):N(Ot||(Ot=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),"none"!==se.entities.essential_power?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===Hs?"st14":"st4",Je,js||0):N(Kt||(Kt=e([''," W"])),!1===Hs?"st14":"st4",Je,js||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ft("errors.cardstyle"));if(!t.show_solar)throw Error(ft("errors.show_solar"));if(!t.battery)throw Error(ft("errors.battery.bat"));if(!t.battery.energy)throw new Error(ft("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ft("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ft("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ft("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ft("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ft("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ft("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ft("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ft("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ft("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ft("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=Jt({},_t,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ft("common.description")})})); diff --git a/package.json b/package.json index 8a6959cb..f6e199eb 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dependencies": { "custom-card-helpers": "^1.9.0", "lit": "^2.8.0", + "lodash.merge": "^4.6.2", "npm": "^9.8.1", "typescript": "^5.1.6" }, diff --git a/src/defaults.ts b/src/defaults.ts index 83a8e468..db0eb0c1 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -1,7 +1,43 @@ export default { + large_font: false, + panel_mode: false, + card_height: '396px', battery: { - energy: 0 + energy: 0, + show_daily: false, + colour: 'pink', + full_capacity: 80, + empty_capacity: 30 + }, + grid: { + colour: '#5490c2', + no_grid_colour: '#a40013', + invert_grid: false, + show_nonessential: true, + show_daily_buy: false, + show_daily_sell: false, + nonessential_icon: 'default', + load1_icon: 'default', + load2_icon: 'default', + }, + inverter: { + modern: true, + colour: 'grey', + autarky: 'power' + }, + load: { + colour: '#5fb6ad', + show_daily: false, + show_aux: false, + invert_aux: false, + aux_type: 'default', + load1_icon: 'default', + load2_icon: 'default', + }, + solar: { + colour: 'orange', + show_daily: false } } diff --git a/src/index.ts b/src/index.ts index 246da96d..aecb16b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; import defaultConfig from './defaults'; import { CARD_VERSION } from './const'; import { localize } from './localize/localize'; +import merge from 'lodash.merge'; console.groupCollapsed( `%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ${localize('common.version')}: ${CARD_VERSION} `, @@ -116,7 +117,7 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj33 = this.hass.states[config.entities.day_grid_export_77] || { state: '0' }; const stateObj34 = this.hass.states[config.entities.nonessential_power] || { state: '0' }; const stateObj35 = this.hass.states[config.entities.battery_current_191] || { state: '0' }; - const stateObj36 = this.hass.states[config.entities.remaining_solar] || { state: '0' }; + const stateObj36 = this.hass.states[config.entities.remaining_solar] || { state: 0 }; const stateObj37 = this.hass.states[config.entities.battery_temp_182] || { state: '' }; const stateObj38 = this.hass.states[config.entities.dc_transformer_temp_90] || { state: '' }; const stateObj39 = this.hass.states[config.entities.radiator_temp_91] || { state: '' }; @@ -130,65 +131,61 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; //Set defaults - let invert_aux = config?.load?.invert_aux || false; + let invert_aux = config.load?.invert_aux; let aux_power = (invert_aux === true) ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); - let invert_grid = config?.grid?.invert_grid || false; + let invert_grid = config.grid?.invert_grid; let grid_power = (invert_grid === true) ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); - let inverter_modern = config?.inverter?.modern || true; - let load_colour = config?.load?.colour || '#5fb6ad'; - let aux_colour = config?.load?.aux_colour || load_colour; - let aux_off_colour = config?.load?.aux_off_colour || load_colour; - let load_showdaily = config?.load?.show_daily || false; - let grid_colour = config?.grid?.colour || '#5490c2'; - let no_grid_colour = config?.grid?.no_grid_colour || '#a40013'; - let grid_show_noness = config?.grid?.show_nonessential || true; - let grid_status = config?.entities?.grid_connected_status_194 ? stateObj20.state : 'on'; - let aux_status = config?.entities?.aux_connected_status ? stateObj47.state : 'on'; - let load_frequency = config?.entities?.load_frequency_192 ? stateObj6.state : 0; - let inverter_voltage = config?.entities?.inverter_voltage_154 ? stateObj5.state : 0; - let inverter_current = config?.entities?.inverter_current_164 ? stateObj7.state : 0; - let battery_voltage = config?.entities?.battery_voltage_183 ? stateObj11.state : 0; - - let noness_dual_load = config?.grid?.additional_loads; + let inverter_modern = config.inverter?.modern; + let load_colour = config.load?.colour; + let aux_colour = config.load?.aux_colour || load_colour; + let aux_off_colour = config.load?.aux_off_colour || load_colour; + let load_showdaily = config.load?.show_daily; + let grid_colour = config.grid?.colour; + let no_grid_colour = config.grid?.no_grid_colour; + let grid_show_noness = config.grid?.show_nonessential; + let grid_status = config.entities?.grid_connected_status_194 ? stateObj20.state : 'on'; + let aux_status = config.entities?.aux_connected_status ? stateObj47.state : 'on'; + let load_frequency = config.entities?.load_frequency_192 ? stateObj6.state : 0; + let inverter_voltage = config.entities?.inverter_voltage_154 ? stateObj5.state : 0; + let inverter_current = config.entities?.inverter_current_164 ? stateObj7.state : 0; + let battery_voltage = config.entities?.battery_voltage_183 ? stateObj11.state : 0; + + let noness_dual_load = config.grid?.additional_loads; if (noness_dual_load !== false && noness_dual_load !== 1 && noness_dual_load !== 2) { noness_dual_load = false; } - let grid_showdailybuy = config?.grid?.show_daily_buy || false; - let grid_showdailysell = config?.grid?.show_daily_sell || false; - let battery_colour = config?.battery?.colour || 'pink'; - let battery_showdaily = config?.battery?.show_daily || false; - let solar_colour = config?.solar?.colour || 'orange'; - let solar_showdaily = config?.solar?.show_daily || false; + let grid_showdailybuy = config.grid?.show_daily_buy; + let grid_showdailysell = config.grid?.show_daily_sell; + let battery_colour = config.battery?.colour; + let battery_showdaily = config.battery?.show_daily; + let solar_colour = config.solar?.colour; + let solar_showdaily = config.solar?.show_daily; + let show_aux = config.load?.show_aux; - let show_aux = config?.load?.show_aux; - if (show_aux !== false && show_aux !== true) { - show_aux = false; - } - - let additional_load = config?.load?.additional_loads; + let additional_load = config.load?.additional_loads; if (additional_load !== false && additional_load !== 1 && additional_load !== 2) { additional_load = false; } - let aux_type = config?.load?.aux_type || 'default'; //valid options are gen,inverter, default, gen, boiler, pump, aircon - let nonessential_icon = config?.grid?.nonessential_icon || 'default'; //valid options are default, oven, boiler, pump, aircon - let load1_icon = config?.grid?.load1_icon || 'default'; //valid options are default, oven, boiler, pump - let load2_icon = config?.grid?.load2_icon || 'default'; //valid options are default, oven, boiler, pump - let load1e_icon = config?.load?.load1_icon || 'default'; //valid options are boiler, aircon, pump - let load2e_icon = config?.load?.load2_icon || 'default'; //valid options are boiler, aircon, pump - let remaining_solar = config.entities.remaining_solar ? parseFloat(stateObj36.state).toFixed(1) : 'false'; - let font = config?.large_font || false; - let panel = config?.panel_mode || false; - let inverter_colour = config?.inverter?.colour || 'grey'; - let useautarky = config?.inverter?.autarky || 'power'; - let usetimer = (config?.entities.use_timer_248 === false || !config?.entities.use_timer_248) ? false : stateObj26.state; - let priority = (config?.entities.priority_load_243 === false || !config?.entities.priority_load_243) ? false : stateObj25.state; - let battery_power = (config?.battery?.invert_power === true) ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); - let height = config?.card_height || '396px' - let bat_full = config?.battery?.full_capacity || 80 - let bat_empty = config?.battery?.empty_capacity || 30 - //let width = config?.card_width || '100%' + let aux_type = config.load?.aux_type; //valid options are gen,inverter, default, gen, boiler, pump, aircon + let nonessential_icon = config.grid?.nonessential_icon; //valid options are default, oven, boiler, pump, aircon + let load1_icon = config.grid?.load1_icon; //valid options are default, oven, boiler, pump + let load2_icon = config.grid?.load2_icon; //valid options are default, oven, boiler, pump + let load1e_icon = config.load?.load1_icon; //valid options are boiler, aircon, pump + let load2e_icon = config.load?.load2_icon; //valid options are boiler, aircon, pump + let remaining_solar = config.entities.remaining_solar ? parseFloat(stateObj36.state).toFixed(1) : false; + let font = config.large_font; + let panel = config.panel_mode; + let inverter_colour = config.inverter?.colour; + let useautarky = config.inverter?.autarky; + let usetimer = (config.entities.use_timer_248 === false || !config.entities.use_timer_248) ? false : stateObj26.state; + let priority = (config.entities.priority_load_243 === false || !config.entities.priority_load_243) ? false : stateObj25.state; + let battery_power = (config.battery?.invert_power === true) ? parseInt(stateObj13.state) * -1 : parseInt(stateObj13.state); + let height = config.card_height; + let bat_full = config.battery?.full_capacity + let bat_empty = config.battery?.empty_capacity + //let width = config.card_width || '100%' //totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 let totalsolar = ( @@ -198,15 +195,15 @@ export class SunsynkPowerFlowCard extends LitElement { parseInt(parseFloat(stateObj32.state || '0').toFixed(0)) ); - let total_pv = config?.entities?.pv_total ? parseInt(stateObj46.state) : totalsolar; + let total_pv = config.entities?.pv_total ? parseInt(stateObj46.state) : totalsolar; //essential = inverter_power_175 + grid_power_169 - aux_power_166 - let essential = (config?.entities.essential_power === 'none' || !config?.entities.essential_power) ? + let essential = (config.entities.essential_power === 'none' || !config.entities.essential_power) ? parseInt(stateObj22.state) + parseInt(stateObj23.state) - parseInt(stateObj24.state) : parseInt(stateObj14.state); //nonessential = grid_ct_power_172 - grid_power_169 - let nonessential = (config?.entities.nonessential_power === 'none' || !config?.entities.nonessential_power) ? + let nonessential = (config.entities.nonessential_power === 'none' || !config.entities.nonessential_power) ? parseInt(stateObj15.state) - parseInt(stateObj23.state) : parseInt(stateObj34.state); @@ -349,7 +346,7 @@ export class SunsynkPowerFlowCard extends LitElement { duration += `${minutes} min`; } - let float = (-2 <= parseInt(stateObj35.state)) && (parseInt(stateObj35.state) <= 2) && (parseInt(stateObj12.state) >= 99) ? "True" : "False"; + let float = !!((-2 <= parseInt(stateObj35.state)) && (parseInt(stateObj35.state) <= 2) && (parseInt(stateObj12.state) >= 99)); //Set Inverter Status Message and dot let inverterStateColour = ""; @@ -383,7 +380,7 @@ export class SunsynkPowerFlowCard extends LitElement { inverterStateMsg = 'Fault'; break; default: - if (config?.entities?.inverter_status_59 === 'none' || !config?.entities?.inverter_status_59) { + if (config.entities?.inverter_status_59 === 'none' || !config.entities?.inverter_status_59) { inverterStateColour = 'transparent'; inverterStateMsg = ''; } else { @@ -414,37 +411,37 @@ export class SunsynkPowerFlowCard extends LitElement { let Ratiop = production_p != 0 ? Math.min(Math.round((consumption_p * 100) / production_p), 100) : 0; //Calculate power use animation speeds depending on Inverter size - let solar_animation_speed = config?.solar?.animation_speed || "9"; + let solar_animation_speed = config.solar?.animation_speed || "9"; if (config && config.solar && config.solar.animation_speed) { let speed = config.solar.animation_speed - ((config.solar.animation_speed - 1) * (totalsolar / (config.solar.max_power || totalsolar))); solar_animation_speed = `${speed >= 1 ? speed : 1}`; } - let battery_animation_speed = config?.battery?.animation_speed || "6"; + let battery_animation_speed = config.battery?.animation_speed || "6"; if (config && config.battery && config.battery.animation_speed) { let speed = config.battery.animation_speed - ((config.battery.animation_speed - 1) * ((battery_power < 0 ? battery_power * -1 : battery_power) / (config.battery.max_power || (battery_power < 0 ? battery_power * -1 : battery_power)))); battery_animation_speed = `${speed >= 1 ? speed : 1}`; } - let load_animation_speed = config?.load?.animation_speed || "4"; + let load_animation_speed = config.load?.animation_speed || "4"; if (config && config.load && config.load.animation_speed) { let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * (essential / (config.load.max_power || essential))); load_animation_speed = `${speed >= 1 ? speed : 1}`; } - let aux_animation_speed = config?.load?.animation_speed || "4"; + let aux_animation_speed = config.load?.animation_speed || "4"; if (config && config.load && config.load.animation_speed) { let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * ((parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state)) / (config.load.max_power || (parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state))))); aux_animation_speed = `${speed >= 1 ? speed : 1}`; } - let grid_animation_speed = config?.grid?.animation_speed || "8"; + let grid_animation_speed = config.grid?.animation_speed || "8"; if (config && config.grid && config.grid.animation_speed) { let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * ((parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state)) / (config.grid.max_power || (parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state))))); grid_animation_speed = `${speed >= 1 ? speed : 1}`; } - let ne_animation_speed = config?.grid?.animation_speed || "4"; + let ne_animation_speed = config.grid?.animation_speed || "4"; if (config && config.grid && config.grid.animation_speed) { let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * (nonessential / (config.grid.max_power || nonessential))); ne_animation_speed = `${speed >= 1 ? speed : 1}`; @@ -491,8 +488,8 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + @@ -501,37 +498,37 @@ export class SunsynkPowerFlowCard extends LitElement { - ${duration} - ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} - ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} - ${localize('common.battery_floating')} - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${duration} + ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} + ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} + ${localize('common.battery_floating')} + ${config.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} Grid ${inverterStateMsg} Essential Essential - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${config.load?.load2_name ? `${config.load.load2_name}` : ''} ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W ${localize('common.daily_load')} ${localize('common.daily_load')} - ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY + ${localize('common.daily_solar')} + DAILY SOLAR / LEFT TODAY ${localize('common.daily_charge')} ${localize('common.daily_discharge')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} - ${config?.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} - ${config?.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config?.grid?.load2_name ? `${config.grid.load2_name}` : ''} + ${config.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} + ${config.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} + ${config.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config.grid?.load1_name ? `${config.grid.load1_name}` : ''} + ${config.grid?.load2_name ? `${config.grid.load2_name}` : ''} ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W @@ -559,14 +556,14 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - - + + @@ -831,10 +828,10 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh @@ -855,7 +852,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh - ${config?.entities?.pv_total + ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> ${total_pv || 0} W ` @@ -891,14 +888,14 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -942,28 +939,28 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state || ''}° + ${stateObj37.state || ''}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state || ''}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state || ''}° + DC: ${stateObj38.state || ''}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state || ''} + ${stateObj43.state || ''}
@@ -988,38 +985,38 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} - ${localize('common.battery_floating')} + ${duration} + RUNTIME TO ${battery_capacity}% @${formattedResultTime} + TO ${battery_capacity}% CHARGE @${formattedResultTime} + ${localize('common.battery_floating')} DAILY CHARGE DAILY DISCHARGE ${localize('common.daily_load')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} - ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY - ${config?.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config?.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config?.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config?.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${localize('common.daily_solar')} + DAILY SOLAR / LEFT TODAY + ${config.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} + ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} + ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} + ${config.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} ${Autarky}% ${Ratio}% ${Autarkyp}% ${Ratiop}% Autarky ${localize('common.ratio')} - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config?.load?.load2_name ? `${config.load.load2_name}` : ''} + ${config.load?.load2_name ? `${config.load.load2_name}` : ''} ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W @@ -1036,14 +1033,14 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - - + + @@ -1168,10 +1165,10 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> ${parseFloat(stateObj.state).toFixed(1) || 0} kWh @@ -1225,30 +1222,30 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state || ''}° + ${stateObj37.state || ''}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state || ''}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state || ''}° + DC: ${stateObj38.state || ''}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state || ''} + ${stateObj43.state || ''} - ${config?.entities?.pv_total + ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> ${total_pv || 0} W ` @@ -1265,14 +1262,14 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential || 0} W @@ -1356,10 +1353,7 @@ export class SunsynkPowerFlowCard extends LitElement { const customConfig: sunsynkPowerFlowCardConfig = JSON.parse(JSON.stringify(config)); - this._config = { - ...defaultConfig, - ...customConfig, - }; + this._config = merge({}, defaultConfig, customConfig); } handlePopup(e, entity) { From fd5cd881c0d3afc793e99742ccfbecd624567daa Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Tue, 15 Aug 2023 11:40:59 +0100 Subject: [PATCH 08/40] refactor: add more defaults --- README.md | 53 +++++++++++--------- dist/sunsynk-power-flow-card.js | 8 +-- src/defaults.ts | 75 +++++++++++++++++++--------- src/index.ts | 86 ++++++++++++++++----------------- src/localize/languages/en.json | 15 +++++- src/types.ts | 65 +++++++++++++++++++++++++ 6 files changed, 208 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index b16b5888..2fadce65 100644 --- a/README.md +++ b/README.md @@ -27,22 +27,19 @@ An animated Home Assistant card to emulate the power flow that's shown on the Su ![image](https://github.com/slipx06/sunsynk-power-flow-card/assets/7227275/1c44a09b-2914-4cbd-919d-477789137acd) ![sunsynk-power-flow-lite](https://github.com/slipx06/sunsynk-power-flow-card/assets/7227275/ab615245-cee6-4502-b9bc-649566a6eb54) - *Lite Version* ![image](https://github.com/slipx06/sunsynk-power-flow-card/assets/7227275/1b381ecf-7205-44ea-baba-1b45925a81d6) ![sunsynk-power-flow-full](https://github.com/slipx06/sunsynk-power-flow-card/assets/7227275/bf119d16-b049-4bd9-8906-0c9697ab386d) - - - - *Full Version* ## Installation + The card can be installed manually or via HACS ### Manual Installation + 1. Create a new directory under `www` and name it `sunsynk-power-flow-card` e.g www/sunsynk-power-flow-card/ 2. Copy the `sunsynk-power-flow-card.js` into the directory 3. Add the resource to your Dashboard. You can append the filename with a `?ver=x` and increment x each time you download a new version to force a reload and avoid using a cached version. It is also a good idea to clear your browser cache. @@ -50,10 +47,12 @@ The card can be installed manually or via HACS ![image](https://user-images.githubusercontent.com/7227275/235441241-93ab0c7d-341d-428f-8ca8-60ec932dde2d.png) ### Installation using HACS + [![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg?style=for-the-badge)](https://my.home-assistant.io/redirect/hacs_repository/?repository=sunsynk-power-flow-card&category=plugin&owner=slipx06) You can add to HACS as a Custom Repo ## Usage + Add the `Custom: Sunsynk Power Flow Card` to your Dashboard view. ![image](https://user-images.githubusercontent.com/7227275/235375690-65d17663-e117-4626-9151-1a41979a13b8.png) @@ -65,10 +64,10 @@ The card can be configured through the following attributes: | Attribute | Requirement | Default |Description | | --- | --- | --- | --- | |type: | **Required** | `custom:sunsynk-power-flow-card`| The custom card | -|cardstyle: | **Required** | `lite` | Selects the card layout that is used `lite or full` | -|panel_mode:| Optional | `no` |Toggles panel mode removing any card height restrictions. For use with Panel(1 card) view types or grid layouts| -|large_font:| Optional | `no` | Increases font size of sensor data `yes/no`| -|show_solar:|**Required** |`yes` | Toggle display of solar information `yes/no`| +|cardstyle: | **Required** | `lite` | Selects the card layout that is used `lite` or `full` | +|panel_mode:| Optional | `false` |Toggles panel mode removing any card height restrictions. For use with Panel(1 card) view types or grid layouts| +|large_font:| Optional | `false` | Increases font size of sensor data | +|show_solar:|**Required** |`true` | Toggle display of solar information | |card_height:| Optional | `396px` | Sets the card height in pixels `400px` | |inverter: | Optional | See optional [Inverter](#inverter) attributes below |List of inverter attributes. | |battery: | **Required** |See required [Battery](#battery) attributes below | List of battery attributes. | @@ -78,35 +77,38 @@ The card can be configured through the following attributes: |entities:|**Required** |See required [Entities](#entities) attributes below | List of sensor entities. | ### Inverter + | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | -|modern:| Optional |`yes`| Changes the inverter image.| +|modern:| Optional |`true`| Changes the inverter image.| |colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| ### Battery + Note that the card will always display batter power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | |energy: | **Required** | `0` | Total Battery Energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| |shutdown_soc: | **Required** | `20` |The battery shutdown percentage used to calculate remaining runtime | -|invert_power:| Optional | `no`|Set to `yes` if your sensor provides a positive number for battery charge and negative number for battery discharge| +|invert_power:| Optional | `false`|Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge| |colour:| Optional| `pink`| Changes the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional| `no` | Toggles the Daily Total (`yes/no`) | +|show_daily: | Optional| `false` | Toggles the Daily Total | |animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `4500` | Maximun Power draw to calculate animation speed | |full_capacity: | Optional| `80` | If SOC >= to this value the Fully Charged battery image will be shown. Accepts any value between 80-100| |empty_capacity: | Optional | `30` | If SOC <= to this value the Empty battery image will be shown. Accepts any value between 1-30 ### Solar -These attributes are only needed if `show_solar` is set to `yes` + +These attributes are only needed if `show_solar` is set to `true` | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | |colour:| Optional | `orange` | Changes the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional | `no` | Toggles the Daily Total (`yes/no`) | -|mppts: | **Required** | `two` | Specify the number of MPPT's in use `one`, `two`, `three` or `four` | +|show_daily: | Optional | `false` | Toggles the Daily Total | +|mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3` or `4` | |animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | |pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | @@ -115,44 +117,47 @@ These attributes are only needed if `show_solar` is set to `yes` |pv4_name: | Optional | `PV4` | Set the disaply name for MPPT4 | ### Load + | Attribute | Requirement | Default | Description | | --- | --- | --- |--- | |colour:| Optional |`'#5fb6ad'`| Changes the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional |`no` | Toggles the Daily Total `yes/no` Only displayed if `show_aux` is set to `no` | -|show_aux: | Optional | `no` | Toggles the display of Aux (`yes/no`) | -|invert_aux: | Optional | `no` | Set to `yes` if your sensor provides a positive number for AUX input and negative number for AUX output | +|show_daily: | Optional |`false` | Toggles the Daily Total. Only displayed if `show_aux` is set to `true` | +|show_aux: | Optional | `false` | Toggles the display of Aux | +|invert_aux: | Optional | `false` | Set to `true` if your sensor provides a positive number for AUX input and negative number for AUX output | |animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | |aux_name: | Optional | `Auxilary` | Set the display name for the Auxilary Load |aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. |aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| additional_loads: | Optional | `no` | Display additional loads on the essential side (`one/two/no`) +| additional_loads: | Optional | `0` | Display additional loads on the essential side (`0/1/2`) | load1_name: | Optional | | Set the display name for the Essential Load 1 | load2_name: | Optional | | Set the display name for the Essential Load 2 | load1_icon: | Optional | none | Change the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | | load2_icon: | Optional | none | Change the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | ### Grid + | Attribute | Requirement | Default | Description | | --- | --- | --- | --- | |colour:| Optional | `'#5490c2'`| Changes the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |no_grid_colour:| Optional | `'#a40013'`|Changes the colour of the grid disconnected icon. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc)| -|show_daily_buy: | Optional | `no` | Toggles the Daily Buy Total (`yes/no`) | -|show_daily_sell: | Optional | `no` | Toggles the Daily Sell Total (`yes/no`) | -|show_nonessential: | Optional |`yes` | Toggles the display of Non-Essential (`yes/no`)| +|show_daily_buy: | Optional | `false` | Toggles the Daily Buy Total | +|show_daily_sell: | Optional | `false` | Toggles the Daily Sell Total | +|show_nonessential: | Optional |`false` | Toggles the display of Non-Essential | |nonessential_icon: | Optional | `default` | Change the nonessential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| |nonessential_name: | Optional | `Non Essential` |Set the display name for the Non-Essential Load -|additional_loads: | Optional |`no`| Toggle the display of additional loads on the non-essential side (`one/two/no`) +|additional_loads: | Optional |`0`| Toggle the display of additional loads on the non-essential side (`0/1/2`) |load1_name: | Optional | | Set the display name for the Non-Essential Load 1 |load2_name: | Optional | |Set the display name for the Non-Essential Load 2 |load1_icon: | Optional | `default` | Change the nonessential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | |load2_icon: | Optional | `default` | Change the nonessential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | -|invert_grid:| Optional | `no`| Set to `yes` if your sensor provides a negative number for Grid import and positive number for Grid export | +|invert_grid:| Optional | `false`| Set to `true` if your sensor provides a negative number for Grid import and positive number for Grid export | |animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | |max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | ### Entities + Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. It is important that your sensors read the expected modbus register value. If you have missing sensors for any attribute set it to none i.e. `day_pv_energy_108: none`. This will hide the sensor data from the card. To display a placeholder with a default value of 0 set it to `zero` or any other value i.e. `solarday_108: zero`. See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor mappings if using other integration methods. diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index f409de0b..1857c7df 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -9,13 +9,13 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const c=window,d=c.trustedTypes,p=d?d.emptyScript:"",v=c.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const u=window,m=u.trustedTypes,q=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,S=/"/g,F=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?S:B):o===S||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),z=new WeakMap,O=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const d=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+d):s+k+(-2===h?(n.push(void 0),e):d)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),O.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=O.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=z.get(t.strings);return void 0===e&&z.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function dt(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):ht(t,e) + */function ct(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):ht(t,e) /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={large_font:!1,panel_mode:!1,card_height:"396px",battery:{energy:0,show_daily:!1,colour:"pink",full_capacity:80,empty_capacity:30},grid:{colour:"#5490c2",no_grid_colour:"#a40013",invert_grid:!1,show_nonessential:!0,show_daily_buy:!1,show_daily_sell:!1,nonessential_icon:"default",load1_icon:"default",load2_icon:"default"},inverter:{modern:!0,colour:"grey",autarky:"power"},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,aux_type:"default",load1_icon:"default",load2_icon:"default"},solar:{colour:"orange",show_daily:!1}};var yt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio"},gt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},xt={common:yt,errors:gt};const wt={en:Object.freeze({__proto__:null,common:yt,default:xt,errors:gt})};function ft(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),wt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),wt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),wt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof ut&&ut&&ut.Object===Object&&ut,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,u=f&&f.exports===w,m=u&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=u?x.Buffer:void 0,F=x.Symbol,R=x.Uint8Array,j=S?S.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=F?F.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=S?S.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(u=l)&&At(u)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));wn[e]=new Date(xn.getTime()),wn[e].setHours(s),wn[e].setMinutes(n)}));const[fn,un,mn,qn,Tn,kn]=wn;function Mn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Qs.charge="none":Qs.charge="both",Qs.capacity=parseInt(t.capacity.state),Qs.entityID=e}xn>=kn||xn=fn&&xn=un&&xn=mn&&xn=qn&&xn=Tn&&xn0?Ws="off"===qe.state||!1===Qs.show||parseInt(_e.state)<=Qs.capacity?se.battery.shutdown_soc:Qs.capacity:Is<0&&("off"===qe.state||!1===Qs.show||parseInt(_e.state)>=Qs.capacity?Ws=100:parseInt(_e.state)0?Gs=(parseInt(_e.state)-Ws)/100*se.battery.energy/Is*60*60:Is<0&&(Gs=(Ws-parseInt(_e.state))/100*se.battery.energy/Is*60*60*-1);const bn=new Date,An=1e3*Gs,Hn=new Date(bn.getTime()+An),Zn=Hn.getHours(),Ln=Hn.getMinutes().toString().padStart(2,"0"),En=Zn.toString().padStart(2,"0");Xs="".concat(En,":").concat(Ln);const Pn=Math.floor(Gs/86400),Vn=Math.floor(Gs%86400/3600),In=Math.floor(Gs%3600/60);Pn>0&&(Ks+="".concat(Pn," days, ")),(Vn>0||Pn>0)&&(Ks+="".concat(Vn," hrs, ")),Ks+="".concat(In," min")}let Js=!!(-2<=parseInt(Se.state)&&parseInt(Se.state)<=2&&parseInt(_e.state)>=99),tn="",en="";switch(Te.state){case"0":case"standby":tn="blue",en="Standby";break;case"1":case"selftest":tn="yellow",en="Selftest";break;case"2":case"normal":case"ok":tn="green",en="Normal";break;case"3":case"alarm":tn="orange",en="Alarm";break;case"4":case"fault":tn="red",en="Fault";break;default:"none"!==(null===(F=se.entities)||void 0===F?void 0:F.inverter_status_59)&&(null===(R=se.entities)||void 0===R?void 0:R.inverter_status_59)?(tn="transparent",en="Status"):(tn="transparent",en="")}let sn=(isNaN(parseFloat(le.state))?0:parseFloat(le.state))+(isNaN(parseFloat(ne.state))?0:parseFloat(ne.state)),nn=(isNaN(parseFloat(ae.state))?0:parseFloat(ae.state))+(isNaN(parseFloat(ie.state))?0:parseFloat(ie.state)),an=0!=nn?Math.min(Math.round(100*sn/nn),100):0,on=0!=sn?Math.min(Math.round(100*nn/sn),100):0,ln=Fs+parseInt("".concat(Is>0?Is:0))+parseInt("".concat(Ge<0?-1*Ge:0)),rn=js+Ns+parseInt("".concat(Ge>0?Ge:0))+parseInt("".concat(Is<0?-1*Is:0)),hn=0!=rn?Math.min(Math.round(100*ln/rn),100):0,dn=0!=ln?Math.min(Math.round(100*rn/ln),100):0,cn=(null===(D=se.solar)||void 0===D?void 0:D.animation_speed)||"9";if(se&&se.solar&&se.solar.animation_speed){let Cn=se.solar.animation_speed-(se.solar.animation_speed-1)*(Fs/(se.solar.max_power||Fs));cn="".concat(Cn>=1?Cn:1)}let pn=(null===($=se.battery)||void 0===$?void 0:$.animation_speed)||"6";if(se&&se.battery&&se.battery.animation_speed){let Bn=se.battery.animation_speed-(se.battery.animation_speed-1)*((Is<0?-1*Is:Is)/(se.battery.max_power||(Is<0?-1*Is:Is)));pn="".concat(Bn>=1?Bn:1)}let vn=(null===(O=se.load)||void 0===O?void 0:O.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Sn=se.load.animation_speed-(se.load.animation_speed-1)*(js/(se.load.max_power||js));vn="".concat(Sn>=1?Sn:1)}let _n=(null===(z=se.load)||void 0===z?void 0:z.animation_speed)||"4";if(se&&se.load&&se.load.animation_speed){let Fn=se.load.animation_speed-(se.load.animation_speed-1)*((parseInt(be.state)<0?-1*parseInt(be.state):parseInt(be.state))/(se.load.max_power||(parseInt(be.state)<0?-1*parseInt(be.state):parseInt(be.state))));_n="".concat(Fn>=1?Fn:1)}let yn=(null===(U=se.grid)||void 0===U?void 0:U.animation_speed)||"8";if(se&&se.grid&&se.grid.animation_speed){let Rn=se.grid.animation_speed-(se.grid.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(se.grid.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn="".concat(Rn>=1?Rn:1)}let gn=(null===(Y=se.grid)||void 0===Y?void 0:Y.animation_speed)||"4";if(se&&se.grid&&se.grid.animation_speed){let jn=se.grid.animation_speed-(se.grid.animation_speed-1)*(Ns/(se.grid.max_power||Ns));gn="".concat(jn>=1?jn:1)}return"full"===se.cardstyle?j(Tt||(Tt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Je,Je,ts,es,ns,ns,!1===Zs?"".concat(Cs):"100%",xs,!1===se.show_solar?"st12":"",ys,ns,ns,ts,!1===fs?"st12":"",Je,Ls,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",ns,!1===as?"st12":"",1===ps?"":"none",ns,!1===as?"st12":"",2===ps?"":"none",ns,!1===as||1===ps?"st12":"",2===ps?"":"none",ns,!1===as||1===ps?"st12":"",!1===fs?"30":"143",Je,1===us?"":"none",!1===fs?"376":"373",!1===fs?"30":"143",Je,2===us?"":"none",!1===fs?"413":"410",!1===fs?"30":"143",Je,2===us?"":"none",!1===Hs?"st14":"st4",0===se.battery.energy||!0===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||!0===Js?"transparent":"".concat(ys),ft("common.runtime_to"),Ws,Xs,0===se.battery.energy||Is>=0||!0===Js?"transparent":"".concat(ys),ft("common.to"),Ws,ft("common.charge"),Xs,0===se.battery.energy||!1===Js?"transparent":"".concat(ys),ft("common.battery_floating"),!1===se.show_solar?"none":"",xs,(null===(Q=se.solar)||void 0===Q?void 0:Q.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(W=se.solar)||void 0===W?void 0:W.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(G=se.solar)||void 0===G?void 0:G.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(X=se.solar)||void 0===X?void 0:X.pv4_name)?"".concat(se.solar.pv4_name):"PV4",ns,Ls,en,1!==us&&2!==us||!0!==fs?"":"none",Je,!1===us||!1===fs?"none":"",Je,!1===fs?"70":"181",1===us?"":"none",Je,(null===(K=se.load)||void 0===K?void 0:K.load1_name)?"".concat(se.load.load1_name):"",!1===fs?"47":"158",1===us?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),!1===fs?"393":"390",!1===fs?"59":"172",2===us?"":"none",Je,(null===(J=se.load)||void 0===J?void 0:J.load1_name)?"".concat(se.load.load1_name):"",!1===fs?"394":"391",!1===fs?"42":"154",2===us?"":"none",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),!1===fs?"429":"426",!1===fs?"59":"172",2===us?"":"none",Je,(null===(tt=se.load)||void 0===tt?void 0:tt.load2_name)?"".concat(se.load.load2_name):"",!1===fs?"430":"427",!1===fs?"42":"154",2===us?"":"none",Je,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),!1===ss||!1===fs?"transparent":"".concat(Je),ft("common.daily_load"),!1===us?"83%":"67%",!1===us?"18.5%":"24.25%",!1===ss||!0===fs?"transparent":"".concat(Je),ft("common.daily_load"),!1===ws||!1===se.show_solar||0!=As?"transparent":"".concat(xs),ft("common.daily_solar"),!1===ws||!1===se.show_solar||!1===As?"transparent":"".concat(xs),!1===gs?"transparent":"".concat(ys),ft("common.daily_charge"),!1===gs?"transparent":"".concat(ys),ft("common.daily_discharge"),!1===as?"68%":"76%",!1===as?"96%":"66%",!1===vs?"transparent":"".concat(ns),ft("common.daily_grid_buy"),!1===as?"68%":"76%",!1===as?"88%":"58%",!1===_s?"transparent":"".concat(ns),ft("common.daily_grid_sell"),!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),(null===(et=se.load)||void 0===et?void 0:et.aux_name)?"".concat(se.load.aux_name):"Auxiliary",!1===as?"none":"",ns,(null===(st=se.grid)||void 0===st?void 0:st.nonessential_name)?"".concat(se.grid.nonessential_name):"Non Essential",!1===as||!1===ps||2===ps?"none":"",ns,(null===(nt=se.grid)||void 0===nt?void 0:nt.load1_name)?"".concat(se.grid.load1_name):"",!1===as||!1===ps||1===ps?"none":"",ns,(null===(it=se.grid)||void 0===it?void 0:it.load1_name)?"".concat(se.grid.load1_name):"",!1===as||!1===ps||1===ps?"none":"",ns,(null===(at=se.grid)||void 0===at?void 0:at.load2_name)?"".concat(se.grid.load2_name):"",!1===as||!1===ps||2===ps?"none":"",ns,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),!1===as||!1===ps||1===ps?"none":"",ns,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),!1===as||!1===ps||1===ps?"none":"",ns,isNaN(parseFloat($e.state))?0:parseFloat($e.state).toFixed(0),!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,an,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,on,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hn,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,dn,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,ft("common.ratio"),tn,!0===fs?"":"none",1===us||2===us?"":"st12",Je,!1===fs?"":"none",1===us?"":"st12",Je,!1===fs?"":"none",2===us?"":"st12",Je,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Fs?"transparent":"".concat(xs),cn,ys,Is<0||0===Is?"transparent":"".concat(ys),pn,Is>0||0===Is?"transparent":"".concat(ys),pn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn/2,Xe>0||0===Xe?"transparent":"".concat(ns),yn/2,ns,!1===as?"st12":"",!1===as?"st12":"",Ns<=0?"transparent":"".concat(ns),gn/2,ns,!1===as?"st12":"",!1===as?"st12":"",Ns<=0?"transparent":"".concat(ns),gn,!1===fs?"st12":"",ts,!1===fs||0===Ge?"st12":"",Ge<0?"transparent":"".concat(ts),_n,!1===fs||0===Ge?"st12":"",Ge>0?"transparent":"".concat(ts),_n,!1===fs?"st12":"",ts,ns,Ls,Je,0===js?"transparent":"".concat(Je),vn,Je,Ls,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Ss&&parseInt(_e.state)<=49?"1":"0",ys,parseInt(_e.state)<=Ss?1:0,ys,!1===se.show_solar?"st12":"",xs,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===os||"0"===os?"st12":"",ns,"on"===os||"1"===os?"st12":"",is,"default"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"oven"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"boiler"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"pump"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,"aircon"===qs?"1":"0",!1===as||2===ps||1===ps?"none":"",ns,!1===as||2===ps||1===ps?"none":"",qs,"default"===Ts&&"default"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"default"===Ts&&"default"!=ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"default"!=Ts&&"default"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"boiler"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"boiler"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"pump"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"pump"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"oven"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"oven"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"aircon"===Ts?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,"aircon"===ks?"1":"0",!1===as||!1===ps||1===ps?"none":"",ns,!1===as||!1===ps||1===ps?"none":"",Ts,!1===as||!1===ps||1===ps?"none":"",ks,"default"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"boiler"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"pump"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"oven"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,"aircon"===Ts?"1":"0",!1===as||!1===ps||2===ps?"none":"",ns,!1===as||!1===ps||2===ps?"none":"",Ts,1!==us&&2!==us||!1!==fs?"none":"",Je,1!==us&&2!==us||!0!==fs?"none":"",Je,1===us||2===us?"none":"",Je,(t=>this.handlePopup(t,se.entities.aux_connected_status)),"default"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"gen"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"inverter"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"oven"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"boiler"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"aircon"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),"pump"===ms?"":"st12",!1===fs?"none":"","".concat("on"===ls||"1"===ls?ts:es),!1===fs?"none":"",ms,"on"===ls||"1"===ls?"aux-icon":"aux-off-icon","boiler"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"boiler"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"boiler"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"boiler"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"boiler"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"boiler"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"aircon"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"aircon"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"aircon"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"aircon"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"aircon"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"aircon"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"pump"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"pump"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"pump"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"pump"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"pump"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,"pump"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"oven"===Ms&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"oven"===bs&&2===us?"1":"0",!1===fs||!1===us||1===us?"none":"",Je,"oven"===Ms&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"oven"===bs&&2===us&&!1===fs?"1":"0",!1===us||1===us?"none":"",Je,"oven"===Ms&&1===us&&!1===fs?"1":"0",!1===us||2===us?"none":"",Je,"oven"===Ms&&1===us?"1":"0",!1===fs||!1===us||2===us?"none":"",Je,!1===us||1===us?"none":"",!0===fs?"350":"383",!0===fs?"140":"5",Ms,!1===us||1===us?"none":"",!0===fs?"446":"420",!0===fs?"140":"5",bs,!1===us||2===us?"none":"","336",!0===fs?"140":"27",Ms,(t=>this.handlePopup(t,se.entities.use_timer_248)),0!=Es?"60.5%":"65%","on"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"60.5%":"65%","off"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","on"==He.state&&!1!==Ps?"":"none",Ls,0!=Es?"63.5%":"68%","off"==He.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"none"!==se.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&!1!==se.show_solar?"":"none",xs,(t=>this.handlePopup(t,se.entities.priority_load_243)),0!=Es?"65.5%":"70%","off"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"65.5%":"70%","on"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","on"===Ae.state&&!1!==Vs?"":"none",Ls,0!=Es?"68.5%":"73%","off"===Ae.state&&!1!==Vs?"":"none",Ls,!1===Ke?"":"st12",(t=>this.handlePopup(t,Qs.entityID)),0!=Es?"60.5%":"65%",!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"st12":"",Ls,0!=Es?"60.5%":"65%",!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||0!=As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||!1===As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,As,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===ss||!1===fs?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),!1===us?"83%":"67%",!1===us?"15%":"21%",!1===ss||!0===fs?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===as?"68%":"76%",!1===as?"92.5%":"62.5%",!1===vs?"none":"",ns,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===as?"68%":"76%",!1===as?"84.25%":"54.5%",!1===_s?"none":"",ns,parseFloat(Ce.state).toFixed(1)||0,(null===(ot=se.entities)||void 0===ot?void 0:ot.pv_total)?N(kt||(kt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):N(Mt||(Mt=e([' '," W "])),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.essential_power?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===Hs?"st14":"st4",Je,js||"0"):N(At||(At=e([''," W"])),!1===Hs?"st14":"st4",Je,js||0),"none"!==se.entities.nonessential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.nonessential_power)),!1===as?"none":"",!1===Hs?"st14":"st4",ns,Ns||0):N(Zt||(Zt=e([''," W "])),!1===as?"none":"",!1===Hs?"st14":"st4",ns,Ns||0),(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===Hs?"st14":"st4",ns,Xe||0,"none"!==se.entities.aux_power_166?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.aux_power_166)),!1===Hs?"st14":"st4",!1===fs?"none":"",ts,Ge<0?-1*Ge:Ge):N(Et||(Et=e([''," W "])),!1===Hs?"st14":"st4",!1===fs?"none":"",ts,Ge<0?-1*Ge:Ge),"none"!==se.entities.pv1_power_186?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):N(Vt||(Vt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):N(St||(St=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",!1===Hs?"st14":"st4",ns,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",!1===Hs?"st14":"st4",ns,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",!1===Hs?"st14":"st4",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===Hs?"st14":"st4",cs,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===Qs.show||"none"===se.entities.battery_soc_184?"none":"",Qs.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===Hs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===Hs?"st14":"st4",Se.state||0,(t=>this.handlePopup(t,se.entities.inverter_power_175)),"none"===se.entities.inverter_power_175?"none":"",!1===Hs?"st14":"st4",Ls,ke.state||0,(t=>this.handlePopup(t,se.entities.grid_power_169)),"none"===se.entities.grid_power_169?"none":"",!1===Hs?"st14":"st4",ns,Me.state||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(lt=se.entities)||void 0===lt?void 0:lt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),4===(null===(rt=se.solar)||void 0===rt?void 0:rt.mppts)?"30%":"34.5%",4===(null===(ht=se.solar)||void 0===ht?void 0:ht.mppts)?"58%":"40%","none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(dt=se.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(ct=se.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",je.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",ns,(null===(pt=se.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",ze.state||""):"lite"===se.cardstyle?j(jt||(jt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n RUNTIME TO ',"% @",'\n TO ',"% CHARGE @",'\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n DAILY SOLAR / LEFT TODAY\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Timer off\n Timer on\n \n \n \n \n Priority Batt\n Priority Load\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Je,!1===se.show_solar?145.33:-.5,!1===se.show_solar?270.67:406,"".concat(!1===Zs?!1===se.show_solar?"246px":"".concat(Cs):!1===se.show_solar?"75%":"100%"),Je,xs,!1===se.show_solar?"st12":"",ys,ns,xs,!1===se.show_solar?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",Je,1===us&&!0===se.show_solar?"":"none",Je,2===us&&!0===se.show_solar?"":"none",Je,2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",0===se.battery.energy||!0===Js||0===Is?"transparent":"".concat(ys),Ks,0===se.battery.energy||Is<=0||!0===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||Is>=0||!0===Js?"transparent":"".concat(ys),Ws,Xs,0===se.battery.energy||!1===Js?"transparent":"".concat(ys),ft("common.battery_floating"),!1===gs?"transparent":"".concat(ys),!1===gs?"transparent":"".concat(ys),2===us?"365":"400.4",2===us?"182.2":"282.1",!1===ss?"transparent":"".concat(Je),ft("common.daily_load"),!1===vs?"transparent":"".concat(ns),ft("common.daily_grid_buy"),!1===_s?"transparent":"".concat(ns),ft("common.daily_grid_sell"),!1===ws||!1===se.show_solar||0!=As?"transparent":"".concat(xs),ft("common.daily_solar"),!1===ws||!1===se.show_solar||!1===As?"transparent":"".concat(xs),!1===se.show_solar?"none":"",xs,(null===(vt=se.solar)||void 0===vt?void 0:vt.pv1_name)?"".concat(se.solar.pv1_name):"PV1",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,(null===(_t=se.solar)||void 0===_t?void 0:_t.pv2_name)?"".concat(se.solar.pv2_name):"PV2",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,(null===(yt=se.solar)||void 0===yt?void 0:yt.pv3_name)?"".concat(se.solar.pv3_name):"PV3",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,(null===(gt=se.solar)||void 0===gt?void 0:gt.pv4_name)?"".concat(se.solar.pv4_name):"PV4",!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,an,!1===Es?"none":"","energy"===Es?"st4 st8 left-align":"st12",Ls,on,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,hn,!1===Es?"none":"","power"===Es?"st4 st8 left-align":"st12",Ls,dn,!1===Es?"none":"",Ls,!1===Es?"none":"",Ls,ft("common.ratio"),1===us&&!0===se.show_solar?"":"none",Je,(null===(xt=se.load)||void 0===xt?void 0:xt.load1_name)?"".concat(se.load.load1_name):"",1===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),2===us&&!0===se.show_solar?"":"none",Je,(null===(wt=se.load)||void 0===wt?void 0:wt.load1_name)?"".concat(se.load.load1_name):"",2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Oe.state))?0:parseFloat(Oe.state).toFixed(0),2===us&&!0===se.show_solar?"":"none",Je,(null===(ut=se.load)||void 0===ut?void 0:ut.load2_name)?"".concat(se.load.load2_name):"",2===us&&!0===se.show_solar?"":"none",!1===Hs?"st14":"st4",Je,isNaN(parseFloat(Ye.state))?0:parseFloat(Ye.state).toFixed(0),tn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",parseInt(pe.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts?"st12":"",parseInt(ce.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"st12":"",parseInt(Ve.state)<=0?"transparent":"".concat(xs),cn,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",xs,!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"st12":"",parseInt(Ie.state)<=0?"transparent":"".concat(xs),cn,ys,Is<0||0===Is?"transparent":"".concat(ys),pn,Is>0||0===Is?"transparent":"".concat(ys),pn,!1===se.show_solar?"st12":"",xs,!1===se.show_solar?"st12":"",0===Fs?"transparent":"".concat(xs),cn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,ns,Xe<0||0===Xe?"transparent":"".concat(ns),yn,Xe>0||0===Xe?"transparent":"".concat(ns),yn,Je,0===js?"transparent":"".concat(Je),vn,Je,0===js?"transparent":"".concat(Je),vn,1===us&&!0===se.show_solar?"":"st12",Je,2===us&&!0===se.show_solar?"":"st12",Je,2===us&&!0===se.show_solar?"":"st12",Je,"oven"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"oven"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"pump"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"pump"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"aircon"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"aircon"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,"boiler"!==Ms||1!==us&&2!==us?"0":"1",!1===us||!1===se.show_solar?"none":"",Je,"boiler"===bs&&2===us?"1":"0",!1===us||!1===se.show_solar?"none":"",Je,!1===us||!1===se.show_solar?"none":"",Ms,!1===us||1===us||!1===se.show_solar?"none":"",bs,!1===se.show_solar?"st12":"",xs,parseInt(_e.state)>=Bs?1:0,ys,parseInt(_e.state)>=50&&parseInt(_e.state)Ss&&parseInt(_e.state)<=49?1:0,ys,parseInt(_e.state)<=Ss?1:0,ys,(t=>this.handlePopup(t,se.entities.grid_connected_status_194)),"off"===os||"0"===os?"st12":"",ns,"on"===os||"1"===os?"st12":"",is,Je,Ls,(t=>this.handlePopup(t,se.entities.use_timer_248)),"on"==He.state&&!1!==Ps?"":"none",Ls,"off"==He.state&&!1!==Ps?"":"none",Ls,"off"==He.state&&!1!==Ps?"":"none",Ls,"on"==He.state&&!1!==Ps?"":"none",Ls,(t=>this.handlePopup(t,se.entities.priority_load_243)),"off"===Ae.state&&!1!==Vs?"":"none",Ls,"on"===Ae.state&&!1!==Vs?"":"none",Ls,"off"===Ae.state&&!1!==Vs?"":"none",Ls,"on"===Ae.state&&!1!==Vs?"":"none",Ls,(t=>this.handlePopup(t,se.entities.solar_sell_247)),se.entities.solar_sell_247&&"off"!==Ue.state&&"0"!==Ue.state&&!1!==se.show_solar?"":"none",xs,se.entities.solar_sell_247&&"on"!==Ue.state&&"1"!==Ue.state&&!1!==se.show_solar?"":"none",xs,!1===Ke?"":"st12",(t=>this.handlePopup(t,Qs.entityID)),!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"st12":"",Ls,!1===Qs.show||"none"===se.entities.use_timer_248?"none":"","none"===Qs.charge?"":"st12",Ls,(t=>this.handlePopup(t,se.entities.day_battery_charge_70)),!1===gs?"none":"",ys,parseFloat(ie.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||0!=As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_pv_energy_108)),!1===ws||!1===se.show_solar||!1===As?"none":"",xs,parseFloat(le.state).toFixed(1)||0,As,(t=>this.handlePopup(t,se.entities.day_battery_discharge_71)),!1===gs?"none":"",ys,parseFloat(ne.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_load_energy_84)),2===us?"365":"400.4",2===us?"168":"267.9",!1===ss?"none":"",Je,parseFloat(ae.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_import_76)),!1===vs?"none":"",ns,parseFloat(oe.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.day_grid_export_77)),!1===_s?"none":"",ns,parseFloat(Ce.state).toFixed(1)||0,(t=>this.handlePopup(t,se.entities.inverter_voltage_154)),"none"!==se.entities.inverter_voltage_154&&se.entities.inverter_voltage_154?"":"none",Ls,hs,(t=>this.handlePopup(t,se.entities.load_frequency_192)),"none"!==se.entities.load_frequency_192&&se.entities.load_frequency_192?"":"none",Ls,rs,(t=>this.handlePopup(t,se.entities.inverter_current_164)),"none"!==se.entities.inverter_current_164&&se.entities.inverter_current_164?"":"none",Ls,ds,(t=>this.handlePopup(t,se.entities.battery_voltage_183)),"none"!==se.entities.battery_voltage_183&&se.entities.battery_voltage_183?"":"none",ys,!1===Hs?"st14":"st4",cs,(t=>this.handlePopup(t,se.entities.battery_soc_184)),"none"===se.entities.battery_soc_184?"none":"",ys,parseInt(_e.state)||0,(t=>this.handlePopup(t,se.entities.battery_soc_184)),ys,!1===Qs.show||"none"===se.entities.battery_soc_184?"none":"",Qs.capacity||0,(t=>this.handlePopup(t,se.entities.battery_power_190)),"none"===se.entities.battery_power_190?"none":"",ys,!1===Hs?"st14":"st4",Is<0?-1*Is:Is,(t=>this.handlePopup(t,se.entities.battery_current_191)),"none"===se.entities.battery_current_191?"none":"",ys,!1===Hs?"st14":"st4",Se.state||0,(t=>this.handlePopup(t,se.entities.grid_ct_power_172)),"none"===se.entities.grid_ct_power_172?"none":"",!1===Hs?"st14":"st4",ns,Xe||0,(t=>this.handlePopup(t,se.entities.pv1_voltage_109)),!1!==se.show_solar&&se.entities.pv1_voltage_109&&"none"!==se.entities.pv1_voltage_109?"":"none",xs,we.state||0,(t=>this.handlePopup(t,se.entities.pv1_current_110)),!1!==se.show_solar&&se.entities.pv1_current_110&&"none"!==se.entities.pv1_current_110?"":"none",xs,fe.state||0,(t=>this.handlePopup(t,se.entities.pv2_voltage_111)),!1!==se.show_solar&&se.entities.pv2_voltage_111&&"none"!==se.entities.pv2_voltage_111&&1!==se.solar.mppts?"":"none",xs,ue.state||0,(t=>this.handlePopup(t,se.entities.pv2_current_112)),!1!==se.show_solar&&se.entities.pv2_current_112&&"none"!==se.entities.pv2_current_112&&1!==se.solar.mppts?"":"none",xs,me.state||0,(t=>this.handlePopup(t,se.entities.pv3_voltage_113)),!1!==se.show_solar&&se.entities.pv3_voltage_113&&"none"!==se.entities.pv3_voltage_113&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Ze.state||0,(t=>this.handlePopup(t,se.entities.pv3_current_114)),!1!==se.show_solar&&se.entities.pv3_current_114&&"none"!==se.entities.pv3_current_114&&1!==se.solar.mppts&&2!==se.solar.mppts?"":"none",xs,Le.state||0,(t=>this.handlePopup(t,se.entities.pv4_voltage_115)),!1!==se.show_solar&&se.entities.pv4_voltage_115&&"none"!==se.entities.pv4_voltage_115&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Ee.state||0,(t=>this.handlePopup(t,se.entities.pv4_current_116)),!1!==se.show_solar&&se.entities.pv4_current_116&&"none"!==se.entities.pv4_current_116&&1!==se.solar.mppts&&2!==se.solar.mppts&&3!==se.solar.mppts?"":"none",xs,Pe.state||0,(t=>this.handlePopup(t,se.entities.battery_temp_182)),"none"===se.entities.battery_temp_182?"st12":"st3 left-align",ys,(null===(mt=se.entities)||void 0===mt?void 0:mt.battery_temp_182)?"":"none",Re.state||"",(t=>this.handlePopup(t,se.entities.radiator_temp_91)),"none"===se.entities.radiator_temp_91?"st12":"st3 left-align",Ls,(null===(qt=se.entities)||void 0===qt?void 0:qt.radiator_temp_91)?"":"none",Ne.state||"",(t=>this.handlePopup(t,se.entities.dc_transformer_temp_90)),"none"===se.entities.dc_transformer_temp_90?"st12":"st3 left-align",Ls,(null===(Jt=se.entities)||void 0===Jt?void 0:Jt.dc_transformer_temp_90)?"":"none",je.state||"",(t=>this.handlePopup(t,se.entities.energy_cost)),"none"===se.entities.energy_cost?"st12":"st3 left-align",ns,(null===(te=se.entities)||void 0===te?void 0:te.energy_cost)?"":"none",ze.state||"",(null===(ee=se.entities)||void 0===ee?void 0:ee.pv_total)?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv_total)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0):N(Dt||(Dt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,Rs||0),"none"!==se.entities.pv1_power_186?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv1_power_186)),!1===Hs?"st14":"st4",!1===se.show_solar?"none":"",xs,parseFloat(pe.state).toFixed(0)||0):N(Ot||(Ot=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv1_power_186?"none":"",xs,parseFloat(pe.state).toFixed(0)||0),"none"!==se.entities.pv2_power_187?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv2_power_187)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv2_power_187||1===se.solar.mppts?"none":"",xs,parseFloat(ce.state).toFixed(0)||0),"none"!==se.entities.pv3_power_188?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv3_power_188)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv3_power_188||1===se.solar.mppts||2===se.solar.mppts?"none":"",xs,parseFloat(Ve.state).toFixed(0)||0),"none"!==se.entities.pv4_power_189?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.pv4_power_189)),!1===Hs?"st14":"st4",!1===se.show_solar||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===Hs?"st14":"st4",!1===se.show_solar||"none"===se.entities.pv4_power_189||1===se.solar.mppts||2===se.solar.mppts||3===se.solar.mppts?"none":"",xs,parseFloat(Ie.state).toFixed(0)||0),"none"!==se.entities.essential_power?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,se.entities.essential_power)),!1===Hs?"st14":"st4",Je,js||0):N(Kt||(Kt=e([''," W"])),!1===Hs?"st14":"st4",Je,js||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ft("errors.cardstyle"));if(!t.show_solar)throw Error(ft("errors.show_solar"));if(!t.battery)throw Error(ft("errors.battery.bat"));if(!t.battery.energy)throw new Error(ft("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ft("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ft("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ft("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ft("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ft("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ft("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ft("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ft("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ft("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ft("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=Jt({},_t,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ft("common.description")})})); + */}var dt,pt;null===(dt=window.HTMLSlotElement)||void 0===dt||dt.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={large_font:!1,panel_mode:!1,card_height:"396px",battery:{energy:0,show_daily:!1,colour:"pink",full_capacity:80,empty_capacity:30},grid:{colour:"#5490c2",no_grid_colour:"#a40013",invert_grid:!1,show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),load1_icon:"default",load2_icon:"default"},inverter:{modern:!0,colour:"grey",autarky:"power"},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,aux_type:"default",aux_name:wt("common.aux_name"),load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},solar:{colour:"orange",show_daily:!1,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")}};var mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ut(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",c="[object Proxy]",d="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof mt&&mt&&mt.Object===Object&&mt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,z=A.splice,O=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function ct(t){return null==t?void 0===t?d:r:O&&O in Object(t)?function(t){var e=P.call(t,O),s=t[O];try{t[O]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[O]=s:delete t[O]);return i}(t):function(t){return I.call(t)}(t)}function dt(t){return Pt(t)&&ct(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ut(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),c=o.get(r);if(c)return void it(t,s,c);var d=a?a(l,r,s+"",t,e,o):void 0,p=void 0===d;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);d=r,v||_||y?bt(l)?d=l:Pt(m=l)&&At(m)?d=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=dt(function(){return arguments}())?dt:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=ct(t);return e==o||e==l||e==a||e==c}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[ct(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));on[e]=new Date(an.getTime()),on[e].setHours(s),on[e].setMinutes(n)}));const[ln,rn,hn,cn,dn,pn]=on;function vn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Cs.charge="none":Cs.charge="both",Cs.capacity=parseInt(t.capacity.state),Cs.entityID=e}an>=pn||an=ln&&an=rn&&an=hn&&an=cn&&an=dn&&an0?Fs="off"===ce.state||!1===Cs.show||parseInt(se.state)<=Cs.capacity?vt.battery.shutdown_soc:Cs.capacity:qs<0&&("off"===ce.state||!1===Cs.show||parseInt(se.state)>=Cs.capacity?Fs=100:parseInt(se.state)0?Ss=(parseInt(se.state)-Fs)/100*vt.battery.energy/qs*60*60:qs<0&&(Ss=(Fs-parseInt(se.state))/100*vt.battery.energy/qs*60*60*-1);const _n=new Date,yn=1e3*Ss,gn=new Date(_n.getTime()+yn),xn=gn.getHours(),wn=gn.getMinutes().toString().padStart(2,"0"),fn=xn.toString().padStart(2,"0");Rs="".concat(fn,":").concat(wn);const mn=Math.floor(Ss/86400),un=Math.floor(Ss%86400/3600),qn=Math.floor(Ss%3600/60);mn>0&&(js+="".concat(mn," days, ")),(un>0||mn>0)&&(js+="".concat(un," hrs, ")),js+="".concat(qn," min")}let Ns=!!(-2<=parseInt(Me.state)&&parseInt(Me.state)<=2&&parseInt(se.state)>=99),Ds="",$s="";switch(de.state){case"0":case"standby":Ds="blue",$s="Standby";break;case"1":case"selftest":Ds="yellow",$s="Selftest";break;case"2":case"normal":case"ok":Ds="green",$s="Normal";break;case"3":case"alarm":Ds="orange",$s="Alarm";break;case"4":case"fault":Ds="red",$s="Fault";break;default:"none"!==(null===(S=vt.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=vt.entities)||void 0===R?void 0:R.inverter_status_59)?(Ds="transparent",$s="Status"):(Ds="transparent",$s="")}let zs=(isNaN(parseFloat(ft.state))?0:parseFloat(ft.state))+(isNaN(parseFloat(_t.state))?0:parseFloat(_t.state)),Os=(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),Us=0!=Os?Math.min(Math.round(100*zs/Os),100):0,Ys=0!=zs?Math.min(Math.round(100*Os/zs),100):0,Qs=bs+parseInt("".concat(qs>0?qs:0))+parseInt("".concat(Se<0?-1*Se:0)),Ws=Hs+Zs+parseInt("".concat(Se>0?Se:0))+parseInt("".concat(qs<0?-1*qs:0)),Gs=0!=Ws?Math.min(Math.round(100*Qs/Ws),100):0,Xs=0!=Qs?Math.min(Math.round(100*Ws/Qs),100):0,Ks=(null===(D=vt.solar)||void 0===D?void 0:D.animation_speed)||"9";if(vt&&vt.solar&&vt.solar.animation_speed){let Tn=vt.solar.animation_speed-(vt.solar.animation_speed-1)*(bs/(vt.solar.max_power||bs));Ks="".concat(Tn>=1?Tn:1)}let Js=(null===($=vt.battery)||void 0===$?void 0:$.animation_speed)||"6";if(vt&&vt.battery&&vt.battery.animation_speed){let kn=vt.battery.animation_speed-(vt.battery.animation_speed-1)*((qs<0?-1*qs:qs)/(vt.battery.max_power||(qs<0?-1*qs:qs)));Js="".concat(kn>=1?kn:1)}let tn=(null===(z=vt.load)||void 0===z?void 0:z.animation_speed)||"4";if(vt&&vt.load&&vt.load.animation_speed){let Mn=vt.load.animation_speed-(vt.load.animation_speed-1)*(Hs/(vt.load.max_power||Hs));tn="".concat(Mn>=1?Mn:1)}let en=(null===(O=vt.load)||void 0===O?void 0:O.animation_speed)||"4";if(vt&&vt.load&&vt.load.animation_speed){let bn=vt.load.animation_speed-(vt.load.animation_speed-1)*((parseInt(_e.state)<0?-1*parseInt(_e.state):parseInt(_e.state))/(vt.load.max_power||(parseInt(_e.state)<0?-1*parseInt(_e.state):parseInt(_e.state))));en="".concat(bn>=1?bn:1)}let sn=(null===(U=vt.grid)||void 0===U?void 0:U.animation_speed)||"8";if(vt&&vt.grid&&vt.grid.animation_speed){let An=vt.grid.animation_speed-(vt.grid.animation_speed-1)*((parseInt(ae.state)<0?-1*parseInt(ae.state):parseInt(ae.state))/(vt.grid.max_power||(parseInt(ae.state)<0?-1*parseInt(ae.state):parseInt(ae.state))));sn="".concat(An>=1?An:1)}let nn=(null===(Y=vt.grid)||void 0===Y?void 0:Y.animation_speed)||"4";if(vt&&vt.grid&&vt.grid.animation_speed){let Hn=vt.grid.animation_speed-(vt.grid.animation_speed-1)*(Zs/(vt.grid.max_power||Zs));nn="".concat(Hn>=1?Hn:1)}return"full"===vt.cardstyle?j(Tt||(Tt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ne,Ne,De,$e,Oe,Oe,!1===xs?"".concat(Ts):"100%",as,!1===vt.show_solar?"st12":"",ns,Oe,Oe,De,!1===ls?"st12":"",Ne,ws,as,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",Oe,!1===Ye?"st12":"",1===ts?"":"none",Oe,!1===Ye?"st12":"",2===ts?"":"none",Oe,!1===Ye||1===ts?"st12":"",2===ts?"":"none",Oe,!1===Ye||1===ts?"st12":"",!1===ls?"30":"143",Ne,1===rs?"":"none",!1===ls?"376":"373",!1===ls?"30":"143",Ne,2===rs?"":"none",!1===ls?"413":"410",!1===ls?"30":"143",Ne,2===rs?"":"none",!1===gs?"st14":"st4",0===vt.battery.energy||!0===Ns||0===qs?"transparent":"".concat(ns),js,0===vt.battery.energy||qs<=0||!0===Ns?"transparent":"".concat(ns),wt("common.runtime_to"),Fs,Rs,0===vt.battery.energy||qs>=0||!0===Ns?"transparent":"".concat(ns),wt("common.to"),Fs,wt("common.charge"),Rs,0===vt.battery.energy||!1===Ns?"transparent":"".concat(ns),wt("common.battery_floating"),!1===vt.show_solar?"none":"",as,vt.solar.pv1_name,!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,vt.solar.pv2_name,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,vt.solar.pv3_name,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,vt.solar.pv4_name,Oe,ws,$s,1!==rs&&2!==rs||!0!==ls?"":"none",Ne,!1===rs||!1===ls?"none":"",Ne,!1===ls?"70":"181",1===rs?"":"none",Ne,vt.load.load1_name,!1===ls?"47":"158",1===rs?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===ls?"393":"390",!1===ls?"59":"172",2===rs?"":"none",Ne,vt.load.load1_name,!1===ls?"394":"391",!1===ls?"42":"154",2===rs?"":"none",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===ls?"429":"426",!1===ls?"59":"172",2===rs?"":"none",Ne,vt.load.load2_name,!1===ls?"430":"427",!1===ls?"42":"154",2===rs?"":"none",Ne,isNaN(parseFloat(Be.state))?0:parseFloat(Be.state).toFixed(0),!1===ze||!1===ls?"transparent":"".concat(Ne),wt("common.daily_load"),!1===rs?"83%":"67%",!1===rs?"18.5%":"24.25%",!1===ze||!0===ls?"transparent":"".concat(Ne),wt("common.daily_load"),!1===os||!1===vt.show_solar||0!=ys?"transparent":"".concat(as),wt("common.daily_solar"),!1===os||!1===vt.show_solar||!1===ys?"transparent":"".concat(as),wt("common.daily_solar_left"),!1===is?"transparent":"".concat(ns),wt("common.daily_charge"),!1===is?"transparent":"".concat(ns),wt("common.daily_discharge"),!1===Ye?"68%":"76%",!1===Ye?"96%":"66%",!1===es?"transparent":"".concat(Oe),wt("common.daily_grid_buy"),!1===Ye?"68%":"76%",!1===Ye?"88%":"58%",!1===ss?"transparent":"".concat(Oe),wt("common.daily_grid_sell"),!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),vt.load.aux_name,!1===Ye?"none":"",Oe,vt.grid.nonessential_name,!1===Ye||!1===ts||2===ts?"none":"",Oe,vt.grid.load1_name,!1===Ye||!1===ts||1===ts?"none":"",Oe,vt.grid.load1_name,!1===Ye||!1===ts||1===ts?"none":"",Oe,vt.grid.load2_name,!1===Ye||!1===ts||2===ts?"none":"",Oe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),!1===Ye||!1===ts||1===ts?"none":"",Oe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),!1===Ye||!1===ts||1===ts?"none":"",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Us,!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Ys,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Gs,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Xs,!1===fs?"none":"",ws,!1===fs?"none":"",ws,wt("common.ratio"),Ds,!0===ls?"":"none",1===rs||2===rs?"":"st12",Ne,!1===ls?"":"none",1===rs?"":"st12",Ne,!1===ls?"":"none",2===rs?"":"st12",Ne,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",parseInt(te.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",parseInt(Jt.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",parseInt(qe.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",0===bs?"transparent":"".concat(as),Ks,ns,qs<0||0===qs?"transparent":"".concat(ns),Js,qs>0||0===qs?"transparent":"".concat(ns),Js,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn/2,Re>0||0===Re?"transparent":"".concat(Oe),sn/2,Oe,!1===Ye?"st12":"",!1===Ye?"st12":"",Zs<=0?"transparent":"".concat(Oe),nn/2,Oe,!1===Ye?"st12":"",!1===Ye?"st12":"",Zs<=0?"transparent":"".concat(Oe),nn,!1===ls?"st12":"",De,!1===ls||0===Se?"st12":"",Se<0?"transparent":"".concat(De),en,!1===ls||0===Se?"st12":"",Se>0?"transparent":"".concat(De),en,!1===ls?"st12":"",De,Oe,ws,Ne,0===Hs?"transparent":"".concat(Ne),tn,Ne,ws,parseInt(se.state)>=ks?1:0,ns,parseInt(se.state)>=50&&parseInt(se.state)Ms&&parseInt(se.state)<=49?"1":"0",ns,parseInt(se.state)<=Ms?1:0,ns,!1===vt.show_solar?"st12":"",as,(t=>this.handlePopup(t,vt.entities.grid_connected_status_194)),"off"===Qe||"0"===Qe?"st12":"",Oe,"on"===Qe||"1"===Qe?"st12":"",Ue,"default"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"oven"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"boiler"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"pump"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"aircon"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,!1===Ye||2===ts||1===ts?"none":"",cs,"default"===ds&&"default"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"default"===ds&&"default"!=ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"default"!=ds&&"default"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"boiler"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"boiler"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"pump"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"pump"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"oven"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"oven"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"aircon"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"aircon"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,!1===Ye||!1===ts||1===ts?"none":"",ds,!1===Ye||!1===ts||1===ts?"none":"",ps,"default"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"boiler"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"pump"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"oven"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"aircon"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,!1===Ye||!1===ts||2===ts?"none":"",ds,1!==rs&&2!==rs||!1!==ls?"none":"",Ne,1!==rs&&2!==rs||!0!==ls?"none":"",Ne,1===rs||2===rs?"none":"",Ne,(t=>this.handlePopup(t,vt.entities.aux_connected_status)),"default"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"gen"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"inverter"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"oven"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"boiler"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"aircon"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"pump"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),!1===ls?"none":"",hs,"on"===We||"1"===We?"aux-icon":"aux-off-icon","boiler"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"boiler"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"boiler"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"boiler"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"boiler"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"boiler"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"aircon"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"aircon"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"aircon"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"aircon"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"aircon"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"aircon"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"pump"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"pump"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"pump"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"pump"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"pump"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"pump"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"oven"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"oven"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"oven"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"oven"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"oven"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"oven"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,!1===rs||1===rs?"none":"",!0===ls?"350":"383",!0===ls?"140":"5",vs,!1===rs||1===rs?"none":"",!0===ls?"446":"420",!0===ls?"140":"5",_s,!1===rs||2===rs?"none":"","336",!0===ls?"140":"27",vs,(t=>this.handlePopup(t,vt.entities.use_timer_248)),0!=fs?"60.5%":"65%","on"==ge.state&&!1!==ms?"":"none",ws,0!=fs?"60.5%":"65%","off"==ge.state&&!1!==ms?"":"none",ws,0!=fs?"63.5%":"68%","on"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_on"),0!=fs?"63.5%":"68%","off"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_off"),(t=>this.handlePopup(t,vt.entities.solar_sell_247)),vt.entities.solar_sell_247&&"none"!==vt.entities.solar_sell_247&&"off"!==Ie.state&&"0"!==Ie.state&&!1!==vt.show_solar?"":"none",as,vt.entities.solar_sell_247&&"none"!==vt.entities.solar_sell_247&&"on"!==Ie.state&&"1"!==Ie.state&&!1!==vt.show_solar?"":"none",as,(t=>this.handlePopup(t,vt.entities.priority_load_243)),0!=fs?"65.5%":"70%","off"===ye.state&&!1!==us?"":"none",ws,0!=fs?"65.5%":"70%","on"===ye.state&&!1!==us?"":"none",ws,0!=fs?"68.5%":"73%","on"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_load"),0!=fs?"68.5%":"73%","off"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_batt"),!1===je?"":"st12",(t=>this.handlePopup(t,Cs.entityID)),0!=fs?"60.5%":"65%",!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"st12":"",ws,0!=fs?"60.5%":"65%",!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"":"st12",ws,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||0!=ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||!1===ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,ys,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),!1===ze||!1===ls?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),!1===rs?"83%":"67%",!1===rs?"15%":"21%",!1===ze||!0===ls?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_battery_charge_70)),!1===is?"none":"",ns,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_battery_discharge_71)),!1===is?"none":"",ns,parseFloat(_t.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_import_76)),!1===Ye?"68%":"76%",!1===Ye?"92.5%":"62.5%",!1===es?"none":"",Oe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_export_77)),!1===Ye?"68%":"76%",!1===Ye?"84.25%":"54.5%",!1===ss?"none":"",Oe,parseFloat(Te.state).toFixed(1)||0,(null===(Q=vt.entities)||void 0===Q?void 0:Q.pv_total)?N(kt||(kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv_total)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0):N(Mt||(Mt=e([' '," W "])),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0),"none"!==vt.entities.essential_power?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.essential_power)),!1===gs?"st14":"st4",Ne,Hs||"0"):N(At||(At=e([''," W"])),!1===gs?"st14":"st4",Ne,Hs||0),"none"!==vt.entities.nonessential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.nonessential_power)),!1===Ye?"none":"",!1===gs?"st14":"st4",Oe,Zs||0):N(Zt||(Zt=e([''," W "])),!1===Ye?"none":"",!1===gs?"st14":"st4",Oe,Zs||0),(t=>this.handlePopup(t,vt.entities.grid_ct_power_172)),"none"===vt.entities.grid_ct_power_172?"none":"",!1===gs?"st14":"st4",Oe,Re||0,"none"!==vt.entities.aux_power_166?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.aux_power_166)),!1===gs?"st14":"st4",!1===ls?"none":"",De,Se<0?-1*Se:Se):N(Et||(Et=e([''," W "])),!1===gs?"st14":"st4",!1===ls?"none":"",De,Se<0?-1*Se:Se),"none"!==vt.entities.pv1_power_186?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv1_power_186)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,parseFloat(te.state).toFixed(0)||0):N(Vt||(Vt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv1_power_186?"none":"",as,parseFloat(te.state).toFixed(0)||0),"none"!==vt.entities.pv2_power_187?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv2_power_187)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv2_power_187||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0),"none"!==vt.entities.pv3_power_188?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv3_power_188)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv3_power_188||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0),"none"!==vt.entities.pv4_power_189?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv4_power_189)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv4_power_189||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0),(t=>this.handlePopup(t,vt.entities.inverter_voltage_154)),"none"!==vt.entities.inverter_voltage_154&&vt.entities.inverter_voltage_154?"":"none",!1===gs?"st14":"st4",Oe,Xe,(t=>this.handlePopup(t,vt.entities.load_frequency_192)),"none"!==vt.entities.load_frequency_192&&vt.entities.load_frequency_192?"":"none",!1===gs?"st14":"st4",Oe,Ge,(t=>this.handlePopup(t,vt.entities.inverter_current_164)),"none"!==vt.entities.inverter_current_164&&vt.entities.inverter_current_164?"":"none",!1===gs?"st14":"st4",ws,Ke,(t=>this.handlePopup(t,vt.entities.battery_voltage_183)),"none"!==vt.entities.battery_voltage_183&&vt.entities.battery_voltage_183?"":"none",ns,!1===gs?"st14":"st4",Je,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),"none"===vt.entities.battery_soc_184?"none":"",ns,parseInt(se.state)||0,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),ns,!1===Cs.show||"none"===vt.entities.battery_soc_184?"none":"",Cs.capacity||0,(t=>this.handlePopup(t,vt.entities.battery_power_190)),"none"===vt.entities.battery_power_190?"none":"",ns,!1===gs?"st14":"st4",qs<0?-1*qs:qs,(t=>this.handlePopup(t,vt.entities.battery_current_191)),"none"===vt.entities.battery_current_191?"none":"",ns,!1===gs?"st14":"st4",Me.state||0,(t=>this.handlePopup(t,vt.entities.inverter_power_175)),"none"===vt.entities.inverter_power_175?"none":"",!1===gs?"st14":"st4",ws,pe.state||0,(t=>this.handlePopup(t,vt.entities.grid_power_169)),"none"===vt.entities.grid_power_169?"none":"",!1===gs?"st14":"st4",Oe,ve.state||0,(t=>this.handlePopup(t,vt.entities.pv1_voltage_109)),!1!==vt.show_solar&&vt.entities.pv1_voltage_109&&"none"!==vt.entities.pv1_voltage_109?"":"none",as,oe.state||0,(t=>this.handlePopup(t,vt.entities.pv1_current_110)),!1!==vt.show_solar&&vt.entities.pv1_current_110&&"none"!==vt.entities.pv1_current_110?"":"none",as,le.state||0,(t=>this.handlePopup(t,vt.entities.pv2_voltage_111)),!1!==vt.show_solar&&vt.entities.pv2_voltage_111&&"none"!==vt.entities.pv2_voltage_111&&1!==vt.solar.mppts?"":"none",as,re.state||0,(t=>this.handlePopup(t,vt.entities.pv2_current_112)),!1!==vt.show_solar&&vt.entities.pv2_current_112&&"none"!==vt.entities.pv2_current_112&&1!==vt.solar.mppts?"":"none",as,he.state||0,(t=>this.handlePopup(t,vt.entities.pv3_voltage_113)),!1!==vt.show_solar&&vt.entities.pv3_voltage_113&&"none"!==vt.entities.pv3_voltage_113&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,xe.state||0,(t=>this.handlePopup(t,vt.entities.pv3_current_114)),!1!==vt.show_solar&&vt.entities.pv3_current_114&&"none"!==vt.entities.pv3_current_114&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,we.state||0,(t=>this.handlePopup(t,vt.entities.pv4_voltage_115)),!1!==vt.show_solar&&vt.entities.pv4_voltage_115&&"none"!==vt.entities.pv4_voltage_115&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,fe.state||0,(t=>this.handlePopup(t,vt.entities.pv4_current_116)),!1!==vt.show_solar&&vt.entities.pv4_current_116&&"none"!==vt.entities.pv4_current_116&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,me.state||0,(t=>this.handlePopup(t,vt.entities.battery_temp_182)),"none"===vt.entities.battery_temp_182?"st12":"st3 left-align",ns,(null===(W=vt.entities)||void 0===W?void 0:W.battery_temp_182)?"":"none",Ae.state||"",(t=>this.handlePopup(t,vt.entities.radiator_temp_91)),4===(null===(G=vt.solar)||void 0===G?void 0:G.mppts)?"30%":"34.5%",4===(null===(X=vt.solar)||void 0===X?void 0:X.mppts)?"58%":"40%","none"===vt.entities.radiator_temp_91?"st12":"st3 left-align",ws,(null===(K=vt.entities)||void 0===K?void 0:K.radiator_temp_91)?"":"none",Ze.state||"",(t=>this.handlePopup(t,vt.entities.dc_transformer_temp_90)),"none"===vt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ws,(null===(J=vt.entities)||void 0===J?void 0:J.dc_transformer_temp_90)?"":"none",He.state||"",(t=>this.handlePopup(t,vt.entities.energy_cost)),"none"===vt.entities.energy_cost?"st12":"st3 left-align",Oe,(null===(tt=vt.entities)||void 0===tt?void 0:tt.energy_cost)?"":"none",Ve.state||""):"lite"===vt.cardstyle?j(jt||(jt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ne,!1===vt.show_solar?145.33:-.5,!1===vt.show_solar?270.67:406,"".concat(!1===xs?!1===vt.show_solar?"246px":"".concat(Ts):!1===vt.show_solar?"75%":"100%"),Ne,as,!1===vt.show_solar?"st12":"",ns,Oe,as,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",Ne,1===rs&&!0===vt.show_solar?"":"none",Ne,2===rs&&!0===vt.show_solar?"":"none",Ne,2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",0===vt.battery.energy||!0===Ns||0===qs?"transparent":"".concat(ns),js,0===vt.battery.energy||qs<=0||!0===Ns?"transparent":"".concat(ns),wt("common.runtime_to"),Fs,Rs,0===vt.battery.energy||qs>=0||!0===Ns?"transparent":"".concat(ns),wt("common.to"),Fs,wt("common.charge"),Rs,0===vt.battery.energy||!1===Ns?"transparent":"".concat(ns),wt("common.battery_floating"),!1===is?"transparent":"".concat(ns),wt("common.daily_charge"),!1===is?"transparent":"".concat(ns),wt("common.daily_discharge"),2===rs?"365":"400.4",2===rs?"182.2":"282.1",!1===ze?"transparent":"".concat(Ne),wt("common.daily_load"),!1===es?"transparent":"".concat(Oe),wt("common.daily_grid_buy"),!1===ss?"transparent":"".concat(Oe),wt("common.daily_grid_sell"),!1===os||!1===vt.show_solar||0!=ys?"transparent":"".concat(as),wt("common.daily_solar"),!1===os||!1===vt.show_solar||!1===ys?"transparent":"".concat(as),wt("common.daily_solar_left"),!1===vt.show_solar?"none":"",as,(null===(et=vt.solar)||void 0===et?void 0:et.pv1_name)?"".concat(vt.solar.pv1_name):"PV1",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,(null===(st=vt.solar)||void 0===st?void 0:st.pv2_name)?"".concat(vt.solar.pv2_name):"PV2",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,(null===(nt=vt.solar)||void 0===nt?void 0:nt.pv3_name)?"".concat(vt.solar.pv3_name):"PV3",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,(null===(it=vt.solar)||void 0===it?void 0:it.pv4_name)?"".concat(vt.solar.pv4_name):"PV4",!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Us,!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Ys,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Gs,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Xs,!1===fs?"none":"",ws,!1===fs?"none":"",ws,wt("common.ratio"),1===rs&&!0===vt.show_solar?"":"none",Ne,(null===(at=vt.load)||void 0===at?void 0:at.load1_name)?"".concat(vt.load.load1_name):"",1===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),2===rs&&!0===vt.show_solar?"":"none",Ne,(null===(ot=vt.load)||void 0===ot?void 0:ot.load1_name)?"".concat(vt.load.load1_name):"",2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),2===rs&&!0===vt.show_solar?"":"none",Ne,(null===(lt=vt.load)||void 0===lt?void 0:lt.load2_name)?"".concat(vt.load.load2_name):"",2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Be.state))?0:parseFloat(Be.state).toFixed(0),Ds,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",parseInt(te.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",parseInt(Jt.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",parseInt(qe.state)<=0?"transparent":"".concat(as),Ks,ns,qs<0||0===qs?"transparent":"".concat(ns),Js,qs>0||0===qs?"transparent":"".concat(ns),Js,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",0===bs?"transparent":"".concat(as),Ks,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Ne,0===Hs?"transparent":"".concat(Ne),tn,Ne,0===Hs?"transparent":"".concat(Ne),tn,1===rs&&!0===vt.show_solar?"":"st12",Ne,2===rs&&!0===vt.show_solar?"":"st12",Ne,2===rs&&!0===vt.show_solar?"":"st12",Ne,"oven"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"oven"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"pump"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"pump"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"aircon"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"aircon"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"boiler"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"boiler"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,!1===rs||!1===vt.show_solar?"none":"",vs,!1===rs||1===rs||!1===vt.show_solar?"none":"",_s,!1===vt.show_solar?"st12":"",as,parseInt(se.state)>=ks?1:0,ns,parseInt(se.state)>=50&&parseInt(se.state)Ms&&parseInt(se.state)<=49?1:0,ns,parseInt(se.state)<=Ms?1:0,ns,(t=>this.handlePopup(t,vt.entities.grid_connected_status_194)),"off"===Qe||"0"===Qe?"st12":"",Oe,"on"===Qe||"1"===Qe?"st12":"",Ue,Ne,ws,(t=>this.handlePopup(t,vt.entities.use_timer_248)),"on"==ge.state&&!1!==ms?"":"none",ws,"off"==ge.state&&!1!==ms?"":"none",ws,"off"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_off"),"on"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_on"),(t=>this.handlePopup(t,vt.entities.priority_load_243)),"off"===ye.state&&!1!==us?"":"none",ws,"on"===ye.state&&!1!==us?"":"none",ws,"off"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_batt"),"on"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_load"),(t=>this.handlePopup(t,vt.entities.solar_sell_247)),vt.entities.solar_sell_247&&"off"!==Ie.state&&"0"!==Ie.state&&!1!==vt.show_solar?"":"none",as,vt.entities.solar_sell_247&&"on"!==Ie.state&&"1"!==Ie.state&&!1!==vt.show_solar?"":"none",as,!1===je?"":"st12",(t=>this.handlePopup(t,Cs.entityID)),!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"st12":"",ws,!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"":"st12",ws,(t=>this.handlePopup(t,vt.entities.day_battery_charge_70)),!1===is?"none":"",ns,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||0!=ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||!1===ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,ys,(t=>this.handlePopup(t,vt.entities.day_battery_discharge_71)),!1===is?"none":"",ns,parseFloat(_t.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),2===rs?"365":"400.4",2===rs?"168":"267.9",!1===ze?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_import_76)),!1===es?"none":"",Oe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_export_77)),!1===ss?"none":"",Oe,parseFloat(Te.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.inverter_voltage_154)),"none"!==vt.entities.inverter_voltage_154&&vt.entities.inverter_voltage_154?"":"none",ws,Xe,(t=>this.handlePopup(t,vt.entities.load_frequency_192)),"none"!==vt.entities.load_frequency_192&&vt.entities.load_frequency_192?"":"none",ws,Ge,(t=>this.handlePopup(t,vt.entities.inverter_current_164)),"none"!==vt.entities.inverter_current_164&&vt.entities.inverter_current_164?"":"none",ws,Ke,(t=>this.handlePopup(t,vt.entities.battery_voltage_183)),"none"!==vt.entities.battery_voltage_183&&vt.entities.battery_voltage_183?"":"none",ns,!1===gs?"st14":"st4",Je,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),"none"===vt.entities.battery_soc_184?"none":"",ns,parseInt(se.state)||0,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),ns,!1===Cs.show||"none"===vt.entities.battery_soc_184?"none":"",Cs.capacity||0,(t=>this.handlePopup(t,vt.entities.battery_power_190)),"none"===vt.entities.battery_power_190?"none":"",ns,!1===gs?"st14":"st4",qs<0?-1*qs:qs,(t=>this.handlePopup(t,vt.entities.battery_current_191)),"none"===vt.entities.battery_current_191?"none":"",ns,!1===gs?"st14":"st4",Me.state||0,(t=>this.handlePopup(t,vt.entities.grid_ct_power_172)),"none"===vt.entities.grid_ct_power_172?"none":"",!1===gs?"st14":"st4",Oe,Re||0,(t=>this.handlePopup(t,vt.entities.pv1_voltage_109)),!1!==vt.show_solar&&vt.entities.pv1_voltage_109&&"none"!==vt.entities.pv1_voltage_109?"":"none",as,oe.state||0,(t=>this.handlePopup(t,vt.entities.pv1_current_110)),!1!==vt.show_solar&&vt.entities.pv1_current_110&&"none"!==vt.entities.pv1_current_110?"":"none",as,le.state||0,(t=>this.handlePopup(t,vt.entities.pv2_voltage_111)),!1!==vt.show_solar&&vt.entities.pv2_voltage_111&&"none"!==vt.entities.pv2_voltage_111&&1!==vt.solar.mppts?"":"none",as,re.state||0,(t=>this.handlePopup(t,vt.entities.pv2_current_112)),!1!==vt.show_solar&&vt.entities.pv2_current_112&&"none"!==vt.entities.pv2_current_112&&1!==vt.solar.mppts?"":"none",as,he.state||0,(t=>this.handlePopup(t,vt.entities.pv3_voltage_113)),!1!==vt.show_solar&&vt.entities.pv3_voltage_113&&"none"!==vt.entities.pv3_voltage_113&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,xe.state||0,(t=>this.handlePopup(t,vt.entities.pv3_current_114)),!1!==vt.show_solar&&vt.entities.pv3_current_114&&"none"!==vt.entities.pv3_current_114&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,we.state||0,(t=>this.handlePopup(t,vt.entities.pv4_voltage_115)),!1!==vt.show_solar&&vt.entities.pv4_voltage_115&&"none"!==vt.entities.pv4_voltage_115&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,fe.state||0,(t=>this.handlePopup(t,vt.entities.pv4_current_116)),!1!==vt.show_solar&&vt.entities.pv4_current_116&&"none"!==vt.entities.pv4_current_116&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,me.state||0,(t=>this.handlePopup(t,vt.entities.battery_temp_182)),"none"===vt.entities.battery_temp_182?"st12":"st3 left-align",ns,(null===(rt=vt.entities)||void 0===rt?void 0:rt.battery_temp_182)?"":"none",Ae.state||"",(t=>this.handlePopup(t,vt.entities.radiator_temp_91)),"none"===vt.entities.radiator_temp_91?"st12":"st3 left-align",ws,(null===(ht=vt.entities)||void 0===ht?void 0:ht.radiator_temp_91)?"":"none",Ze.state||"",(t=>this.handlePopup(t,vt.entities.dc_transformer_temp_90)),"none"===vt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ws,(null===(ct=vt.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",He.state||"",(t=>this.handlePopup(t,vt.entities.energy_cost)),"none"===vt.entities.energy_cost?"st12":"st3 left-align",Oe,(null===(dt=vt.entities)||void 0===dt?void 0:dt.energy_cost)?"":"none",Ve.state||"",(null===(pt=vt.entities)||void 0===pt?void 0:pt.pv_total)?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv_total)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0):N(Dt||(Dt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0),"none"!==vt.entities.pv1_power_186?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv1_power_186)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,parseFloat(te.state).toFixed(0)||0):N(zt||(zt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv1_power_186?"none":"",as,parseFloat(te.state).toFixed(0)||0),"none"!==vt.entities.pv2_power_187?N(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv2_power_187)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv2_power_187||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0),"none"!==vt.entities.pv3_power_188?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv3_power_188)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv3_power_188||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0),"none"!==vt.entities.pv4_power_189?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv4_power_189)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv4_power_189||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0),"none"!==vt.entities.essential_power?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.essential_power)),!1===gs?"st14":"st4",Ne,Hs||0):N(Kt||(Kt=e([''," W"])),!1===gs?"st14":"st4",Ne,Hs||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=Jt({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([ct()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([ct()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); diff --git a/src/defaults.ts b/src/defaults.ts index db0eb0c1..ca6d11a4 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -1,43 +1,74 @@ +import { localize } from "./localize/localize"; export default { - large_font: false, + cardstyle: 'lite', panel_mode: false, + large_font: false, + show_solar: true, card_height: '396px', + inverter: { + modern: true, + colour: 'grey', + autarky: 'power' + }, battery: { energy: 0, - show_daily: false, + shutdown_soc: 20, + invert_power: false, colour: 'pink', + show_daily: false, + animation_speed: 6, + max_power: 4500, full_capacity: 80, - empty_capacity: 30 - }, - grid: { - colour: '#5490c2', - no_grid_colour: '#a40013', - invert_grid: false, - show_nonessential: true, - show_daily_buy: false, - show_daily_sell: false, - nonessential_icon: 'default', - load1_icon: 'default', - load2_icon: 'default', + empty_capacity: 30, }, - inverter: { - modern: true, - colour: 'grey', - autarky: 'power' + solar: { + colour: 'orange', + show_daily: false, + mppts: 2, + animation_speed: 9, + max_power: 8000, + pv1_name: localize('common.pv1_name'), + pv2_name: localize('common.pv2_name'), + pv3_name: localize('common.pv3_name'), + pv4_name: localize('common.pv4_name'), }, load: { colour: '#5fb6ad', show_daily: false, show_aux: false, invert_aux: false, + animation_speed: 4, + max_power: 8000, + aux_name: localize('common.aux_name'), aux_type: 'default', + additional_loads: 0, load1_icon: 'default', load2_icon: 'default', + load1_name: localize('common.load1_name'), + load2_name: localize('common.load2_name'), + }, - solar: { - colour: 'orange', - show_daily: false - } + grid: { + colour: '#5490c2', + no_grid_colour: '#a40013', + show_daily_buy: false, + show_daily_sell: false, + show_nonessential: true, + nonessential_icon: 'default', + nonessential_name: localize('common.nonessential_name'), + additional_loads: 0, + load1_name: localize('common.load1_name'), + load2_name: localize('common.load2_name'), + load1_icon: 'default', + load2_icon: 'default', + invert_grid: false, + aimation_speed: 8, + max_power: 8000 + }, + } + +export const validNonEssDualLoadValues = [0,1,2] +export const validAdditionalLoadValues = [0,1,2] diff --git a/src/index.ts b/src/index.ts index aecb16b1..72ff2322 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import { customElement, property } from 'lit/decorators.js'; import { HomeAssistant } from 'custom-card-helpers'; import { styles } from './style'; import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; -import defaultConfig from './defaults'; +import defaultConfig, { validNonEssDualLoadValues } from './defaults'; import { CARD_VERSION } from './const'; import { localize } from './localize/localize'; import merge from 'lodash.merge'; @@ -151,8 +151,8 @@ export class SunsynkPowerFlowCard extends LitElement { let battery_voltage = config.entities?.battery_voltage_183 ? stateObj11.state : 0; let noness_dual_load = config.grid?.additional_loads; - if (noness_dual_load !== false && noness_dual_load !== 1 && noness_dual_load !== 2) { - noness_dual_load = false; + if (!validNonEssDualLoadValues.includes(noness_dual_load)) { + noness_dual_load = 0; } let grid_showdailybuy = config.grid?.show_daily_buy; @@ -164,8 +164,8 @@ export class SunsynkPowerFlowCard extends LitElement { let show_aux = config.load?.show_aux; let additional_load = config.load?.additional_loads; - if (additional_load !== false && additional_load !== 1 && additional_load !== 2) { - additional_load = false; + if (!validNonEssDualLoadValues.includes(additional_load)) { + additional_load = 0; } let aux_type = config.load?.aux_type; //valid options are gen,inverter, default, gen, boiler, pump, aircon @@ -411,40 +411,40 @@ export class SunsynkPowerFlowCard extends LitElement { let Ratiop = production_p != 0 ? Math.min(Math.round((consumption_p * 100) / production_p), 100) : 0; //Calculate power use animation speeds depending on Inverter size - let solar_animation_speed = config.solar?.animation_speed || "9"; + let solar_animation_speed = config.solar?.animation_speed; if (config && config.solar && config.solar.animation_speed) { let speed = config.solar.animation_speed - ((config.solar.animation_speed - 1) * (totalsolar / (config.solar.max_power || totalsolar))); - solar_animation_speed = `${speed >= 1 ? speed : 1}`; + solar_animation_speed = speed >= 1 ? speed : 1; } - let battery_animation_speed = config.battery?.animation_speed || "6"; + let battery_animation_speed = config.battery?.animation_speed; if (config && config.battery && config.battery.animation_speed) { let speed = config.battery.animation_speed - ((config.battery.animation_speed - 1) * ((battery_power < 0 ? battery_power * -1 : battery_power) / (config.battery.max_power || (battery_power < 0 ? battery_power * -1 : battery_power)))); - battery_animation_speed = `${speed >= 1 ? speed : 1}`; + battery_animation_speed = speed >= 1 ? speed : 1; } - let load_animation_speed = config.load?.animation_speed || "4"; + let load_animation_speed = config.load?.animation_speed; if (config && config.load && config.load.animation_speed) { let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * (essential / (config.load.max_power || essential))); - load_animation_speed = `${speed >= 1 ? speed : 1}`; + load_animation_speed = speed >= 1 ? speed : 1; } - let aux_animation_speed = config.load?.animation_speed || "4"; + let aux_animation_speed = config.load?.animation_speed; if (config && config.load && config.load.animation_speed) { let speed = config.load.animation_speed - ((config.load.animation_speed - 1) * ((parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state)) / (config.load.max_power || (parseInt(stateObj24.state) < 0 ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state))))); - aux_animation_speed = `${speed >= 1 ? speed : 1}`; + aux_animation_speed = speed >= 1 ? speed : 1; } - let grid_animation_speed = config.grid?.animation_speed || "8"; + let grid_animation_speed = config.grid?.animation_speed; if (config && config.grid && config.grid.animation_speed) { let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * ((parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state)) / (config.grid.max_power || (parseInt(stateObj15.state) < 0 ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state))))); - grid_animation_speed = `${speed >= 1 ? speed : 1}`; + grid_animation_speed = speed >= 1 ? speed : 1; } - let ne_animation_speed = config.grid?.animation_speed || "4"; + let ne_animation_speed = config.grid?.animation_speed; if (config && config.grid && config.grid.animation_speed) { let speed = config.grid.animation_speed - ((config.grid.animation_speed - 1) * (nonessential / (config.grid.max_power || nonessential))); - ne_animation_speed = `${speed >= 1 ? speed : 1}`; + ne_animation_speed = speed >= 1 ? speed : 1; } if (config.cardstyle === 'full') { @@ -502,33 +502,33 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} ${localize('common.battery_floating')} - ${config.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${config.solar.pv1_name} + ${config.solar.pv2_name} + ${config.solar.pv3_name} + ${config.solar.pv4_name} Grid ${inverterStateMsg} Essential Essential - ${config.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load.load1_name} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load.load1_name} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config.load?.load2_name ? `${config.load.load2_name}` : ''} + ${config.load.load2_name} ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W ${localize('common.daily_load')} ${localize('common.daily_load')} ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY + ${localize('common.daily_solar_left')} ${localize('common.daily_charge')} ${localize('common.daily_discharge')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} - ${config.load?.aux_name ? `${config.load.aux_name}` : 'Auxiliary'} - ${config.grid?.nonessential_name ? `${config.grid.nonessential_name}` : 'Non Essential'} - ${config.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config.grid?.load1_name ? `${config.grid.load1_name}` : ''} - ${config.grid?.load2_name ? `${config.grid.load2_name}` : ''} + ${config.load.aux_name} + ${config.grid.nonessential_name} + ${config.grid.load1_name} + ${config.grid.load1_name} + ${config.grid.load2_name} ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W @@ -808,8 +808,8 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - Timer On - Timer Off + ${localize('common.timer_on')} + ${localize('common.timer_off')} this.handlePopup(e, config.entities.solar_sell_247)}> @@ -818,8 +818,8 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.priority_load_243)}> - Priority Load - Priority Batt + ${localize('common.priority_load')} + ${localize('common.priority_batt')} @@ -992,16 +992,16 @@ export class SunsynkPowerFlowCard extends LitElement { ${duration} - RUNTIME TO ${battery_capacity}% @${formattedResultTime} - TO ${battery_capacity}% CHARGE @${formattedResultTime} + ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} + ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} ${localize('common.battery_floating')} - DAILY CHARGE - DAILY DISCHARGE + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} ${localize('common.daily_load')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} ${localize('common.daily_solar')} - DAILY SOLAR / LEFT TODAY + ${localize('common.daily_solar_left')} ${config.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} @@ -1143,14 +1143,14 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - Timer off - Timer on + ${localize('common.timer_off')} + ${localize('common.timer_on')} this.handlePopup(e, config.entities.priority_load_243)}> - Priority Batt - Priority Load + ${localize('common.priority_batt')} + ${localize('common.priority_load')} this.handlePopup(e, config.entities.solar_sell_247)}> diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index e83458dc..cb1125a5 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -10,9 +10,22 @@ "daily_grid_buy": "DAILY GRID BUY", "daily_grid_sell": "DAILY GRID SELL", "daily_solar": "DAILY SOLAR", + "daily_solar_left": "DAILY SOLAR / LEFT TODAY", "daily_charge": "DAILY CHARGE", "daily_discharge": "DAILY DISCHARGE", - "ratio": "Ratio" + "ratio": "Ratio", + "timer_off": "Timer off", + "timer_on": "Timer on", + "priority_batt": "Priority Batt", + "priority_load": "Priority Load", + "nonessential_name": "Non Essential", + "aux_name": "Auxiliary", + "load1_name": "", + "load2_name": "", + "pv1_name": "PV1", + "pv2_name": "PV2", + "pv3_name": "PV3", + "pv4_name": "PV3" }, "errors": { "cardstyle": "Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple", diff --git a/src/types.ts b/src/types.ts index 28dee699..c7705fb8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,6 +7,17 @@ declare global { } export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { + type: string; + cardstyle: string; + panel_mode: boolean; + large_font: boolean; + show_solar: boolean; + card_height: string; + inverter: { + modern: boolean; + colour: string; + autarky: string; + } battery: { energy: number; shutdown_soc: number; @@ -18,6 +29,60 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { full_capacity: number; empty_capacity: number; } + solar: { + colour: string; + show_daily: boolean; + mppts: number; + animation_speed: number; + max_power: number; + pv1_name: string; + pv2_name: string; + pv3_name: string; + pv4_name: string; + } + load: { + colour: string; + show_daily: boolean; + invert_aux: boolean; + animation_speed: number; + max_power: number; + aux_name: string; + aux_type: string; + aux_colour: string; + aux_off_colour: string; + additional_loads: number; + load1_name: string; + load2_name: string; + load1_icon: string; + load2_icon: string; + show_aux: boolean; + } + grid: { + colour: string; + no_grid_colour: string; + show_daily_buy: boolean; + show_daily_sell: boolean; + show_nonessential: boolean; + nonessential_icon: string; + nonessential_name: string; + additional_loads: number; + load1_name: string; + load2_name: string; + load1_icon: string; + load2_icon: string; + invert_grid: boolean; + animation_speed: number; + max_power: number; + + + + + + + + + } + } export interface inverterProg { From 35181d41f7b4ced4417c868b5b3a1e9be72ca90e Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Tue, 15 Aug 2023 14:45:22 +0100 Subject: [PATCH 09/40] refactor: add missing feature from main card --- README.md | 64 +++--- dist/sunsynk-power-flow-card.js | 8 +- src/defaults.ts | 8 +- src/index.ts | 396 +++++++++++++++++--------------- src/localize/languages/en.json | 2 +- src/types.ts | 5 + 6 files changed, 269 insertions(+), 214 deletions(-) diff --git a/README.md b/README.md index 2fadce65..88d890c8 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Sunsynk-Power-Flow-Card + An animated Home Assistant card to emulate the power flow that's shown on the Sunsynk Inverter screen. You can use this for Deye as well as other Inverters as long as you have the required sensor data. See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki) for integration methods and examples. [![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/slipx06/sunsynk-power-flow-card?style=for-the-badge) Buy Me A Coffee ## Features + * Option to switch between two card styles: `lite` or `full`. * Animated power flow based on positive/negative/zero sensor values with configurable dynamic speed. (Supports inverted battery, AUX and grid power). * Dynamic battery image based on SOC (empty->low->medium->high). @@ -84,7 +86,6 @@ The card can be configured through the following attributes: |colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| - ### Battery Note that the card will always display batter power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. @@ -130,6 +131,7 @@ These attributes are only needed if `show_solar` is set to `true` |aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. |aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|aux_loads:| Optional | `0` | Display additional loads on the AUX side (`0/1/2`) | additional_loads: | Optional | `0` | Display additional loads on the essential side (`0/1/2`) | load1_name: | Optional | | Set the display name for the Essential Load 1 | load2_name: | Optional | | Set the display name for the Essential Load 2 @@ -237,12 +239,13 @@ The card calculates the sensors below based on supplied attributes in the config nonessential = grid_ct_power_172 - grid_power_169 essential = inverter_power_175 + grid_power_169 - aux_power_166 ``` + The modbus registers can be visualised on the `full` card below: ![image](https://user-images.githubusercontent.com/7227275/235479493-b322d5b2-f2b1-431f-9048-f845fc2989b4.png) - ### Example Card Configuration + #### Minimum Configuration (No Solar) ##### ```yaml @@ -260,6 +263,7 @@ entities: battery_current_191: sensor.sunsynk_battery_current grid_ct_power_172: sensor.sunsynk_grid_ct_power ``` + #### Minimum Configuration (Solar) ##### ```yaml @@ -304,6 +308,7 @@ entities: grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status inverter_status_59: sensor.overall_state ``` + #### Minimal Configuration (Solar) ##### ```yaml @@ -337,23 +342,24 @@ entities: pv2_voltage_111: sensor.sunsynk_pv2_voltage pv2_current_112: sensor.sunsynk_pv2_current ``` -#### Minimum Configuration (Solar + Daily Totals) ##### + +#### Minimal Configuration (Solar + Daily Totals) ##### ```yaml type: custom:sunsynk-power-flow-card cardstyle: full -show_solar: 'yes' +show_solar: true solar: - mppts: two - show_daily: 'yes' + mppts: 2 + show_daily: true battery: energy: 15960 shutdown_soc: 20 - show_daily: 'yes' + show_daily: true load: - show_daily: 'yes' + show_daily: true grid: - show_daily_buy: 'yes' + show_daily_buy: true entities: inverter_voltage_154: sensor.sunsynk_inverter_voltage load_frequency_192: sensor.sunsynk_load_frequency @@ -379,32 +385,33 @@ entities: day_load_energy_84: sensor.sunsynk_day_load_energy day_grid_import_76: sensor.sunsynk_day_grid_import ``` + #### Full Configuration (All Options) ##### ```yaml type: custom:sunsynk-power-flow-card cardstyle: full -panel_mode: 'no' -large_font: 'no' -show_solar: 'yes' +panel_mode: false +large_font: false +show_solar: true inverter: - modern: 'yes' + modern: true colour: grey autarky: 'power' battery: energy: 15960 shutdown_soc: 20 - invert_power: 'no' + invert_power: false colour: pink - show_daily: 'yes' + show_daily: true animation_speed: 6 max_power: 4500 full_capacity: 80 empty_capacity: 30 solar: colour: orange - show_daily: 'yes' - mppts: two + show_daily: true + mppts: 2 animation_speed: 9 max_power: 8000 pv1_name: North @@ -413,30 +420,35 @@ solar: pv4_name: West load: colour: '#5fb6ad' - show_daily: 'yes' - show_aux: 'yes' - invert_aux: 'no' + show_daily: true + show_aux: true + invert_aux: false aux_name: Generator aux_type: gen aux_colour: green aux_off_colour: red + aux_loads: 2 + aux_load1_name: Aux load 1 + aux_load2_name: Aux load 2 + aux_load1_icon: mdi:air-filter + aux_load2_icon: mdi:stove animation_speed: 8 max_power: 8000 - additional_loads: two + additional_loads: 2 load1_name: Geyser load2_name: Pool load1_icon: boiler load2_icon: mdi:pool grid: colour: '#5490c2' - show_daily_buy: 'yes' - show_daily_sell: 'yes' + show_daily_buy: true + show_daily_sell: true no_grid_colour: '#a40013' - show_nonessential: 'yes' - invert_grid: 'no' + show_nonessential: true + invert_grid: false nonessential_name: Non Essential nonessential_icon: oven - additional_loads: two + additional_loads: 2 load1_name: Load 1 load2_name: Load 2 load1_icon: boiler diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 1857c7df..9e80c93a 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -9,13 +9,13 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const c=window,d=c.trustedTypes,p=d?d.emptyScript:"",v=c.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=c.reactiveElementVersions)&&void 0!==h?h:c.reactiveElementVersions=[]).push("1.6.3");const m=window,u=m.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),z=new WeakMap,O=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const d=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+d):s+k+(-2===h?(n.push(void 0),e):d)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),O.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=O.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=z.get(t.strings);return void 0===e&&z.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?F:B):o===F||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function ct(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):ht(t,e) + */function dt(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):ht(t,e) /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var dt,pt;null===(dt=window.HTMLSlotElement)||void 0===dt||dt.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={large_font:!1,panel_mode:!1,card_height:"396px",battery:{energy:0,show_daily:!1,colour:"pink",full_capacity:80,empty_capacity:30},grid:{colour:"#5490c2",no_grid_colour:"#a40013",invert_grid:!1,show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),load1_icon:"default",load2_icon:"default"},inverter:{modern:!0,colour:"grey",autarky:"power"},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,aux_type:"default",aux_name:wt("common.aux_name"),load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},solar:{colour:"orange",show_daily:!1,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")}};var mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ut(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",c="[object Proxy]",d="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof mt&&mt&&mt.Object===Object&&mt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,z=A.splice,O=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function ct(t){return null==t?void 0===t?d:r:O&&O in Object(t)?function(t){var e=P.call(t,O),s=t[O];try{t[O]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[O]=s:delete t[O]);return i}(t):function(t){return I.call(t)}(t)}function dt(t){return Pt(t)&&ct(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ut(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),c=o.get(r);if(c)return void it(t,s,c);var d=a?a(l,r,s+"",t,e,o):void 0,p=void 0===d;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);d=r,v||_||y?bt(l)?d=l:Pt(m=l)&&At(m)?d=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=dt(function(){return arguments}())?dt:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=ct(t);return e==o||e==l||e==a||e==c}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[ct(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));on[e]=new Date(an.getTime()),on[e].setHours(s),on[e].setMinutes(n)}));const[ln,rn,hn,cn,dn,pn]=on;function vn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Cs.charge="none":Cs.charge="both",Cs.capacity=parseInt(t.capacity.state),Cs.entityID=e}an>=pn||an=ln&&an=rn&&an=hn&&an=cn&&an=dn&&an0?Fs="off"===ce.state||!1===Cs.show||parseInt(se.state)<=Cs.capacity?vt.battery.shutdown_soc:Cs.capacity:qs<0&&("off"===ce.state||!1===Cs.show||parseInt(se.state)>=Cs.capacity?Fs=100:parseInt(se.state)0?Ss=(parseInt(se.state)-Fs)/100*vt.battery.energy/qs*60*60:qs<0&&(Ss=(Fs-parseInt(se.state))/100*vt.battery.energy/qs*60*60*-1);const _n=new Date,yn=1e3*Ss,gn=new Date(_n.getTime()+yn),xn=gn.getHours(),wn=gn.getMinutes().toString().padStart(2,"0"),fn=xn.toString().padStart(2,"0");Rs="".concat(fn,":").concat(wn);const mn=Math.floor(Ss/86400),un=Math.floor(Ss%86400/3600),qn=Math.floor(Ss%3600/60);mn>0&&(js+="".concat(mn," days, ")),(un>0||mn>0)&&(js+="".concat(un," hrs, ")),js+="".concat(qn," min")}let Ns=!!(-2<=parseInt(Me.state)&&parseInt(Me.state)<=2&&parseInt(se.state)>=99),Ds="",$s="";switch(de.state){case"0":case"standby":Ds="blue",$s="Standby";break;case"1":case"selftest":Ds="yellow",$s="Selftest";break;case"2":case"normal":case"ok":Ds="green",$s="Normal";break;case"3":case"alarm":Ds="orange",$s="Alarm";break;case"4":case"fault":Ds="red",$s="Fault";break;default:"none"!==(null===(S=vt.entities)||void 0===S?void 0:S.inverter_status_59)&&(null===(R=vt.entities)||void 0===R?void 0:R.inverter_status_59)?(Ds="transparent",$s="Status"):(Ds="transparent",$s="")}let zs=(isNaN(parseFloat(ft.state))?0:parseFloat(ft.state))+(isNaN(parseFloat(_t.state))?0:parseFloat(_t.state)),Os=(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),Us=0!=Os?Math.min(Math.round(100*zs/Os),100):0,Ys=0!=zs?Math.min(Math.round(100*Os/zs),100):0,Qs=bs+parseInt("".concat(qs>0?qs:0))+parseInt("".concat(Se<0?-1*Se:0)),Ws=Hs+Zs+parseInt("".concat(Se>0?Se:0))+parseInt("".concat(qs<0?-1*qs:0)),Gs=0!=Ws?Math.min(Math.round(100*Qs/Ws),100):0,Xs=0!=Qs?Math.min(Math.round(100*Ws/Qs),100):0,Ks=(null===(D=vt.solar)||void 0===D?void 0:D.animation_speed)||"9";if(vt&&vt.solar&&vt.solar.animation_speed){let Tn=vt.solar.animation_speed-(vt.solar.animation_speed-1)*(bs/(vt.solar.max_power||bs));Ks="".concat(Tn>=1?Tn:1)}let Js=(null===($=vt.battery)||void 0===$?void 0:$.animation_speed)||"6";if(vt&&vt.battery&&vt.battery.animation_speed){let kn=vt.battery.animation_speed-(vt.battery.animation_speed-1)*((qs<0?-1*qs:qs)/(vt.battery.max_power||(qs<0?-1*qs:qs)));Js="".concat(kn>=1?kn:1)}let tn=(null===(z=vt.load)||void 0===z?void 0:z.animation_speed)||"4";if(vt&&vt.load&&vt.load.animation_speed){let Mn=vt.load.animation_speed-(vt.load.animation_speed-1)*(Hs/(vt.load.max_power||Hs));tn="".concat(Mn>=1?Mn:1)}let en=(null===(O=vt.load)||void 0===O?void 0:O.animation_speed)||"4";if(vt&&vt.load&&vt.load.animation_speed){let bn=vt.load.animation_speed-(vt.load.animation_speed-1)*((parseInt(_e.state)<0?-1*parseInt(_e.state):parseInt(_e.state))/(vt.load.max_power||(parseInt(_e.state)<0?-1*parseInt(_e.state):parseInt(_e.state))));en="".concat(bn>=1?bn:1)}let sn=(null===(U=vt.grid)||void 0===U?void 0:U.animation_speed)||"8";if(vt&&vt.grid&&vt.grid.animation_speed){let An=vt.grid.animation_speed-(vt.grid.animation_speed-1)*((parseInt(ae.state)<0?-1*parseInt(ae.state):parseInt(ae.state))/(vt.grid.max_power||(parseInt(ae.state)<0?-1*parseInt(ae.state):parseInt(ae.state))));sn="".concat(An>=1?An:1)}let nn=(null===(Y=vt.grid)||void 0===Y?void 0:Y.animation_speed)||"4";if(vt&&vt.grid&&vt.grid.animation_speed){let Hn=vt.grid.animation_speed-(vt.grid.animation_speed-1)*(Zs/(vt.grid.max_power||Zs));nn="".concat(Hn>=1?Hn:1)}return"full"===vt.cardstyle?j(Tt||(Tt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ne,Ne,De,$e,Oe,Oe,!1===xs?"".concat(Ts):"100%",as,!1===vt.show_solar?"st12":"",ns,Oe,Oe,De,!1===ls?"st12":"",Ne,ws,as,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",Oe,!1===Ye?"st12":"",1===ts?"":"none",Oe,!1===Ye?"st12":"",2===ts?"":"none",Oe,!1===Ye||1===ts?"st12":"",2===ts?"":"none",Oe,!1===Ye||1===ts?"st12":"",!1===ls?"30":"143",Ne,1===rs?"":"none",!1===ls?"376":"373",!1===ls?"30":"143",Ne,2===rs?"":"none",!1===ls?"413":"410",!1===ls?"30":"143",Ne,2===rs?"":"none",!1===gs?"st14":"st4",0===vt.battery.energy||!0===Ns||0===qs?"transparent":"".concat(ns),js,0===vt.battery.energy||qs<=0||!0===Ns?"transparent":"".concat(ns),wt("common.runtime_to"),Fs,Rs,0===vt.battery.energy||qs>=0||!0===Ns?"transparent":"".concat(ns),wt("common.to"),Fs,wt("common.charge"),Rs,0===vt.battery.energy||!1===Ns?"transparent":"".concat(ns),wt("common.battery_floating"),!1===vt.show_solar?"none":"",as,vt.solar.pv1_name,!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,vt.solar.pv2_name,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,vt.solar.pv3_name,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,vt.solar.pv4_name,Oe,ws,$s,1!==rs&&2!==rs||!0!==ls?"":"none",Ne,!1===rs||!1===ls?"none":"",Ne,!1===ls?"70":"181",1===rs?"":"none",Ne,vt.load.load1_name,!1===ls?"47":"158",1===rs?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===ls?"393":"390",!1===ls?"59":"172",2===rs?"":"none",Ne,vt.load.load1_name,!1===ls?"394":"391",!1===ls?"42":"154",2===rs?"":"none",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===ls?"429":"426",!1===ls?"59":"172",2===rs?"":"none",Ne,vt.load.load2_name,!1===ls?"430":"427",!1===ls?"42":"154",2===rs?"":"none",Ne,isNaN(parseFloat(Be.state))?0:parseFloat(Be.state).toFixed(0),!1===ze||!1===ls?"transparent":"".concat(Ne),wt("common.daily_load"),!1===rs?"83%":"67%",!1===rs?"18.5%":"24.25%",!1===ze||!0===ls?"transparent":"".concat(Ne),wt("common.daily_load"),!1===os||!1===vt.show_solar||0!=ys?"transparent":"".concat(as),wt("common.daily_solar"),!1===os||!1===vt.show_solar||!1===ys?"transparent":"".concat(as),wt("common.daily_solar_left"),!1===is?"transparent":"".concat(ns),wt("common.daily_charge"),!1===is?"transparent":"".concat(ns),wt("common.daily_discharge"),!1===Ye?"68%":"76%",!1===Ye?"96%":"66%",!1===es?"transparent":"".concat(Oe),wt("common.daily_grid_buy"),!1===Ye?"68%":"76%",!1===Ye?"88%":"58%",!1===ss?"transparent":"".concat(Oe),wt("common.daily_grid_sell"),!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),vt.load.aux_name,!1===Ye?"none":"",Oe,vt.grid.nonessential_name,!1===Ye||!1===ts||2===ts?"none":"",Oe,vt.grid.load1_name,!1===Ye||!1===ts||1===ts?"none":"",Oe,vt.grid.load1_name,!1===Ye||!1===ts||1===ts?"none":"",Oe,vt.grid.load2_name,!1===Ye||!1===ts||2===ts?"none":"",Oe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),!1===Ye||!1===ts||1===ts?"none":"",Oe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),!1===Ye||!1===ts||1===ts?"none":"",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Us,!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Ys,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Gs,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Xs,!1===fs?"none":"",ws,!1===fs?"none":"",ws,wt("common.ratio"),Ds,!0===ls?"":"none",1===rs||2===rs?"":"st12",Ne,!1===ls?"":"none",1===rs?"":"st12",Ne,!1===ls?"":"none",2===rs?"":"st12",Ne,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",parseInt(te.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",parseInt(Jt.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",parseInt(qe.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",0===bs?"transparent":"".concat(as),Ks,ns,qs<0||0===qs?"transparent":"".concat(ns),Js,qs>0||0===qs?"transparent":"".concat(ns),Js,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn/2,Re>0||0===Re?"transparent":"".concat(Oe),sn/2,Oe,!1===Ye?"st12":"",!1===Ye?"st12":"",Zs<=0?"transparent":"".concat(Oe),nn/2,Oe,!1===Ye?"st12":"",!1===Ye?"st12":"",Zs<=0?"transparent":"".concat(Oe),nn,!1===ls?"st12":"",De,!1===ls||0===Se?"st12":"",Se<0?"transparent":"".concat(De),en,!1===ls||0===Se?"st12":"",Se>0?"transparent":"".concat(De),en,!1===ls?"st12":"",De,Oe,ws,Ne,0===Hs?"transparent":"".concat(Ne),tn,Ne,ws,parseInt(se.state)>=ks?1:0,ns,parseInt(se.state)>=50&&parseInt(se.state)Ms&&parseInt(se.state)<=49?"1":"0",ns,parseInt(se.state)<=Ms?1:0,ns,!1===vt.show_solar?"st12":"",as,(t=>this.handlePopup(t,vt.entities.grid_connected_status_194)),"off"===Qe||"0"===Qe?"st12":"",Oe,"on"===Qe||"1"===Qe?"st12":"",Ue,"default"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"oven"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"boiler"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"pump"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,"aircon"===cs?"1":"0",!1===Ye||2===ts||1===ts?"none":"",Oe,!1===Ye||2===ts||1===ts?"none":"",cs,"default"===ds&&"default"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"default"===ds&&"default"!=ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"default"!=ds&&"default"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"boiler"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"boiler"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"pump"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"pump"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"oven"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"oven"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"aircon"===ds?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,"aircon"===ps?"1":"0",!1===Ye||!1===ts||1===ts?"none":"",Oe,!1===Ye||!1===ts||1===ts?"none":"",ds,!1===Ye||!1===ts||1===ts?"none":"",ps,"default"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"boiler"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"pump"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"oven"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,"aircon"===ds?"1":"0",!1===Ye||!1===ts||2===ts?"none":"",Oe,!1===Ye||!1===ts||2===ts?"none":"",ds,1!==rs&&2!==rs||!1!==ls?"none":"",Ne,1!==rs&&2!==rs||!0!==ls?"none":"",Ne,1===rs||2===rs?"none":"",Ne,(t=>this.handlePopup(t,vt.entities.aux_connected_status)),"default"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"gen"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"inverter"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"oven"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"boiler"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"aircon"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),"pump"===hs?"":"st12",!1===ls?"none":"","".concat("on"===We||"1"===We?De:$e),!1===ls?"none":"",hs,"on"===We||"1"===We?"aux-icon":"aux-off-icon","boiler"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"boiler"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"boiler"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"boiler"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"boiler"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"boiler"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"aircon"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"aircon"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"aircon"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"aircon"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"aircon"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"aircon"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"pump"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"pump"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"pump"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"pump"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"pump"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,"pump"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"oven"===vs&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"oven"===_s&&2===rs?"1":"0",!1===ls||!1===rs||1===rs?"none":"",Ne,"oven"===vs&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"oven"===_s&&2===rs&&!1===ls?"1":"0",!1===rs||1===rs?"none":"",Ne,"oven"===vs&&1===rs&&!1===ls?"1":"0",!1===rs||2===rs?"none":"",Ne,"oven"===vs&&1===rs?"1":"0",!1===ls||!1===rs||2===rs?"none":"",Ne,!1===rs||1===rs?"none":"",!0===ls?"350":"383",!0===ls?"140":"5",vs,!1===rs||1===rs?"none":"",!0===ls?"446":"420",!0===ls?"140":"5",_s,!1===rs||2===rs?"none":"","336",!0===ls?"140":"27",vs,(t=>this.handlePopup(t,vt.entities.use_timer_248)),0!=fs?"60.5%":"65%","on"==ge.state&&!1!==ms?"":"none",ws,0!=fs?"60.5%":"65%","off"==ge.state&&!1!==ms?"":"none",ws,0!=fs?"63.5%":"68%","on"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_on"),0!=fs?"63.5%":"68%","off"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_off"),(t=>this.handlePopup(t,vt.entities.solar_sell_247)),vt.entities.solar_sell_247&&"none"!==vt.entities.solar_sell_247&&"off"!==Ie.state&&"0"!==Ie.state&&!1!==vt.show_solar?"":"none",as,vt.entities.solar_sell_247&&"none"!==vt.entities.solar_sell_247&&"on"!==Ie.state&&"1"!==Ie.state&&!1!==vt.show_solar?"":"none",as,(t=>this.handlePopup(t,vt.entities.priority_load_243)),0!=fs?"65.5%":"70%","off"===ye.state&&!1!==us?"":"none",ws,0!=fs?"65.5%":"70%","on"===ye.state&&!1!==us?"":"none",ws,0!=fs?"68.5%":"73%","on"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_load"),0!=fs?"68.5%":"73%","off"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_batt"),!1===je?"":"st12",(t=>this.handlePopup(t,Cs.entityID)),0!=fs?"60.5%":"65%",!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"st12":"",ws,0!=fs?"60.5%":"65%",!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"":"st12",ws,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||0!=ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||!1===ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,ys,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),!1===ze||!1===ls?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),!1===rs?"83%":"67%",!1===rs?"15%":"21%",!1===ze||!0===ls?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_battery_charge_70)),!1===is?"none":"",ns,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_battery_discharge_71)),!1===is?"none":"",ns,parseFloat(_t.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_import_76)),!1===Ye?"68%":"76%",!1===Ye?"92.5%":"62.5%",!1===es?"none":"",Oe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_export_77)),!1===Ye?"68%":"76%",!1===Ye?"84.25%":"54.5%",!1===ss?"none":"",Oe,parseFloat(Te.state).toFixed(1)||0,(null===(Q=vt.entities)||void 0===Q?void 0:Q.pv_total)?N(kt||(kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv_total)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0):N(Mt||(Mt=e([' '," W "])),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0),"none"!==vt.entities.essential_power?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.essential_power)),!1===gs?"st14":"st4",Ne,Hs||"0"):N(At||(At=e([''," W"])),!1===gs?"st14":"st4",Ne,Hs||0),"none"!==vt.entities.nonessential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.nonessential_power)),!1===Ye?"none":"",!1===gs?"st14":"st4",Oe,Zs||0):N(Zt||(Zt=e([''," W "])),!1===Ye?"none":"",!1===gs?"st14":"st4",Oe,Zs||0),(t=>this.handlePopup(t,vt.entities.grid_ct_power_172)),"none"===vt.entities.grid_ct_power_172?"none":"",!1===gs?"st14":"st4",Oe,Re||0,"none"!==vt.entities.aux_power_166?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.aux_power_166)),!1===gs?"st14":"st4",!1===ls?"none":"",De,Se<0?-1*Se:Se):N(Et||(Et=e([''," W "])),!1===gs?"st14":"st4",!1===ls?"none":"",De,Se<0?-1*Se:Se),"none"!==vt.entities.pv1_power_186?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv1_power_186)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,parseFloat(te.state).toFixed(0)||0):N(Vt||(Vt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv1_power_186?"none":"",as,parseFloat(te.state).toFixed(0)||0),"none"!==vt.entities.pv2_power_187?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv2_power_187)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv2_power_187||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0),"none"!==vt.entities.pv3_power_188?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv3_power_188)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv3_power_188||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0),"none"!==vt.entities.pv4_power_189?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv4_power_189)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv4_power_189||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0),(t=>this.handlePopup(t,vt.entities.inverter_voltage_154)),"none"!==vt.entities.inverter_voltage_154&&vt.entities.inverter_voltage_154?"":"none",!1===gs?"st14":"st4",Oe,Xe,(t=>this.handlePopup(t,vt.entities.load_frequency_192)),"none"!==vt.entities.load_frequency_192&&vt.entities.load_frequency_192?"":"none",!1===gs?"st14":"st4",Oe,Ge,(t=>this.handlePopup(t,vt.entities.inverter_current_164)),"none"!==vt.entities.inverter_current_164&&vt.entities.inverter_current_164?"":"none",!1===gs?"st14":"st4",ws,Ke,(t=>this.handlePopup(t,vt.entities.battery_voltage_183)),"none"!==vt.entities.battery_voltage_183&&vt.entities.battery_voltage_183?"":"none",ns,!1===gs?"st14":"st4",Je,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),"none"===vt.entities.battery_soc_184?"none":"",ns,parseInt(se.state)||0,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),ns,!1===Cs.show||"none"===vt.entities.battery_soc_184?"none":"",Cs.capacity||0,(t=>this.handlePopup(t,vt.entities.battery_power_190)),"none"===vt.entities.battery_power_190?"none":"",ns,!1===gs?"st14":"st4",qs<0?-1*qs:qs,(t=>this.handlePopup(t,vt.entities.battery_current_191)),"none"===vt.entities.battery_current_191?"none":"",ns,!1===gs?"st14":"st4",Me.state||0,(t=>this.handlePopup(t,vt.entities.inverter_power_175)),"none"===vt.entities.inverter_power_175?"none":"",!1===gs?"st14":"st4",ws,pe.state||0,(t=>this.handlePopup(t,vt.entities.grid_power_169)),"none"===vt.entities.grid_power_169?"none":"",!1===gs?"st14":"st4",Oe,ve.state||0,(t=>this.handlePopup(t,vt.entities.pv1_voltage_109)),!1!==vt.show_solar&&vt.entities.pv1_voltage_109&&"none"!==vt.entities.pv1_voltage_109?"":"none",as,oe.state||0,(t=>this.handlePopup(t,vt.entities.pv1_current_110)),!1!==vt.show_solar&&vt.entities.pv1_current_110&&"none"!==vt.entities.pv1_current_110?"":"none",as,le.state||0,(t=>this.handlePopup(t,vt.entities.pv2_voltage_111)),!1!==vt.show_solar&&vt.entities.pv2_voltage_111&&"none"!==vt.entities.pv2_voltage_111&&1!==vt.solar.mppts?"":"none",as,re.state||0,(t=>this.handlePopup(t,vt.entities.pv2_current_112)),!1!==vt.show_solar&&vt.entities.pv2_current_112&&"none"!==vt.entities.pv2_current_112&&1!==vt.solar.mppts?"":"none",as,he.state||0,(t=>this.handlePopup(t,vt.entities.pv3_voltage_113)),!1!==vt.show_solar&&vt.entities.pv3_voltage_113&&"none"!==vt.entities.pv3_voltage_113&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,xe.state||0,(t=>this.handlePopup(t,vt.entities.pv3_current_114)),!1!==vt.show_solar&&vt.entities.pv3_current_114&&"none"!==vt.entities.pv3_current_114&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,we.state||0,(t=>this.handlePopup(t,vt.entities.pv4_voltage_115)),!1!==vt.show_solar&&vt.entities.pv4_voltage_115&&"none"!==vt.entities.pv4_voltage_115&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,fe.state||0,(t=>this.handlePopup(t,vt.entities.pv4_current_116)),!1!==vt.show_solar&&vt.entities.pv4_current_116&&"none"!==vt.entities.pv4_current_116&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,me.state||0,(t=>this.handlePopup(t,vt.entities.battery_temp_182)),"none"===vt.entities.battery_temp_182?"st12":"st3 left-align",ns,(null===(W=vt.entities)||void 0===W?void 0:W.battery_temp_182)?"":"none",Ae.state||"",(t=>this.handlePopup(t,vt.entities.radiator_temp_91)),4===(null===(G=vt.solar)||void 0===G?void 0:G.mppts)?"30%":"34.5%",4===(null===(X=vt.solar)||void 0===X?void 0:X.mppts)?"58%":"40%","none"===vt.entities.radiator_temp_91?"st12":"st3 left-align",ws,(null===(K=vt.entities)||void 0===K?void 0:K.radiator_temp_91)?"":"none",Ze.state||"",(t=>this.handlePopup(t,vt.entities.dc_transformer_temp_90)),"none"===vt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ws,(null===(J=vt.entities)||void 0===J?void 0:J.dc_transformer_temp_90)?"":"none",He.state||"",(t=>this.handlePopup(t,vt.entities.energy_cost)),"none"===vt.entities.energy_cost?"st12":"st3 left-align",Oe,(null===(tt=vt.entities)||void 0===tt?void 0:tt.energy_cost)?"":"none",Ve.state||""):"lite"===vt.cardstyle?j(jt||(jt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ne,!1===vt.show_solar?145.33:-.5,!1===vt.show_solar?270.67:406,"".concat(!1===xs?!1===vt.show_solar?"246px":"".concat(Ts):!1===vt.show_solar?"75%":"100%"),Ne,as,!1===vt.show_solar?"st12":"",ns,Oe,as,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",Ne,1===rs&&!0===vt.show_solar?"":"none",Ne,2===rs&&!0===vt.show_solar?"":"none",Ne,2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",0===vt.battery.energy||!0===Ns||0===qs?"transparent":"".concat(ns),js,0===vt.battery.energy||qs<=0||!0===Ns?"transparent":"".concat(ns),wt("common.runtime_to"),Fs,Rs,0===vt.battery.energy||qs>=0||!0===Ns?"transparent":"".concat(ns),wt("common.to"),Fs,wt("common.charge"),Rs,0===vt.battery.energy||!1===Ns?"transparent":"".concat(ns),wt("common.battery_floating"),!1===is?"transparent":"".concat(ns),wt("common.daily_charge"),!1===is?"transparent":"".concat(ns),wt("common.daily_discharge"),2===rs?"365":"400.4",2===rs?"182.2":"282.1",!1===ze?"transparent":"".concat(Ne),wt("common.daily_load"),!1===es?"transparent":"".concat(Oe),wt("common.daily_grid_buy"),!1===ss?"transparent":"".concat(Oe),wt("common.daily_grid_sell"),!1===os||!1===vt.show_solar||0!=ys?"transparent":"".concat(as),wt("common.daily_solar"),!1===os||!1===vt.show_solar||!1===ys?"transparent":"".concat(as),wt("common.daily_solar_left"),!1===vt.show_solar?"none":"",as,(null===(et=vt.solar)||void 0===et?void 0:et.pv1_name)?"".concat(vt.solar.pv1_name):"PV1",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,(null===(st=vt.solar)||void 0===st?void 0:st.pv2_name)?"".concat(vt.solar.pv2_name):"PV2",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,(null===(nt=vt.solar)||void 0===nt?void 0:nt.pv3_name)?"".concat(vt.solar.pv3_name):"PV3",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,(null===(it=vt.solar)||void 0===it?void 0:it.pv4_name)?"".concat(vt.solar.pv4_name):"PV4",!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Us,!1===fs?"none":"","energy"===fs?"st4 st8 left-align":"st12",ws,Ys,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Gs,!1===fs?"none":"","power"===fs?"st4 st8 left-align":"st12",ws,Xs,!1===fs?"none":"",ws,!1===fs?"none":"",ws,wt("common.ratio"),1===rs&&!0===vt.show_solar?"":"none",Ne,(null===(at=vt.load)||void 0===at?void 0:at.load1_name)?"".concat(vt.load.load1_name):"",1===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),2===rs&&!0===vt.show_solar?"":"none",Ne,(null===(ot=vt.load)||void 0===ot?void 0:ot.load1_name)?"".concat(vt.load.load1_name):"",2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),2===rs&&!0===vt.show_solar?"":"none",Ne,(null===(lt=vt.load)||void 0===lt?void 0:lt.load2_name)?"".concat(vt.load.load2_name):"",2===rs&&!0===vt.show_solar?"":"none",!1===gs?"st14":"st4",Ne,isNaN(parseFloat(Be.state))?0:parseFloat(Be.state).toFixed(0),Ds,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",parseInt(te.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts?"st12":"",parseInt(Jt.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(as),Ks,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",as,!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"st12":"",parseInt(qe.state)<=0?"transparent":"".concat(as),Ks,ns,qs<0||0===qs?"transparent":"".concat(ns),Js,qs>0||0===qs?"transparent":"".concat(ns),Js,!1===vt.show_solar?"st12":"",as,!1===vt.show_solar?"st12":"",0===bs?"transparent":"".concat(as),Ks,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Oe,Re<0||0===Re?"transparent":"".concat(Oe),sn,Re>0||0===Re?"transparent":"".concat(Oe),sn,Ne,0===Hs?"transparent":"".concat(Ne),tn,Ne,0===Hs?"transparent":"".concat(Ne),tn,1===rs&&!0===vt.show_solar?"":"st12",Ne,2===rs&&!0===vt.show_solar?"":"st12",Ne,2===rs&&!0===vt.show_solar?"":"st12",Ne,"oven"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"oven"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"pump"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"pump"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"aircon"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"aircon"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,"boiler"!==vs||1!==rs&&2!==rs?"0":"1",!1===rs||!1===vt.show_solar?"none":"",Ne,"boiler"===_s&&2===rs?"1":"0",!1===rs||!1===vt.show_solar?"none":"",Ne,!1===rs||!1===vt.show_solar?"none":"",vs,!1===rs||1===rs||!1===vt.show_solar?"none":"",_s,!1===vt.show_solar?"st12":"",as,parseInt(se.state)>=ks?1:0,ns,parseInt(se.state)>=50&&parseInt(se.state)Ms&&parseInt(se.state)<=49?1:0,ns,parseInt(se.state)<=Ms?1:0,ns,(t=>this.handlePopup(t,vt.entities.grid_connected_status_194)),"off"===Qe||"0"===Qe?"st12":"",Oe,"on"===Qe||"1"===Qe?"st12":"",Ue,Ne,ws,(t=>this.handlePopup(t,vt.entities.use_timer_248)),"on"==ge.state&&!1!==ms?"":"none",ws,"off"==ge.state&&!1!==ms?"":"none",ws,"off"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_off"),"on"==ge.state&&!1!==ms?"":"none",ws,wt("common.timer_on"),(t=>this.handlePopup(t,vt.entities.priority_load_243)),"off"===ye.state&&!1!==us?"":"none",ws,"on"===ye.state&&!1!==us?"":"none",ws,"off"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_batt"),"on"===ye.state&&!1!==us?"":"none",ws,wt("common.priority_load"),(t=>this.handlePopup(t,vt.entities.solar_sell_247)),vt.entities.solar_sell_247&&"off"!==Ie.state&&"0"!==Ie.state&&!1!==vt.show_solar?"":"none",as,vt.entities.solar_sell_247&&"on"!==Ie.state&&"1"!==Ie.state&&!1!==vt.show_solar?"":"none",as,!1===je?"":"st12",(t=>this.handlePopup(t,Cs.entityID)),!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"st12":"",ws,!1===Cs.show||"none"===vt.entities.use_timer_248?"none":"","none"===Cs.charge?"":"st12",ws,(t=>this.handlePopup(t,vt.entities.day_battery_charge_70)),!1===is?"none":"",ns,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||0!=ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_pv_energy_108)),!1===os||!1===vt.show_solar||!1===ys?"none":"",as,parseFloat(ft.state).toFixed(1)||0,ys,(t=>this.handlePopup(t,vt.entities.day_battery_discharge_71)),!1===is?"none":"",ns,parseFloat(_t.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_load_energy_84)),2===rs?"365":"400.4",2===rs?"168":"267.9",!1===ze?"none":"",Ne,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_import_76)),!1===es?"none":"",Oe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.day_grid_export_77)),!1===ss?"none":"",Oe,parseFloat(Te.state).toFixed(1)||0,(t=>this.handlePopup(t,vt.entities.inverter_voltage_154)),"none"!==vt.entities.inverter_voltage_154&&vt.entities.inverter_voltage_154?"":"none",ws,Xe,(t=>this.handlePopup(t,vt.entities.load_frequency_192)),"none"!==vt.entities.load_frequency_192&&vt.entities.load_frequency_192?"":"none",ws,Ge,(t=>this.handlePopup(t,vt.entities.inverter_current_164)),"none"!==vt.entities.inverter_current_164&&vt.entities.inverter_current_164?"":"none",ws,Ke,(t=>this.handlePopup(t,vt.entities.battery_voltage_183)),"none"!==vt.entities.battery_voltage_183&&vt.entities.battery_voltage_183?"":"none",ns,!1===gs?"st14":"st4",Je,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),"none"===vt.entities.battery_soc_184?"none":"",ns,parseInt(se.state)||0,(t=>this.handlePopup(t,vt.entities.battery_soc_184)),ns,!1===Cs.show||"none"===vt.entities.battery_soc_184?"none":"",Cs.capacity||0,(t=>this.handlePopup(t,vt.entities.battery_power_190)),"none"===vt.entities.battery_power_190?"none":"",ns,!1===gs?"st14":"st4",qs<0?-1*qs:qs,(t=>this.handlePopup(t,vt.entities.battery_current_191)),"none"===vt.entities.battery_current_191?"none":"",ns,!1===gs?"st14":"st4",Me.state||0,(t=>this.handlePopup(t,vt.entities.grid_ct_power_172)),"none"===vt.entities.grid_ct_power_172?"none":"",!1===gs?"st14":"st4",Oe,Re||0,(t=>this.handlePopup(t,vt.entities.pv1_voltage_109)),!1!==vt.show_solar&&vt.entities.pv1_voltage_109&&"none"!==vt.entities.pv1_voltage_109?"":"none",as,oe.state||0,(t=>this.handlePopup(t,vt.entities.pv1_current_110)),!1!==vt.show_solar&&vt.entities.pv1_current_110&&"none"!==vt.entities.pv1_current_110?"":"none",as,le.state||0,(t=>this.handlePopup(t,vt.entities.pv2_voltage_111)),!1!==vt.show_solar&&vt.entities.pv2_voltage_111&&"none"!==vt.entities.pv2_voltage_111&&1!==vt.solar.mppts?"":"none",as,re.state||0,(t=>this.handlePopup(t,vt.entities.pv2_current_112)),!1!==vt.show_solar&&vt.entities.pv2_current_112&&"none"!==vt.entities.pv2_current_112&&1!==vt.solar.mppts?"":"none",as,he.state||0,(t=>this.handlePopup(t,vt.entities.pv3_voltage_113)),!1!==vt.show_solar&&vt.entities.pv3_voltage_113&&"none"!==vt.entities.pv3_voltage_113&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,xe.state||0,(t=>this.handlePopup(t,vt.entities.pv3_current_114)),!1!==vt.show_solar&&vt.entities.pv3_current_114&&"none"!==vt.entities.pv3_current_114&&1!==vt.solar.mppts&&2!==vt.solar.mppts?"":"none",as,we.state||0,(t=>this.handlePopup(t,vt.entities.pv4_voltage_115)),!1!==vt.show_solar&&vt.entities.pv4_voltage_115&&"none"!==vt.entities.pv4_voltage_115&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,fe.state||0,(t=>this.handlePopup(t,vt.entities.pv4_current_116)),!1!==vt.show_solar&&vt.entities.pv4_current_116&&"none"!==vt.entities.pv4_current_116&&1!==vt.solar.mppts&&2!==vt.solar.mppts&&3!==vt.solar.mppts?"":"none",as,me.state||0,(t=>this.handlePopup(t,vt.entities.battery_temp_182)),"none"===vt.entities.battery_temp_182?"st12":"st3 left-align",ns,(null===(rt=vt.entities)||void 0===rt?void 0:rt.battery_temp_182)?"":"none",Ae.state||"",(t=>this.handlePopup(t,vt.entities.radiator_temp_91)),"none"===vt.entities.radiator_temp_91?"st12":"st3 left-align",ws,(null===(ht=vt.entities)||void 0===ht?void 0:ht.radiator_temp_91)?"":"none",Ze.state||"",(t=>this.handlePopup(t,vt.entities.dc_transformer_temp_90)),"none"===vt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ws,(null===(ct=vt.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",He.state||"",(t=>this.handlePopup(t,vt.entities.energy_cost)),"none"===vt.entities.energy_cost?"st12":"st3 left-align",Oe,(null===(dt=vt.entities)||void 0===dt?void 0:dt.energy_cost)?"":"none",Ve.state||"",(null===(pt=vt.entities)||void 0===pt?void 0:pt.pv_total)?N(Nt||(Nt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv_total)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0):N(Dt||(Dt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,As||0),"none"!==vt.entities.pv1_power_186?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv1_power_186)),!1===gs?"st14":"st4",!1===vt.show_solar?"none":"",as,parseFloat(te.state).toFixed(0)||0):N(zt||(zt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv1_power_186?"none":"",as,parseFloat(te.state).toFixed(0)||0),"none"!==vt.entities.pv2_power_187?N(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv2_power_187)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv2_power_187||1===vt.solar.mppts?"none":"",as,parseFloat(Jt.state).toFixed(0)||0),"none"!==vt.entities.pv3_power_188?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv3_power_188)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv3_power_188||1===vt.solar.mppts||2===vt.solar.mppts?"none":"",as,parseFloat(ue.state).toFixed(0)||0),"none"!==vt.entities.pv4_power_189?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.pv4_power_189)),!1===gs?"st14":"st4",!1===vt.show_solar||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===gs?"st14":"st4",!1===vt.show_solar||"none"===vt.entities.pv4_power_189||1===vt.solar.mppts||2===vt.solar.mppts||3===vt.solar.mppts?"none":"",as,parseFloat(qe.state).toFixed(0)||0),"none"!==vt.entities.essential_power?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,vt.entities.essential_power)),!1===gs?"st14":"st4",Ne,Hs||0):N(Kt||(Kt=e([''," W"])),!1===gs?"st14":"st4",Ne,Hs||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=Jt({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([ct()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([ct()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ut=[0,1,2];var mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof mt&&mt&&mt.Object===Object&&mt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,u=f&&f.exports===w,m=u&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=u?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ut(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(u=l)&&At(u)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,wn,fn,un,mn]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?zs.charge="none":zs.charge="both",zs.capacity=parseInt(t.capacity.state),zs.entityID=e}_n>=mn||_n=gn&&_n=xn&&_n=wn&&_n=fn&&_n=un&&_n0?Us="off"===pe.state||!1===zs.show||parseInt(ie.state)<=zs.capacity?_t.battery.shutdown_soc:zs.capacity:Es<0&&("off"===pe.state||!1===zs.show||parseInt(ie.state)>=zs.capacity?Us=100:parseInt(ie.state)0?Ys=(parseInt(ie.state)-Us)/100*_t.battery.energy/Es*60*60:Es<0&&(Ys=(Us-parseInt(ie.state))/100*_t.battery.energy/Es*60*60*-1);const Tn=new Date,kn=1e3*Ys,Mn=new Date(Tn.getTime()+kn),bn=Mn.getHours(),An=Mn.getMinutes().toString().padStart(2,"0"),Hn=bn.toString().padStart(2,"0");Qs="".concat(Hn,":").concat(An);const Zn=Math.floor(Ys/86400),Ln=Math.floor(Ys%86400/3600),En=Math.floor(Ys%3600/60);Zn>0&&(Ws+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Ws+="".concat(Ln," hrs, ")),Ws+="".concat(En," min")}let Gs=!!(-2<=parseInt(Ae.state)&&parseInt(Ae.state)<=2&&parseInt(ie.state)>=99),Xs="",Ks="";switch(ve.state){case"0":case"standby":Xs="blue",Ks="Standby";break;case"1":case"selftest":Xs="yellow",Ks="Selftest";break;case"2":case"normal":case"ok":Xs="green",Ks="Normal";break;case"3":case"alarm":Xs="orange",Ks="Alarm";break;case"4":case"fault":Xs="red",Ks="Fault";break;default:"none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Xs="transparent",Ks="Status"):(Xs="transparent",Ks="")}let Js=(isNaN(parseFloat(mt.state))?0:parseFloat(mt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),tn=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Cs+parseInt("".concat(Es>0?Es:0))+parseInt("".concat($e<0?-1*$e:0)),an=Fs+Ss+parseInt("".concat($e>0?$e:0))+parseInt("".concat(Es<0?-1*Es:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Pn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Cs/(_t.solar.max_power||Cs));rn=Pn>=1?Pn:1}let hn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Vn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Es<0?-1*Es:Es)/(_t.battery.max_power||(Es<0?-1*Es:Es)));hn=Vn>=1?Vn:1}let dn=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let In=_t.load.animation_speed-(_t.load.animation_speed-1)*(Fs/(_t.load.max_power||Fs));dn=In>=1?In:1}let cn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let Cn=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(ge.state)<0?-1*parseInt(ge.state):parseInt(ge.state))/(_t.load.max_power||(parseInt(ge.state)<0?-1*parseInt(ge.state):parseInt(ge.state))));cn=Cn>=1?Cn:1}let pn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Bn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(le.state)<0?-1*parseInt(le.state):parseInt(le.state))/(_t.grid.max_power||(parseInt(le.state)<0?-1*parseInt(le.state):parseInt(le.state))));pn=Bn>=1?Bn:1}let vn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Fn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Ss/(_t.grid.max_power||Ss));vn=Fn>=1?Fn:1}return"full"===_t.cardstyle?j(kt||(kt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ye,Ye,Qe,We,Xe,Xe,!1===bs?"".concat(Ps):"100%",cs,!1===_t.show_solar?"st12":"",hs,Xe,Xe,Qe,!1===vs?"st12":"",Ye,As,cs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Xe,!1===Je?"st12":"",1===os?"":"none",Xe,!1===Je?"st12":"",2===os?"":"none",Xe,!1===Je||1===os?"st12":"",2===os?"":"none",Xe,!1===Je||1===os?"st12":"",!1===vs?"30":"143",Ye,1===_s?"":"none",!1===vs?"376":"373",!1===vs?"30":"143",Ye,2===_s?"":"none",!1===vs?"413":"410",!1===vs?"30":"143",Ye,2===_s?"":"none",Qe,!1===vs?"none":"",1===ys||2===ys?"":"st12",Qe,!1===vs?"none":"",2===ys?"":"st12",!1===Ms?"st14":"st4",0===_t.battery.energy||!0===Gs||0===Es?"transparent":"".concat(hs),Ws,0===_t.battery.energy||Es<=0||!0===Gs?"transparent":"".concat(hs),wt("common.runtime_to"),Us,Qs,0===_t.battery.energy||Es>=0||!0===Gs?"transparent":"".concat(hs),wt("common.to"),Us,wt("common.charge"),Qs,0===_t.battery.energy||!1===Gs?"transparent":"".concat(hs),wt("common.battery_floating"),!1===_t.show_solar?"none":"",cs,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,_t.solar.pv4_name,Xe,As,Ks,1!==_s&&2!==_s||!0!==vs?"":"none",Ye,0===_s||!1===vs?"none":"",Ye,!1===vs?70:181,1===_s?"":"none",Ye,_t.load.load1_name,!1===vs?47:158,1===_s?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),!1===vs?393:390,!1===vs?59:172,2===_s?"":"none",Ye,_t.load.load1_name,!1===vs?394:391,!1===vs?42:154,2===_s?"":"none",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),!1===vs?429:426,!1===vs?59:172,2===_s?"":"none",Ye,_t.load.load2_name,!1===vs?430:427,!1===vs?42:154,2===_s?"":"none",Ye,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),2===ys?"238":"306",!1===Ge||!1===vs?"transparent":"".concat(Ye),wt("common.daily_load"),0===_s?"377":"306",0===_s?71:93,!1===Ge||!0===vs?"transparent":"".concat(Ye),wt("common.daily_load"),!1===ps||!1===_t.show_solar||"false"!=ks?"transparent":"".concat(cs),wt("common.daily_solar"),!1===ps||!1===_t.show_solar||"false"===ks?"transparent":"".concat(cs),wt("common.daily_solar_left"),!1===ds?"transparent":"".concat(hs),!1===ds?"transparent":"".concat(hs),!1===Je?"311":"347",!1===Je?"368":"253",!1===ls?"transparent":"".concat(Xe),wt("common.daily_grid_buy"),!1===Je?"311":"347",!1===Je?"337":"222",!1===rs?"transparent":"".concat(Xe),wt("common.daily_grid_sell"),!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),_t.load.aux_name,!1===Je?"none":"",Xe,_t.grid.nonessential_name,!1===Je||0===os||2===os?"none":"",Xe,_t.grid.load1_name,!1===Je||0===os||1===os?"none":"",Xe,_t.grid.load1_name,!1===Je||0===os||1===os?"none":"",Xe,_t.grid.load2_name,!1===Je||0===os||2===os?"none":"",Xe,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===Je||0===os||1===os?"none":"",Xe,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===Je||0===os||1===os?"none":"",Xe,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,en,"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,sn,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,on,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,ln,"no"===Hs?"none":"",As,"no"===Hs?"none":"",As,1===ys?53:14,!1===vs||0===ys?"none":"",Qe,_t.load.aux_load1_name,!1===vs||0===ys||1===ys?"none":"",Qe,_t.load.aux_load2_name,!1===Ms?"st14":"st4",!1===vs||0===ys?"none":"",Qe,isNaN(parseFloat(je.state))?0:parseFloat(je.state).toFixed(0),!1===Ms?"st14":"st4",!1===vs||0===ys||1===ys?"none":"",Qe,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),Xs,!0===vs?"":"none",1===_s||2===_s?"":"st12",Ye,!1===vs?"":"none",1===_s?"":"st12",Ye,!1===vs?"":"none",2===_s?"":"st12",Ye,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(ee.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(Te.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",0===Cs?"transparent":"".concat(cs),rn,hs,Es<0||0===Es?"transparent":"".concat(hs),hn,Es>0||0===Es?"transparent":"".concat(hs),hn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn/2,ze>0||0===ze?"transparent":"".concat(Xe),pn/2,Xe,!1===Je?"st12":"",!1===Je?"st12":"",Ss<=0?"transparent":"".concat(Xe),vn/2,Xe,!1===Je?"st12":"",!1===Je?"st12":"",Ss<=0?"transparent":"".concat(Xe),vn,!1===vs?"st12":"",Qe,!1===vs||0===$e?"st12":"",$e<0?"transparent":"".concat(Qe),cn,!1===vs||0===$e?"st12":"",$e>0?"transparent":"".concat(Qe),cn,!1===vs?"st12":"",Qe,Xe,As,Ye,0===Fs?"transparent":"".concat(Ye),dn,Ye,As,parseInt(ie.state)>=Vs?1:0,hs,parseInt(ie.state)>=50&&parseInt(ie.state)Is&&parseInt(ie.state)<=49?"1":"0",hs,parseInt(ie.state)<=Is?1:0,hs,!1===_t.show_solar?"st12":"",cs,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===ts||"0"===ts?"st12":"",Xe,"on"===ts||"1"===ts?"st12":"",Ke,"default"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"oven"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"boiler"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"pump"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"aircon"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,!1===Je||2===os||1===os?"none":"",fs,"default"===us&&"default"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"default"===us&&"default"!=ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"default"!=us&&"default"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"boiler"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"boiler"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"pump"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"pump"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"oven"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"oven"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"aircon"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"aircon"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,!1===Je||0===os||1===os?"none":"",us,!1===Je||0===os||1===os?"none":"",ms,"default"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"boiler"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"pump"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"oven"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"aircon"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,!1===Je||0===os||2===os?"none":"",us,1!==_s&&2!==_s||!1!==vs?"none":"",Ye,1!==_s&&2!==_s||!0!==vs?"none":"",Ye,1===_s||2===_s?"none":"",Ye,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"gen"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"inverter"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"oven"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"boiler"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"aircon"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"pump"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),!1===vs||1===ys||2===ys?"none":"",gs,"on"===es||"1"===es?"aux-icon":"aux-off-icon",!1===vs||0===ys?"none":"",xs,!1===vs||1===ys||0===ys?"none":"",ws,"boiler"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"boiler"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"boiler"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"boiler"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"boiler"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"boiler"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"aircon"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"aircon"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"aircon"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"aircon"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"aircon"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"aircon"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"pump"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"pump"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"pump"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"pump"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"pump"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"pump"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"oven"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"oven"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"oven"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"oven"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"oven"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"oven"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,0===_s||1===_s?"none":"",!0===vs?"350":"383",!0===vs?"140":"5",qs,0===_s||1===_s?"none":"",!0===vs?"446":"420",!0===vs?"140":"5",Ts,0===_s||2===_s?"none":"","336",!0===vs?"140":"27",qs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Hs?"232":"249","on"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"232":"249","off"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"243":"260","on"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"243":"260","off"==we.state&&"no"!==Zs?"":"none",As,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Be.state&&"0"!==Be.state&&!1!==_t.show_solar?"":"none",cs,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Be.state&&"1"!==Be.state&&!1!==_t.show_solar?"":"none",cs,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Hs?"251":"268","off"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"251":"268","on"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"262":"280","on"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"262":"280","off"===xe.state&&"no"!==Ls?"":"none",As,!1===Ue?"":"st12",(t=>this.handlePopup(t,zs.entityID)),"no"!=Hs?"232":"249",!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"st12":"",As,"no"!=Hs?"232":"249",!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"":"st12",As,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||"false"!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||"false"!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"238":"306",!1===Ge||!1===vs?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===_s?"377":"306",0===_s?"57":"80",!1===Ge||!0===vs?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===ds?"none":"",hs,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===ds?"none":"",hs,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===Je?"311":"347",!1===Je?"354":"239",!1===ls?"none":"",Xe,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===Je?"311":"347",!1===Je?"323":"209",!1===rs?"none":"",Xe,parseFloat(Me.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0):N(bt||(bt=e([' '," W "])),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0),"none"!==_t.entities.essential_power?N(At||(At=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===Ms?"st14":"st4",Ye,Fs||0):N(Ht||(Ht=e([''," W"])),!1===Ms?"st14":"st4",Ye,Fs||0),"none"!==_t.entities.nonessential_power?N(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===Je?"none":"",!1===Ms?"st14":"st4",Xe,Ss||0):N(Lt||(Lt=e([''," W "])),!1===Je?"none":"",!1===Ms?"st14":"st4",Xe,Ss||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===Ms?"st14":"st4",Xe,ze||0,"none"!==_t.entities.aux_power_166?N(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===Ms?"st14":"st4",!1===vs?"none":"",Qe,$e<0?-1*$e:$e):N(Pt||(Pt=e([''," W "])),!1===Ms?"st14":"st4",!1===vs?"none":"",Qe,$e<0?-1*$e:$e),"none"!==_t.entities.pv1_power_186?N(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,parseFloat(se.state).toFixed(0)||0):N(It||(It=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",cs,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0):N(St||(St=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0):N(jt||(jt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===Ms?"st14":"st4",Xe,ns,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===Ms?"st14":"st4",Xe,ss,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===Ms?"st14":"st4",As,is,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",hs,!1===Ms?"st14":"st4",as,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",hs,parseInt(ie.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),hs,!1===zs.show||"none"===_t.entities.battery_soc_184?"none":"",zs.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",hs,!1===Ms?"st14":"st4",Es<0?-1*Es:Es,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",hs,!1===Ms?"st14":"st4",Ae.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===Ms?"st14":"st4",As,_e.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===Ms?"st14":"st4",Xe,ye.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",cs,re.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",cs,he.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",cs,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",cs,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,fe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,me.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,qe.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",hs,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Ze.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",As,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",As,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Xe,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Ce.state||""):"lite"===_t.cardstyle?j(Nt||(Nt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ye,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===bs?!1===_t.show_solar?"246px":"".concat(Ps):!1===_t.show_solar?"75%":"100%"),Ye,cs,!1===_t.show_solar?"st12":"",hs,Xe,cs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ye,1===_s&&!0===_t.show_solar?"":"none",Ye,2===_s&&!0===_t.show_solar?"":"none",Ye,2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",0===_t.battery.energy||!0===Gs||0===Es?"transparent":"".concat(hs),Ws,0===_t.battery.energy||Es<=0||!0===Gs?"transparent":"".concat(hs),wt("common.runtime_to"),Us,Qs,0===_t.battery.energy||Es>=0||!0===Gs?"transparent":"".concat(hs),wt("common.to"),Us,wt("common.charge"),Qs,0===_t.battery.energy||!1===Gs?"transparent":"".concat(hs),wt("common.battery_floating"),!1===ds?"transparent":"".concat(hs),wt("common.daily_charge"),!1===ds?"transparent":"".concat(hs),wt("common.daily_discharge"),2===_s?"365":"415",2===_s?"182.2":"282.1",!1===Ge?"transparent":"".concat(Ye),wt("common.daily_load"),!1===ls?"transparent":"".concat(Xe),wt("common.daily_grid_buy"),!1===rs?"transparent":"".concat(Xe),wt("common.daily_grid_sell"),!1===ps||!1===_t.show_solar||0!=ks?"transparent":"".concat(cs),wt("common.daily_solar"),!1===ps||!1===_t.show_solar||!1===ks?"transparent":"".concat(cs),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",cs,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,en,"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,sn,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,on,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,ln,"no"===Hs?"none":"",As,"no"===Hs?"none":"",As,wt("common.ratio"),1===_s&&!0===_t.show_solar?"":"none",Ye,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===_s&&!0===_t.show_solar?"":"none",Ye,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===_s&&!0===_t.show_solar?"":"none",Ye,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),Xs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(ee.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(Te.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(cs),rn,hs,Es<0||0===Es?"transparent":"".concat(hs),hn,Es>0||0===Es?"transparent":"".concat(hs),hn,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",0===Cs?"transparent":"".concat(cs),rn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Ye,0===Fs?"transparent":"".concat(Ye),dn,Ye,0===Fs?"transparent":"".concat(Ye),dn,1===_s&&!0===_t.show_solar?"":"st12",Ye,2===_s&&!0===_t.show_solar?"":"st12",Ye,2===_s&&!0===_t.show_solar?"":"st12",Ye,"oven"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"oven"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"pump"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"pump"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"aircon"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"aircon"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"boiler"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"boiler"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,0===_s||!1===_t.show_solar?"none":"",qs,0===_s||1===_s||!1===_t.show_solar?"none":"",Ts,!1===_t.show_solar?"st12":"",cs,parseInt(ie.state)>=Vs?1:0,hs,parseInt(ie.state)>=50&&parseInt(ie.state)Is&&parseInt(ie.state)<=49?1:0,hs,parseInt(ie.state)<=Is?1:0,hs,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===ts||"0"===ts?"st12":"",Xe,"on"===ts||"1"===ts?"st12":"",Ke,Ye,As,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==we.state&&!1!==Zs?"":"none",As,"off"==we.state&&!1!==Zs?"":"none",As,"off"==we.state&&!1!==Zs?"":"none",As,wt("common.timer_off"),"on"==we.state&&!1!==Zs?"":"none",As,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===xe.state&&!1!==Ls?"":"none",As,"on"===xe.state&&!1!==Ls?"":"none",As,"off"===xe.state&&!1!==Ls?"":"none",As,wt("common.priority_batt"),"on"===xe.state&&!1!==Ls?"":"none",As,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Be.state&&"0"!==Be.state&&!1!==_t.show_solar?"":"none",cs,_t.entities.solar_sell_247&&"on"!==Be.state&&"1"!==Be.state&&!1!==_t.show_solar?"":"none",cs,!1===Ue?"":"st12",(t=>this.handlePopup(t,zs.entityID)),!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"st12":"",As,!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"":"st12",As,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===ds?"none":"",hs,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||0!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||!1===ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,ks,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===ds?"none":"",hs,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===_s?"365":"400.4",2===_s?"168":"267.9",!1===Ge?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ls?"none":"",Xe,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===rs?"none":"",Xe,parseFloat(Me.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",As,ns,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",As,ss,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",As,is,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",hs,!1===Ms?"st14":"st4",as,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",hs,parseInt(ie.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),hs,!1===zs.show||"none"===_t.entities.battery_soc_184?"none":"",zs.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",hs,!1===Ms?"st14":"st4",Es<0?-1*Es:Es,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",hs,!1===Ms?"st14":"st4",Ae.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===Ms?"st14":"st4",Xe,ze||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",cs,re.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",cs,he.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",cs,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",cs,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,fe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,me.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,qe.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",hs,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Ze.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",As,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",As,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Xe,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Ce.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0):N($t||($t=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0),"none"!==_t.entities.pv1_power_186?N(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,parseFloat(se.state).toFixed(0)||0):N(zt||(zt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",cs,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0):N(Yt||(Yt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0):N(Wt||(Wt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0):N(Xt||(Xt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===Ms?"st14":"st4",Ye,Fs||0):N(Jt||(Jt=e([''," W"])),!1===Ms?"st14":"st4",Ye,Fs||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=te({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); diff --git a/src/defaults.ts b/src/defaults.ts index ca6d11a4..d6a257eb 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -44,6 +44,9 @@ export default { aux_name: localize('common.aux_name'), aux_type: 'default', additional_loads: 0, + aux_loads: 0, + aux_load1_name: '', + aux_load2_name: '', load1_icon: 'default', load2_icon: 'default', load1_name: localize('common.load1_name'), @@ -64,11 +67,10 @@ export default { load1_icon: 'default', load2_icon: 'default', invert_grid: false, - aimation_speed: 8, + animation_speed: 8, max_power: 8000 }, } -export const validNonEssDualLoadValues = [0,1,2] -export const validAdditionalLoadValues = [0,1,2] +export const validLoadValues = [0, 1, 2] diff --git a/src/index.ts b/src/index.ts index 72ff2322..e7f74833 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import { customElement, property } from 'lit/decorators.js'; import { HomeAssistant } from 'custom-card-helpers'; import { styles } from './style'; import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; -import defaultConfig, { validNonEssDualLoadValues } from './defaults'; +import defaultConfig, { validLoadValues } from './defaults'; import { CARD_VERSION } from './const'; import { localize } from './localize/localize'; import merge from 'lodash.merge'; @@ -129,11 +129,13 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj45 = this.hass.states[config.entities.essential_load2] || { state: '0' }; const stateObj46 = this.hass.states[config.entities.pv_total] || { state: '0' }; const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; + const stateObj48 = this.hass.states[config.entities.aux_load1] || { state: '0' }; + const stateObj49 = this.hass.states[config.entities.aux_load2] || { state: '0' }; //Set defaults - let invert_aux = config.load?.invert_aux; + let {invert_aux} = config.load; let aux_power = (invert_aux === true) ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); - let invert_grid = config.grid?.invert_grid; + let {invert_grid} = config.grid; let grid_power = (invert_grid === true) ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); let inverter_modern = config.inverter?.modern; let load_colour = config.load?.colour; @@ -151,7 +153,7 @@ export class SunsynkPowerFlowCard extends LitElement { let battery_voltage = config.entities?.battery_voltage_183 ? stateObj11.state : 0; let noness_dual_load = config.grid?.additional_loads; - if (!validNonEssDualLoadValues.includes(noness_dual_load)) { + if (!validLoadValues.includes(noness_dual_load)) { noness_dual_load = 0; } @@ -164,11 +166,18 @@ export class SunsynkPowerFlowCard extends LitElement { let show_aux = config.load?.show_aux; let additional_load = config.load?.additional_loads; - if (!validNonEssDualLoadValues.includes(additional_load)) { + if (!validLoadValues.includes(additional_load)) { additional_load = 0; } + let additional_aux_load = config.load?.aux_loads; + if (!validLoadValues.includes(additional_aux_load)) { + additional_aux_load = 0; + } + let aux_type = config.load?.aux_type; //valid options are gen,inverter, default, gen, boiler, pump, aircon + let aux_load1_icon = config.load?.aux_load1_icon; + let aux_load2_icon = config.load?.aux_load2_icon; let nonessential_icon = config.grid?.nonessential_icon; //valid options are default, oven, boiler, pump, aircon let load1_icon = config.grid?.load1_icon; //valid options are default, oven, boiler, pump let load2_icon = config.grid?.load2_icon; //valid options are default, oven, boiler, pump @@ -497,49 +506,55 @@ export class SunsynkPowerFlowCard extends LitElement { - - ${duration} - ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} - ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} - ${localize('common.battery_floating')} - ${config.solar.pv1_name} - ${config.solar.pv2_name} - ${config.solar.pv3_name} - ${config.solar.pv4_name} - Grid - ${inverterStateMsg} - Essential - Essential - ${config.load.load1_name} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config.load.load1_name} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config.load.load2_name} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W - ${localize('common.daily_load')} - ${localize('common.daily_load')} - ${localize('common.daily_solar')} - ${localize('common.daily_solar_left')} - ${localize('common.daily_charge')} - ${localize('common.daily_discharge')} - ${localize('common.daily_grid_buy')} - ${localize('common.daily_grid_sell')} - ${config.load.aux_name} - ${config.grid.nonessential_name} - ${config.grid.load1_name} - ${config.grid.load1_name} - ${config.grid.load2_name} - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - ${localize('common.ratio')} - - + + + + ${duration} + ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} + ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} + ${localize('common.battery_floating')} + ${config.solar.pv1_name} + ${config.solar.pv2_name} + ${config.solar.pv3_name} + ${config.solar.pv4_name} + Grid + ${inverterStateMsg} + Essential + Essential + ${config.load.load1_name} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config.load.load1_name} + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config.load.load2_name} + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${localize('common.daily_load')} + ${localize('common.daily_load')} + ${localize('common.daily_solar')} + ${localize('common.daily_solar_left')} + DAILY CHARGE + DAILY DISCHARGE + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} + ${config.load.aux_name} + ${config.grid.nonessential_name} + ${config.grid.load1_name} + ${config.grid.load1_name} + ${config.grid.load2_name} + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + Ratio + ${config.load.aux_load1_name} + ${config.load.aux_load2_name} + ${isNaN(parseFloat(stateObj48.state)) ? 0 : parseFloat(stateObj48.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj49.state)) ? 0 : parseFloat(stateObj49.state).toFixed(0)} W + + @@ -670,19 +685,19 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - - - - - - + + + + + + + + + + + + +
@@ -692,7 +707,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -702,13 +717,13 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - + + + + + - +
@@ -725,15 +740,15 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.aux_connected_status)}> - - - - - - - - - + + + + + + + + +
@@ -743,39 +758,60 @@ export class SunsynkPowerFlowCard extends LitElement { + + + + +
+ +
+ +
+
+ + + + +
+ +
+ +
+
+ - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + +
@@ -785,7 +821,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -795,7 +831,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -806,161 +842,161 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - - - ${localize('common.timer_on')} - ${localize('common.timer_off')} + + + Timer On + Timer Off this.handlePopup(e, config.entities.solar_sell_247)}> - - + + this.handlePopup(e, config.entities.priority_load_243)}> - - - ${localize('common.priority_load')} - ${localize('common.priority_batt')} + + + Priority Load + Priority Batt this.handlePopup(e, inverter_prog.entityID)}> - - + + this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> ${total_pv || 0} W ` - : svg` ${total_pv || 0} W `} + : svg` ${total_pv || 0} W `} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential || '0'} W + ${essential || 0} W ` - : svg`${essential || 0} W`} + : svg`${essential || 0} W`} ${config.entities.nonessential_power !== 'none' ? svg` this.handlePopup(e, config.entities.nonessential_power)}> - ${nonessential || 0} W + ${nonessential || 0} W ` - : svg`${nonessential || 0} W `} + : svg`${nonessential || 0} W `} this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power || 0} W + ${grid_power || 0} W ${config.entities.aux_power_166 !== 'none' ? svg` this.handlePopup(e, config.entities.aux_power_166)}> - ${aux_power < 0 ? aux_power * -1 : aux_power} W + ${aux_power < 0 ? aux_power * -1 : aux_power} W ` - : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} + : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ${parseFloat(stateObj9.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0) || 0} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> - ${inverter_voltage} V + ${inverter_voltage} V this.handlePopup(e, config.entities.load_frequency_192)}> - ${load_frequency} Hz + ${load_frequency} Hz this.handlePopup(e, config.entities.inverter_current_164)}> - ${inverter_current} A + ${inverter_current} A this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V + ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) || 0} % + ${parseInt(stateObj12.state) || 0} % this.handlePopup(e, config.entities.battery_soc_184)}> - | ${inverter_prog.capacity || 0} % + | ${inverter_prog.capacity || 0} % this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < 0 ? battery_power * -1 : battery_power} W + ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state || 0} A + ${stateObj35.state || 0} A this.handlePopup(e, config.entities.inverter_power_175)}> - ${stateObj22.state || 0} W + ${stateObj22.state || 0} W this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state || 0} W + ${stateObj23.state || 0} W this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state || 0} V + ${stateObj16.state || 0} V this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state || 0} A + ${stateObj17.state || 0} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state || 0} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state || 0} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state || 0} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state || 0} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state || 0} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state || 0} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state || ''}° + ${stateObj37.state || ''}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state || ''}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state || ''}° + DC: ${stateObj38.state || ''}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state || ''} + ${stateObj43.state || ''}
@@ -997,7 +1033,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.battery_floating')} ${localize('common.daily_charge')} ${localize('common.daily_discharge')} - ${localize('common.daily_load')} + ${localize('common.daily_load')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} ${localize('common.daily_solar')} @@ -1006,12 +1042,12 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} ${config.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} - ${Autarky}% - ${Ratio}% - ${Autarkyp}% - ${Ratiop}% - Autarky - ${localize('common.ratio')} + ${Autarky}% + ${Ratio}% + ${Autarkyp}% + ${Ratiop}% + Autarky + ${localize('common.ratio')} ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ${config.load?.load1_name ? `${config.load.load1_name}` : ''} @@ -1100,16 +1136,16 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - - - + + + + + + + + - +
@@ -1119,7 +1155,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index cb1125a5..8341a5a8 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -38,7 +38,7 @@ "empty_capacity": "Empty capacity needs to be <= 30", "show_daily": "Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs" }, - "solar":{ + "solar": { "sol": "No solar attributes defined", "mppts": "Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two", "show_daily": "Please include the day_pv_energy_108 attribute and entity ID" diff --git a/src/types.ts b/src/types.ts index c7705fb8..f2b00660 100644 --- a/src/types.ts +++ b/src/types.ts @@ -51,6 +51,11 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { aux_colour: string; aux_off_colour: string; additional_loads: number; + aux_loads: number; + aux_load1_name: string; + aux_load2_name: string; + aux_load1_icon: string; + aux_load2_icon: string; load1_name: string; load2_name: string; load1_icon: string; From bdb9f1103d10f18989699ca38253575df8ca1298 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:24:28 +0100 Subject: [PATCH 10/40] feat: add support for lux inverter status --- README.md | 1 + dist/sunsynk-power-flow-card.js | 4 +- src/const.ts | 20 ++++++++++ src/defaults.ts | 5 ++- src/index.ts | 71 +++++++++++++++------------------ src/types.ts | 1 + 6 files changed, 59 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 88d890c8..c93f6bbc 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ The card can be configured through the following attributes: |modern:| Optional |`true`| Changes the inverter image.| |colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| +| model: | Optional | `sunsynk` | Enables showing the state for `sunsynk` or `lux` inverters.
NOTE: this still needs work as I don't have all Lux states | ### Battery diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 9e80c93a..faf890f6 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const u=window,m=u.trustedTypes,q=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?F:B):o===F||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?F:B):o===F||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ut=[0,1,2];var mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof mt&&mt&&mt.Object===Object&&mt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,u=f&&f.exports===w,m=u&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=u?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ut(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=qt(t,s),r=qt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(u=l)&&At(u)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,wn,fn,un,mn]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?zs.charge="none":zs.charge="both",zs.capacity=parseInt(t.capacity.state),zs.entityID=e}_n>=mn||_n=gn&&_n=xn&&_n=wn&&_n=fn&&_n=un&&_n0?Us="off"===pe.state||!1===zs.show||parseInt(ie.state)<=zs.capacity?_t.battery.shutdown_soc:zs.capacity:Es<0&&("off"===pe.state||!1===zs.show||parseInt(ie.state)>=zs.capacity?Us=100:parseInt(ie.state)0?Ys=(parseInt(ie.state)-Us)/100*_t.battery.energy/Es*60*60:Es<0&&(Ys=(Us-parseInt(ie.state))/100*_t.battery.energy/Es*60*60*-1);const Tn=new Date,kn=1e3*Ys,Mn=new Date(Tn.getTime()+kn),bn=Mn.getHours(),An=Mn.getMinutes().toString().padStart(2,"0"),Hn=bn.toString().padStart(2,"0");Qs="".concat(Hn,":").concat(An);const Zn=Math.floor(Ys/86400),Ln=Math.floor(Ys%86400/3600),En=Math.floor(Ys%3600/60);Zn>0&&(Ws+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Ws+="".concat(Ln," hrs, ")),Ws+="".concat(En," min")}let Gs=!!(-2<=parseInt(Ae.state)&&parseInt(Ae.state)<=2&&parseInt(ie.state)>=99),Xs="",Ks="";switch(ve.state){case"0":case"standby":Xs="blue",Ks="Standby";break;case"1":case"selftest":Xs="yellow",Ks="Selftest";break;case"2":case"normal":case"ok":Xs="green",Ks="Normal";break;case"3":case"alarm":Xs="orange",Ks="Alarm";break;case"4":case"fault":Xs="red",Ks="Fault";break;default:"none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Xs="transparent",Ks="Status"):(Xs="transparent",Ks="")}let Js=(isNaN(parseFloat(mt.state))?0:parseFloat(mt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),tn=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Cs+parseInt("".concat(Es>0?Es:0))+parseInt("".concat($e<0?-1*$e:0)),an=Fs+Ss+parseInt("".concat($e>0?$e:0))+parseInt("".concat(Es<0?-1*Es:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Pn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Cs/(_t.solar.max_power||Cs));rn=Pn>=1?Pn:1}let hn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Vn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Es<0?-1*Es:Es)/(_t.battery.max_power||(Es<0?-1*Es:Es)));hn=Vn>=1?Vn:1}let dn=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let In=_t.load.animation_speed-(_t.load.animation_speed-1)*(Fs/(_t.load.max_power||Fs));dn=In>=1?In:1}let cn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let Cn=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(ge.state)<0?-1*parseInt(ge.state):parseInt(ge.state))/(_t.load.max_power||(parseInt(ge.state)<0?-1*parseInt(ge.state):parseInt(ge.state))));cn=Cn>=1?Cn:1}let pn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Bn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(le.state)<0?-1*parseInt(le.state):parseInt(le.state))/(_t.grid.max_power||(parseInt(le.state)<0?-1*parseInt(le.state):parseInt(le.state))));pn=Bn>=1?Bn:1}let vn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Fn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Ss/(_t.grid.max_power||Ss));vn=Fn>=1?Fn:1}return"full"===_t.cardstyle?j(kt||(kt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Ye,Ye,Qe,We,Xe,Xe,!1===bs?"".concat(Ps):"100%",cs,!1===_t.show_solar?"st12":"",hs,Xe,Xe,Qe,!1===vs?"st12":"",Ye,As,cs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Xe,!1===Je?"st12":"",1===os?"":"none",Xe,!1===Je?"st12":"",2===os?"":"none",Xe,!1===Je||1===os?"st12":"",2===os?"":"none",Xe,!1===Je||1===os?"st12":"",!1===vs?"30":"143",Ye,1===_s?"":"none",!1===vs?"376":"373",!1===vs?"30":"143",Ye,2===_s?"":"none",!1===vs?"413":"410",!1===vs?"30":"143",Ye,2===_s?"":"none",Qe,!1===vs?"none":"",1===ys||2===ys?"":"st12",Qe,!1===vs?"none":"",2===ys?"":"st12",!1===Ms?"st14":"st4",0===_t.battery.energy||!0===Gs||0===Es?"transparent":"".concat(hs),Ws,0===_t.battery.energy||Es<=0||!0===Gs?"transparent":"".concat(hs),wt("common.runtime_to"),Us,Qs,0===_t.battery.energy||Es>=0||!0===Gs?"transparent":"".concat(hs),wt("common.to"),Us,wt("common.charge"),Qs,0===_t.battery.energy||!1===Gs?"transparent":"".concat(hs),wt("common.battery_floating"),!1===_t.show_solar?"none":"",cs,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,_t.solar.pv4_name,Xe,As,Ks,1!==_s&&2!==_s||!0!==vs?"":"none",Ye,0===_s||!1===vs?"none":"",Ye,!1===vs?70:181,1===_s?"":"none",Ye,_t.load.load1_name,!1===vs?47:158,1===_s?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),!1===vs?393:390,!1===vs?59:172,2===_s?"":"none",Ye,_t.load.load1_name,!1===vs?394:391,!1===vs?42:154,2===_s?"":"none",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),!1===vs?429:426,!1===vs?59:172,2===_s?"":"none",Ye,_t.load.load2_name,!1===vs?430:427,!1===vs?42:154,2===_s?"":"none",Ye,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),2===ys?"238":"306",!1===Ge||!1===vs?"transparent":"".concat(Ye),wt("common.daily_load"),0===_s?"377":"306",0===_s?71:93,!1===Ge||!0===vs?"transparent":"".concat(Ye),wt("common.daily_load"),!1===ps||!1===_t.show_solar||"false"!=ks?"transparent":"".concat(cs),wt("common.daily_solar"),!1===ps||!1===_t.show_solar||"false"===ks?"transparent":"".concat(cs),wt("common.daily_solar_left"),!1===ds?"transparent":"".concat(hs),!1===ds?"transparent":"".concat(hs),!1===Je?"311":"347",!1===Je?"368":"253",!1===ls?"transparent":"".concat(Xe),wt("common.daily_grid_buy"),!1===Je?"311":"347",!1===Je?"337":"222",!1===rs?"transparent":"".concat(Xe),wt("common.daily_grid_sell"),!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),_t.load.aux_name,!1===Je?"none":"",Xe,_t.grid.nonessential_name,!1===Je||0===os||2===os?"none":"",Xe,_t.grid.load1_name,!1===Je||0===os||1===os?"none":"",Xe,_t.grid.load1_name,!1===Je||0===os||1===os?"none":"",Xe,_t.grid.load2_name,!1===Je||0===os||2===os?"none":"",Xe,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===Je||0===os||1===os?"none":"",Xe,isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state).toFixed(0),!1===Je||0===os||1===os?"none":"",Xe,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,en,"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,sn,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,on,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,ln,"no"===Hs?"none":"",As,"no"===Hs?"none":"",As,1===ys?53:14,!1===vs||0===ys?"none":"",Qe,_t.load.aux_load1_name,!1===vs||0===ys||1===ys?"none":"",Qe,_t.load.aux_load2_name,!1===Ms?"st14":"st4",!1===vs||0===ys?"none":"",Qe,isNaN(parseFloat(je.state))?0:parseFloat(je.state).toFixed(0),!1===Ms?"st14":"st4",!1===vs||0===ys||1===ys?"none":"",Qe,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),Xs,!0===vs?"":"none",1===_s||2===_s?"":"st12",Ye,!1===vs?"":"none",1===_s?"":"st12",Ye,!1===vs?"":"none",2===_s?"":"st12",Ye,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(ee.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(Te.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",0===Cs?"transparent":"".concat(cs),rn,hs,Es<0||0===Es?"transparent":"".concat(hs),hn,Es>0||0===Es?"transparent":"".concat(hs),hn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn/2,ze>0||0===ze?"transparent":"".concat(Xe),pn/2,Xe,!1===Je?"st12":"",!1===Je?"st12":"",Ss<=0?"transparent":"".concat(Xe),vn/2,Xe,!1===Je?"st12":"",!1===Je?"st12":"",Ss<=0?"transparent":"".concat(Xe),vn,!1===vs?"st12":"",Qe,!1===vs||0===$e?"st12":"",$e<0?"transparent":"".concat(Qe),cn,!1===vs||0===$e?"st12":"",$e>0?"transparent":"".concat(Qe),cn,!1===vs?"st12":"",Qe,Xe,As,Ye,0===Fs?"transparent":"".concat(Ye),dn,Ye,As,parseInt(ie.state)>=Vs?1:0,hs,parseInt(ie.state)>=50&&parseInt(ie.state)Is&&parseInt(ie.state)<=49?"1":"0",hs,parseInt(ie.state)<=Is?1:0,hs,!1===_t.show_solar?"st12":"",cs,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===ts||"0"===ts?"st12":"",Xe,"on"===ts||"1"===ts?"st12":"",Ke,"default"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"oven"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"boiler"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"pump"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,"aircon"===fs?"1":"0",!1===Je||2===os||1===os?"none":"",Xe,!1===Je||2===os||1===os?"none":"",fs,"default"===us&&"default"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"default"===us&&"default"!=ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"default"!=us&&"default"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"boiler"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"boiler"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"pump"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"pump"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"oven"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"oven"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"aircon"===us?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,"aircon"===ms?"1":"0",!1===Je||0===os||1===os?"none":"",Xe,!1===Je||0===os||1===os?"none":"",us,!1===Je||0===os||1===os?"none":"",ms,"default"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"boiler"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"pump"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"oven"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,"aircon"===us?"1":"0",!1===Je||0===os||2===os?"none":"",Xe,!1===Je||0===os||2===os?"none":"",us,1!==_s&&2!==_s||!1!==vs?"none":"",Ye,1!==_s&&2!==_s||!0!==vs?"none":"",Ye,1===_s||2===_s?"none":"",Ye,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"gen"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"inverter"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"oven"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"boiler"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"aircon"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),"pump"===gs?"":"st12",!1===vs||1===ys||2===ys?"none":"","".concat("on"===es||"1"===es?Qe:We),!1===vs||1===ys||2===ys?"none":"",gs,"on"===es||"1"===es?"aux-icon":"aux-off-icon",!1===vs||0===ys?"none":"",xs,!1===vs||1===ys||0===ys?"none":"",ws,"boiler"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"boiler"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"boiler"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"boiler"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"boiler"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"boiler"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"aircon"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"aircon"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"aircon"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"aircon"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"aircon"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"aircon"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"pump"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"pump"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"pump"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"pump"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"pump"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,"pump"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"oven"===qs&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"oven"===Ts&&2===_s?"1":"0",!1===vs||0===_s||1===_s?"none":"",Ye,"oven"===qs&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"oven"===Ts&&2===_s&&!1===vs?"1":"0",0===_s||1===_s?"none":"",Ye,"oven"===qs&&1===_s&&!1===vs?"1":"0",0===_s||2===_s?"none":"",Ye,"oven"===qs&&1===_s?"1":"0",!1===vs||0===_s||2===_s?"none":"",Ye,0===_s||1===_s?"none":"",!0===vs?"350":"383",!0===vs?"140":"5",qs,0===_s||1===_s?"none":"",!0===vs?"446":"420",!0===vs?"140":"5",Ts,0===_s||2===_s?"none":"","336",!0===vs?"140":"27",qs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Hs?"232":"249","on"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"232":"249","off"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"243":"260","on"==we.state&&"no"!==Zs?"":"none",As,"no"!=Hs?"243":"260","off"==we.state&&"no"!==Zs?"":"none",As,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Be.state&&"0"!==Be.state&&!1!==_t.show_solar?"":"none",cs,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Be.state&&"1"!==Be.state&&!1!==_t.show_solar?"":"none",cs,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Hs?"251":"268","off"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"251":"268","on"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"262":"280","on"===xe.state&&"no"!==Ls?"":"none",As,"no"!=Hs?"262":"280","off"===xe.state&&"no"!==Ls?"":"none",As,!1===Ue?"":"st12",(t=>this.handlePopup(t,zs.entityID)),"no"!=Hs?"232":"249",!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"st12":"",As,"no"!=Hs?"232":"249",!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"":"st12",As,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||"false"!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||"false"!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"238":"306",!1===Ge||!1===vs?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===_s?"377":"306",0===_s?"57":"80",!1===Ge||!0===vs?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===ds?"none":"",hs,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===ds?"none":"",hs,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===Je?"311":"347",!1===Je?"354":"239",!1===ls?"none":"",Xe,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===Je?"311":"347",!1===Je?"323":"209",!1===rs?"none":"",Xe,parseFloat(Me.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0):N(bt||(bt=e([' '," W "])),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0),"none"!==_t.entities.essential_power?N(At||(At=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===Ms?"st14":"st4",Ye,Fs||0):N(Ht||(Ht=e([''," W"])),!1===Ms?"st14":"st4",Ye,Fs||0),"none"!==_t.entities.nonessential_power?N(Zt||(Zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===Je?"none":"",!1===Ms?"st14":"st4",Xe,Ss||0):N(Lt||(Lt=e([''," W "])),!1===Je?"none":"",!1===Ms?"st14":"st4",Xe,Ss||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===Ms?"st14":"st4",Xe,ze||0,"none"!==_t.entities.aux_power_166?N(Et||(Et=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===Ms?"st14":"st4",!1===vs?"none":"",Qe,$e<0?-1*$e:$e):N(Pt||(Pt=e([''," W "])),!1===Ms?"st14":"st4",!1===vs?"none":"",Qe,$e<0?-1*$e:$e),"none"!==_t.entities.pv1_power_186?N(Vt||(Vt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,parseFloat(se.state).toFixed(0)||0):N(It||(It=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",cs,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0):N(Bt||(Bt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0):N(St||(St=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0):N(jt||(jt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===Ms?"st14":"st4",Xe,ns,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===Ms?"st14":"st4",Xe,ss,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===Ms?"st14":"st4",As,is,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",hs,!1===Ms?"st14":"st4",as,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",hs,parseInt(ie.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),hs,!1===zs.show||"none"===_t.entities.battery_soc_184?"none":"",zs.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",hs,!1===Ms?"st14":"st4",Es<0?-1*Es:Es,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",hs,!1===Ms?"st14":"st4",Ae.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===Ms?"st14":"st4",As,_e.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===Ms?"st14":"st4",Xe,ye.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",cs,re.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",cs,he.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",cs,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",cs,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,fe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,me.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,qe.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",hs,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Ze.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",As,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",As,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Xe,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Ce.state||""):"lite"===_t.cardstyle?j(Nt||(Nt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Ye,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===bs?!1===_t.show_solar?"246px":"".concat(Ps):!1===_t.show_solar?"75%":"100%"),Ye,cs,!1===_t.show_solar?"st12":"",hs,Xe,cs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ye,1===_s&&!0===_t.show_solar?"":"none",Ye,2===_s&&!0===_t.show_solar?"":"none",Ye,2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",0===_t.battery.energy||!0===Gs||0===Es?"transparent":"".concat(hs),Ws,0===_t.battery.energy||Es<=0||!0===Gs?"transparent":"".concat(hs),wt("common.runtime_to"),Us,Qs,0===_t.battery.energy||Es>=0||!0===Gs?"transparent":"".concat(hs),wt("common.to"),Us,wt("common.charge"),Qs,0===_t.battery.energy||!1===Gs?"transparent":"".concat(hs),wt("common.battery_floating"),!1===ds?"transparent":"".concat(hs),wt("common.daily_charge"),!1===ds?"transparent":"".concat(hs),wt("common.daily_discharge"),2===_s?"365":"415",2===_s?"182.2":"282.1",!1===Ge?"transparent":"".concat(Ye),wt("common.daily_load"),!1===ls?"transparent":"".concat(Xe),wt("common.daily_grid_buy"),!1===rs?"transparent":"".concat(Xe),wt("common.daily_grid_sell"),!1===ps||!1===_t.show_solar||0!=ks?"transparent":"".concat(cs),wt("common.daily_solar"),!1===ps||!1===_t.show_solar||!1===ks?"transparent":"".concat(cs),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",cs,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,en,"no"===Hs?"none":"","energy"===Hs?"st4 st8 left-align":"st12",As,sn,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,on,"no"===Hs?"none":"","power"===Hs?"st4 st8 left-align":"st12",As,ln,"no"===Hs?"none":"",As,"no"===Hs?"none":"",As,wt("common.ratio"),1===_s&&!0===_t.show_solar?"":"none",Ye,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===_s&&!0===_t.show_solar?"":"none",Ye,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===_s&&!0===_t.show_solar?"":"none",Ye,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===_s&&!0===_t.show_solar?"":"none",!1===Ms?"st14":"st4",Ye,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),Xs,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(ee.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(Te.state)<=0?"transparent":"".concat(cs),rn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",cs,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(cs),rn,hs,Es<0||0===Es?"transparent":"".concat(hs),hn,Es>0||0===Es?"transparent":"".concat(hs),hn,!1===_t.show_solar?"st12":"",cs,!1===_t.show_solar?"st12":"",0===Cs?"transparent":"".concat(cs),rn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Xe,ze<0||0===ze?"transparent":"".concat(Xe),pn,ze>0||0===ze?"transparent":"".concat(Xe),pn,Ye,0===Fs?"transparent":"".concat(Ye),dn,Ye,0===Fs?"transparent":"".concat(Ye),dn,1===_s&&!0===_t.show_solar?"":"st12",Ye,2===_s&&!0===_t.show_solar?"":"st12",Ye,2===_s&&!0===_t.show_solar?"":"st12",Ye,"oven"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"oven"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"pump"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"pump"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"aircon"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"aircon"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,"boiler"!==qs||1!==_s&&2!==_s?"0":"1",0===_s||!1===_t.show_solar?"none":"",Ye,"boiler"===Ts&&2===_s?"1":"0",0===_s||!1===_t.show_solar?"none":"",Ye,0===_s||!1===_t.show_solar?"none":"",qs,0===_s||1===_s||!1===_t.show_solar?"none":"",Ts,!1===_t.show_solar?"st12":"",cs,parseInt(ie.state)>=Vs?1:0,hs,parseInt(ie.state)>=50&&parseInt(ie.state)Is&&parseInt(ie.state)<=49?1:0,hs,parseInt(ie.state)<=Is?1:0,hs,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===ts||"0"===ts?"st12":"",Xe,"on"===ts||"1"===ts?"st12":"",Ke,Ye,As,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==we.state&&!1!==Zs?"":"none",As,"off"==we.state&&!1!==Zs?"":"none",As,"off"==we.state&&!1!==Zs?"":"none",As,wt("common.timer_off"),"on"==we.state&&!1!==Zs?"":"none",As,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===xe.state&&!1!==Ls?"":"none",As,"on"===xe.state&&!1!==Ls?"":"none",As,"off"===xe.state&&!1!==Ls?"":"none",As,wt("common.priority_batt"),"on"===xe.state&&!1!==Ls?"":"none",As,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Be.state&&"0"!==Be.state&&!1!==_t.show_solar?"":"none",cs,_t.entities.solar_sell_247&&"on"!==Be.state&&"1"!==Be.state&&!1!==_t.show_solar?"":"none",cs,!1===Ue?"":"st12",(t=>this.handlePopup(t,zs.entityID)),!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"st12":"",As,!1===zs.show||"none"===_t.entities.use_timer_248?"none":"","none"===zs.charge?"":"st12",As,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===ds?"none":"",hs,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||0!=ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===ps||!1===_t.show_solar||!1===ks?"none":"",cs,parseFloat(mt.state).toFixed(1)||0,ks,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===ds?"none":"",hs,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===_s?"365":"400.4",2===_s?"168":"267.9",!1===Ge?"none":"",Ye,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ls?"none":"",Xe,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===rs?"none":"",Xe,parseFloat(Me.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",As,ns,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",As,ss,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",As,is,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",hs,!1===Ms?"st14":"st4",as,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",hs,parseInt(ie.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),hs,!1===zs.show||"none"===_t.entities.battery_soc_184?"none":"",zs.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",hs,!1===Ms?"st14":"st4",Es<0?-1*Es:Es,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",hs,!1===Ms?"st14":"st4",Ae.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===Ms?"st14":"st4",Xe,ze||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",cs,re.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",cs,he.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",cs,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",cs,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,fe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",cs,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,me.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",cs,qe.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",hs,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Ze.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",As,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",As,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Xe,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Ce.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0):N($t||($t=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,Bs||0),"none"!==_t.entities.pv1_power_186?N(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===Ms?"st14":"st4",!1===_t.show_solar?"none":"",cs,parseFloat(se.state).toFixed(0)||0):N(zt||(zt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",cs,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0):N(Yt||(Yt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",cs,parseFloat(ee.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0):N(Wt||(Wt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",cs,parseFloat(Te.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===Ms?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0):N(Xt||(Xt=e([''," W"])),!1===Ms?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",cs,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===Ms?"st14":"st4",Ye,Fs||0):N(Jt||(Jt=e([''," W"])),!1===Ms?"st14":"st4",Ye,Fs||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=te({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));fn[e]=new Date(wn.getTime()),fn[e].setHours(s),fn[e].setMinutes(n)}));const[mn,un,qn,Tn,kn,Mn]=fn;function bn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Us.charge="none":Us.charge="both",Us.capacity=parseInt(t.capacity.state),Us.entityID=e}wn>=Mn||wn=mn&&wn=un&&wn=qn&&wn=Tn&&wn=kn&&wn0?Ys="off"===ve.state||!1===Us.show||parseInt(ae.state)<=Us.capacity?_t.battery.shutdown_soc:Us.capacity:Ps<0&&("off"===ve.state||!1===Us.show||parseInt(ae.state)>=Us.capacity?Ys=100:parseInt(ae.state)0?Qs=(parseInt(ae.state)-Ys)/100*_t.battery.energy/Ps*60*60:Ps<0&&(Qs=(Ys-parseInt(ae.state))/100*_t.battery.energy/Ps*60*60*-1);const An=new Date,Hn=1e3*Qs,Zn=new Date(An.getTime()+Hn),Ln=Zn.getHours(),En=Zn.getMinutes().toString().padStart(2,"0"),Pn=Ln.toString().padStart(2,"0");Ws="".concat(Pn,":").concat(En);const Vn=Math.floor(Qs/86400),In=Math.floor(Qs%86400/3600),Cn=Math.floor(Qs%3600/60);Vn>0&&(Gs+="".concat(Vn," days, ")),(In>0||Vn>0)&&(Gs+="".concat(In," hrs, ")),Gs+="".concat(Cn," min")}let Xs=!!(-2<=parseInt(He.state)&&parseInt(He.state)<=2&&parseInt(ae.state)>=99),Ks="",Js="",tn="",en=!1;tn="sunsynk"!==_t.inverter.model&&"lux"!==_t.inverter.model?"sunsynk":_t.inverter.model;let sn=ut[tn];console.log(sn);for(const Bn of Object.keys(sn)){const Fn=sn[Bn],{states:Sn,color:Rn,message:jn}=Fn;if(Sn.includes(_e.state)){Ks=Rn,Js=jn,en=!0;break}}en||("none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Ks="transparent",Js="Status"):(Ks="transparent",Js=""));let nn=(isNaN(parseFloat(qt.state))?0:parseFloat(qt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),an=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=Bs+parseInt("".concat(Ps>0?Ps:0))+parseInt("".concat(Oe<0?-1*Oe:0)),hn=Ss+Rs+parseInt("".concat(Oe>0?Oe:0))+parseInt("".concat(Ps<0?-1*Ps:0)),dn=0!=hn?Math.min(Math.round(100*rn/hn),100):0,cn=0!=rn?Math.min(Math.round(100*hn/rn),100):0,pn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Nn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Bs/(_t.solar.max_power||Bs));pn=Nn>=1?Nn:1}let vn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Dn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Ps<0?-1*Ps:Ps)/(_t.battery.max_power||(Ps<0?-1*Ps:Ps)));vn=Dn>=1?Dn:1}let _n=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let $n=_t.load.animation_speed-(_t.load.animation_speed-1)*(Ss/(_t.load.max_power||Ss));_n=$n>=1?$n:1}let yn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let On=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(_t.load.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn=On>=1?On:1}let gn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let zn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))/(_t.grid.max_power||(parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))));gn=zn>=1?zn:1}let xn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Un=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Rs/(_t.grid.max_power||Rs));xn=Un>=1?Un:1}return"full"===_t.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Qe,Qe,We,Ge,Ke,Ke,!1===As?"".concat(Vs):"100%",ps,!1===_t.show_solar?"st12":"",ds,Ke,Ke,We,!1===_s?"st12":"",Qe,Hs,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ke,!1===ts?"st12":"",1===ls?"":"none",Ke,!1===ts?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",!1===_s?"30":"143",Qe,1===ys?"":"none",!1===_s?"376":"373",!1===_s?"30":"143",Qe,2===ys?"":"none",!1===_s?"413":"410",!1===_s?"30":"143",Qe,2===ys?"":"none",We,!1===_s?"none":"",1===gs||2===gs?"":"st12",We,!1===_s?"none":"",2===gs?"":"st12",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===_t.show_solar?"none":"",ps,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,_t.solar.pv4_name,Ke,Hs,Js,1!==ys&&2!==ys||!0!==_s?"":"none",Qe,0===ys||!1===_s?"none":"",Qe,!1===_s?70:181,1===ys?"":"none",Qe,_t.load.load1_name,!1===_s?47:158,1===ys?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?393:390,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load1_name,!1===_s?394:391,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?429:426,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load2_name,!1===_s?430:427,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),2===gs?"238":"306",!1===Xe||!1===_s?"transparent":"".concat(Qe),wt("common.daily_load"),0===ys?"377":"306",0===ys?71:93,!1===Xe||!0===_s?"transparent":"".concat(Qe),wt("common.daily_load"),!1===vs||!1===_t.show_solar||"false"!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||"false"===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===cs?"transparent":"".concat(ds),!1===cs?"transparent":"".concat(ds),!1===ts?"311":"347",!1===ts?"368":"253",!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===ts?"311":"347",!1===ts?"337":"222",!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),_t.load.aux_name,!1===ts?"none":"",Ke,_t.grid.nonessential_name,!1===ts||0===ls||2===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load2_name,!1===ts||0===ls||2===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,1===gs?53:14,!1===_s||0===gs?"none":"",We,_t.load.aux_load1_name,!1===_s||0===gs||1===gs?"none":"",We,_t.load.aux_load2_name,!1===bs?"st14":"st4",!1===_s||0===gs?"none":"",We,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),!1===bs?"st14":"st4",!1===_s||0===gs||1===gs?"none":"",We,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),Ks,!0===_s?"":"none",1===ys||2===ys?"":"st12",Qe,!1===_s?"":"none",1===ys?"":"st12",Qe,!1===_s?"":"none",2===ys?"":"st12",Qe,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn/2,Ue>0||0===Ue?"transparent":"".concat(Ke),gn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn,!1===_s?"st12":"",We,!1===_s||0===Oe?"st12":"",Oe<0?"transparent":"".concat(We),yn,!1===_s||0===Oe?"st12":"",Oe>0?"transparent":"".concat(We),yn,!1===_s?"st12":"",We,Ke,Hs,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,Hs,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?"1":"0",ds,parseInt(ae.state)<=Cs?1:0,ds,!1===_t.show_solar?"st12":"",ps,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,"default"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"oven"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"boiler"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"pump"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"aircon"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,!1===ts||2===ls||1===ls?"none":"",ms,"default"===us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"===us&&"default"!=qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"!=us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,!1===ts||0===ls||1===ls?"none":"",us,!1===ts||0===ls||1===ls?"none":"",qs,"default"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,!1===ts||0===ls||2===ls?"none":"",us,1!==ys&&2!==ys||!1!==_s?"none":"",Qe,1!==ys&&2!==ys||!0!==_s?"none":"",Qe,1===ys||2===ys?"none":"",Qe,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"gen"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"inverter"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"oven"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"boiler"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"aircon"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"pump"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),!1===_s||1===gs||2===gs?"none":"",xs,"on"===ss||"1"===ss?"aux-icon":"aux-off-icon",!1===_s||0===gs?"none":"",ws,!1===_s||1===gs||0===gs?"none":"",fs,"boiler"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"boiler"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"pump"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"pump"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,0===ys||1===ys?"none":"",!0===_s?"350":"383",!0===_s?"140":"5",Ts,0===ys||1===ys?"none":"",!0===_s?"446":"420",!0===_s?"140":"5",ks,0===ys||2===ys?"none":"","336",!0===_s?"140":"27",Ts,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Zs?"232":"249","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"232":"249","off"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","off"==fe.state&&"no"!==Ls?"":"none",Hs,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Zs?"251":"268","off"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"251":"268","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","off"===we.state&&"no"!==Es?"":"none",Hs,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===gs?"238":"306",!1===Xe||!1===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===ys?"377":"306",0===ys?"57":"80",!1===Xe||!0===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ts?"311":"347",!1===ts?"354":"239",!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===ts?"311":"347",!1===ts?"323":"209",!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(At||(At=e([' '," W "])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(Zt||(Zt=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0),"none"!==_t.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0):N(Et||(Et=e([''," W "])),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,"none"!==_t.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe):N(Vt||(Vt=e([''," W "])),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe),"none"!==_t.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",Ke,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",Ke,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Hs,ye.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",Ke,ge.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Be.state||""):"lite"===_t.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Qe,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===As?!1===_t.show_solar?"246px":"".concat(Vs):!1===_t.show_solar?"75%":"100%"),Qe,ps,!1===_t.show_solar?"st12":"",ds,Ke,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Qe,1===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===cs?"transparent":"".concat(ds),wt("common.daily_charge"),!1===cs?"transparent":"".concat(ds),wt("common.daily_discharge"),2===ys?"365":"415",2===ys?"182.2":"282.1",!1===Xe?"transparent":"".concat(Qe),wt("common.daily_load"),!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===vs||!1===_t.show_solar||0!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||!1===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",ps,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,wt("common.ratio"),1===ys&&!0===_t.show_solar?"":"none",Qe,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Ks,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,0===Ss?"transparent":"".concat(Qe),_n,1===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,"oven"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,0===ys||!1===_t.show_solar?"none":"",Ts,0===ys||1===ys||!1===_t.show_solar?"none":"",ks,!1===_t.show_solar?"st12":"",ps,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?1:0,ds,parseInt(ae.state)<=Cs?1:0,ds,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,Qe,Hs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_off"),"on"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===we.state&&!1!==Es?"":"none",Hs,"on"===we.state&&!1!==Es?"":"none",Hs,"off"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_batt"),"on"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||0!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||!1===Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,Ms,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"365":"400.4",2===ys?"168":"267.9",!1===Xe?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",Hs,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",Hs,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Be.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(Ot||(Ot=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Kt||(Kt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(te||(te=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); diff --git a/src/const.ts b/src/const.ts index fb4f0736..7cade49e 100644 --- a/src/const.ts +++ b/src/const.ts @@ -1,3 +1,23 @@ import { version } from '../package.json'; export const CARD_VERSION = version; + +export const validLoadValues = [0, 1, 2] + +export const inverterStatusGroups = { + sunsynk: { + standby: { states: ['0', 'standby'], color: 'blue', message: 'Standby' }, + selftest: { states: ['1', 'selftest'], color: 'yellow', message: 'Selftest' }, + normal: { states: ['2', 'normal', 'ok'], color: 'green', message: 'Normal' }, + alarm: { states: ['3', 'alarm'], color: 'orange', message: 'Alarm' }, + fault: { states: ['4', 'fault'], color: 'red', message: 'Fault' }, + }, + lux: { + standby: { states: ['0'], color: 'blue', message: 'Standby' }, + selftest: { states: [], color: 'yellow', message: 'Selftest' }, + normal: { states: ['12', '20', '16', '4', '40'], color: 'green', message: 'Normal' }, + alarm: { states: ['64', '7'], color: 'orange', message: 'Alarm' }, + fault: { states: [], color: 'red', message: 'Fault' }, + } + +}; diff --git a/src/defaults.ts b/src/defaults.ts index d6a257eb..8c5afc9c 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -10,7 +10,8 @@ export default { inverter: { modern: true, colour: 'grey', - autarky: 'power' + autarky: 'power', + model: 'sunsynk' }, battery: { energy: 0, @@ -73,4 +74,4 @@ export default { } -export const validLoadValues = [0, 1, 2] + diff --git a/src/index.ts b/src/index.ts index e7f74833..857accdb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,8 +3,8 @@ import { customElement, property } from 'lit/decorators.js'; import { HomeAssistant } from 'custom-card-helpers'; import { styles } from './style'; import { inverterProg, sunsynkPowerFlowCardConfig } from './types'; -import defaultConfig, { validLoadValues } from './defaults'; -import { CARD_VERSION } from './const'; +import defaultConfig from './defaults'; +import { CARD_VERSION, inverterStatusGroups, validLoadValues } from './const'; import { localize } from './localize/localize'; import merge from 'lodash.merge'; @@ -133,9 +133,9 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj49 = this.hass.states[config.entities.aux_load2] || { state: '0' }; //Set defaults - let {invert_aux} = config.load; + let { invert_aux } = config.load; let aux_power = (invert_aux === true) ? parseInt(stateObj24.state) * -1 : parseInt(stateObj24.state); - let {invert_grid} = config.grid; + let { invert_grid } = config.grid; let grid_power = (invert_grid === true) ? parseInt(stateObj15.state) * -1 : parseInt(stateObj15.state); let inverter_modern = config.inverter?.modern; let load_colour = config.load?.colour; @@ -360,44 +360,37 @@ export class SunsynkPowerFlowCard extends LitElement { //Set Inverter Status Message and dot let inverterStateColour = ""; let inverterStateMsg = ""; + let inverterModel = ""; + let found = false; - switch (stateObj21.state) { - case '0': - case 'standby': - inverterStateColour = 'blue'; - inverterStateMsg = 'Standby'; - break; - case '1': - case 'selftest': - inverterStateColour = 'yellow'; - inverterStateMsg = 'Selftest'; - break; - case '2': - case 'normal': - case 'ok': - inverterStateColour = 'green'; - inverterStateMsg = 'Normal'; - break; - case '3': - case 'alarm': - inverterStateColour = 'orange'; - inverterStateMsg = 'Alarm'; - break; - case '4': - case 'fault': - inverterStateColour = 'red'; - inverterStateMsg = 'Fault'; - break; - default: - if (config.entities?.inverter_status_59 === 'none' || !config.entities?.inverter_status_59) { - inverterStateColour = 'transparent'; - inverterStateMsg = ''; - } else { - inverterStateColour = 'transparent'; - inverterStateMsg = 'Status'; - } + if (config.inverter.model !== 'sunsynk' && config.inverter.model !== 'lux') { + inverterModel = 'sunsynk'; + } else { + inverterModel = config.inverter.model; + } + + let typeStatusGroups = inverterStatusGroups[inverterModel]; + console.log(typeStatusGroups); + for (const groupKey of Object.keys(typeStatusGroups)) { + const info = typeStatusGroups[groupKey]; + const { states, color, message } = info; + if (states.includes(stateObj21.state)) { + inverterStateColour = color; + inverterStateMsg = message; + found = true; break; + } } + if (!found) { + if (config.entities?.inverter_status_59 === 'none' || !config.entities?.inverter_status_59) { + inverterStateColour = 'transparent'; + inverterStateMsg = ''; + } else { + inverterStateColour = 'transparent'; + inverterStateMsg = 'Status'; + } + } + //Autarky in Percent = Home Production / Home Consumption //Ratio in Percent = Home Consumption / Home Production diff --git a/src/types.ts b/src/types.ts index f2b00660..589c3e03 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,6 +17,7 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { modern: boolean; colour: string; autarky: string; + model: string; } battery: { energy: number; From 0e9ee6f9085a65f502f16840aaeb6c1363562549 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:27:15 +0100 Subject: [PATCH 11/40] chore: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c93f6bbc..fcff9fbe 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ The card can be configured through the following attributes: |modern:| Optional |`true`| Changes the inverter image.| |colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| -| model: | Optional | `sunsynk` | Enables showing the state for `sunsynk` or `lux` inverters.
NOTE: this still needs work as I don't have all Lux states | +| model: | Optional | `sunsynk` | set to `lux` for Lux inverters, states overlap so require this setting.
NOTE: this still needs work as I don't have all Lux states | ### Battery From 74ffe68130b1a0bb85ba99af442d3d0fe4f9cc3c Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:31:05 +0100 Subject: [PATCH 12/40] chore: remove console.log --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 857accdb..9ffc3aaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -370,7 +370,7 @@ export class SunsynkPowerFlowCard extends LitElement { } let typeStatusGroups = inverterStatusGroups[inverterModel]; - console.log(typeStatusGroups); + for (const groupKey of Object.keys(typeStatusGroups)) { const info = typeStatusGroups[groupKey]; const { states, color, message } = info; From c58cf6cfba4c614237489aaacadf9f939804b0c5 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:31:22 +0100 Subject: [PATCH 13/40] chore: remove console.log --- dist/sunsynk-power-flow-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index faf890f6..98dc7f0a 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));fn[e]=new Date(wn.getTime()),fn[e].setHours(s),fn[e].setMinutes(n)}));const[mn,un,qn,Tn,kn,Mn]=fn;function bn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Us.charge="none":Us.charge="both",Us.capacity=parseInt(t.capacity.state),Us.entityID=e}wn>=Mn||wn=mn&&wn=un&&wn=qn&&wn=Tn&&wn=kn&&wn0?Ys="off"===ve.state||!1===Us.show||parseInt(ae.state)<=Us.capacity?_t.battery.shutdown_soc:Us.capacity:Ps<0&&("off"===ve.state||!1===Us.show||parseInt(ae.state)>=Us.capacity?Ys=100:parseInt(ae.state)0?Qs=(parseInt(ae.state)-Ys)/100*_t.battery.energy/Ps*60*60:Ps<0&&(Qs=(Ys-parseInt(ae.state))/100*_t.battery.energy/Ps*60*60*-1);const An=new Date,Hn=1e3*Qs,Zn=new Date(An.getTime()+Hn),Ln=Zn.getHours(),En=Zn.getMinutes().toString().padStart(2,"0"),Pn=Ln.toString().padStart(2,"0");Ws="".concat(Pn,":").concat(En);const Vn=Math.floor(Qs/86400),In=Math.floor(Qs%86400/3600),Cn=Math.floor(Qs%3600/60);Vn>0&&(Gs+="".concat(Vn," days, ")),(In>0||Vn>0)&&(Gs+="".concat(In," hrs, ")),Gs+="".concat(Cn," min")}let Xs=!!(-2<=parseInt(He.state)&&parseInt(He.state)<=2&&parseInt(ae.state)>=99),Ks="",Js="",tn="",en=!1;tn="sunsynk"!==_t.inverter.model&&"lux"!==_t.inverter.model?"sunsynk":_t.inverter.model;let sn=ut[tn];console.log(sn);for(const Bn of Object.keys(sn)){const Fn=sn[Bn],{states:Sn,color:Rn,message:jn}=Fn;if(Sn.includes(_e.state)){Ks=Rn,Js=jn,en=!0;break}}en||("none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Ks="transparent",Js="Status"):(Ks="transparent",Js=""));let nn=(isNaN(parseFloat(qt.state))?0:parseFloat(qt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),an=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=Bs+parseInt("".concat(Ps>0?Ps:0))+parseInt("".concat(Oe<0?-1*Oe:0)),hn=Ss+Rs+parseInt("".concat(Oe>0?Oe:0))+parseInt("".concat(Ps<0?-1*Ps:0)),dn=0!=hn?Math.min(Math.round(100*rn/hn),100):0,cn=0!=rn?Math.min(Math.round(100*hn/rn),100):0,pn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Nn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Bs/(_t.solar.max_power||Bs));pn=Nn>=1?Nn:1}let vn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Dn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Ps<0?-1*Ps:Ps)/(_t.battery.max_power||(Ps<0?-1*Ps:Ps)));vn=Dn>=1?Dn:1}let _n=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let $n=_t.load.animation_speed-(_t.load.animation_speed-1)*(Ss/(_t.load.max_power||Ss));_n=$n>=1?$n:1}let yn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let On=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(_t.load.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn=On>=1?On:1}let gn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let zn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))/(_t.grid.max_power||(parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))));gn=zn>=1?zn:1}let xn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Un=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Rs/(_t.grid.max_power||Rs));xn=Un>=1?Un:1}return"full"===_t.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Qe,Qe,We,Ge,Ke,Ke,!1===As?"".concat(Vs):"100%",ps,!1===_t.show_solar?"st12":"",ds,Ke,Ke,We,!1===_s?"st12":"",Qe,Hs,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ke,!1===ts?"st12":"",1===ls?"":"none",Ke,!1===ts?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",!1===_s?"30":"143",Qe,1===ys?"":"none",!1===_s?"376":"373",!1===_s?"30":"143",Qe,2===ys?"":"none",!1===_s?"413":"410",!1===_s?"30":"143",Qe,2===ys?"":"none",We,!1===_s?"none":"",1===gs||2===gs?"":"st12",We,!1===_s?"none":"",2===gs?"":"st12",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===_t.show_solar?"none":"",ps,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,_t.solar.pv4_name,Ke,Hs,Js,1!==ys&&2!==ys||!0!==_s?"":"none",Qe,0===ys||!1===_s?"none":"",Qe,!1===_s?70:181,1===ys?"":"none",Qe,_t.load.load1_name,!1===_s?47:158,1===ys?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?393:390,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load1_name,!1===_s?394:391,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?429:426,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load2_name,!1===_s?430:427,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),2===gs?"238":"306",!1===Xe||!1===_s?"transparent":"".concat(Qe),wt("common.daily_load"),0===ys?"377":"306",0===ys?71:93,!1===Xe||!0===_s?"transparent":"".concat(Qe),wt("common.daily_load"),!1===vs||!1===_t.show_solar||"false"!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||"false"===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===cs?"transparent":"".concat(ds),!1===cs?"transparent":"".concat(ds),!1===ts?"311":"347",!1===ts?"368":"253",!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===ts?"311":"347",!1===ts?"337":"222",!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),_t.load.aux_name,!1===ts?"none":"",Ke,_t.grid.nonessential_name,!1===ts||0===ls||2===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load2_name,!1===ts||0===ls||2===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,1===gs?53:14,!1===_s||0===gs?"none":"",We,_t.load.aux_load1_name,!1===_s||0===gs||1===gs?"none":"",We,_t.load.aux_load2_name,!1===bs?"st14":"st4",!1===_s||0===gs?"none":"",We,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),!1===bs?"st14":"st4",!1===_s||0===gs||1===gs?"none":"",We,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),Ks,!0===_s?"":"none",1===ys||2===ys?"":"st12",Qe,!1===_s?"":"none",1===ys?"":"st12",Qe,!1===_s?"":"none",2===ys?"":"st12",Qe,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn/2,Ue>0||0===Ue?"transparent":"".concat(Ke),gn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn,!1===_s?"st12":"",We,!1===_s||0===Oe?"st12":"",Oe<0?"transparent":"".concat(We),yn,!1===_s||0===Oe?"st12":"",Oe>0?"transparent":"".concat(We),yn,!1===_s?"st12":"",We,Ke,Hs,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,Hs,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?"1":"0",ds,parseInt(ae.state)<=Cs?1:0,ds,!1===_t.show_solar?"st12":"",ps,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,"default"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"oven"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"boiler"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"pump"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"aircon"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,!1===ts||2===ls||1===ls?"none":"",ms,"default"===us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"===us&&"default"!=qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"!=us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,!1===ts||0===ls||1===ls?"none":"",us,!1===ts||0===ls||1===ls?"none":"",qs,"default"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,!1===ts||0===ls||2===ls?"none":"",us,1!==ys&&2!==ys||!1!==_s?"none":"",Qe,1!==ys&&2!==ys||!0!==_s?"none":"",Qe,1===ys||2===ys?"none":"",Qe,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"gen"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"inverter"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"oven"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"boiler"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"aircon"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"pump"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),!1===_s||1===gs||2===gs?"none":"",xs,"on"===ss||"1"===ss?"aux-icon":"aux-off-icon",!1===_s||0===gs?"none":"",ws,!1===_s||1===gs||0===gs?"none":"",fs,"boiler"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"boiler"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"pump"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"pump"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,0===ys||1===ys?"none":"",!0===_s?"350":"383",!0===_s?"140":"5",Ts,0===ys||1===ys?"none":"",!0===_s?"446":"420",!0===_s?"140":"5",ks,0===ys||2===ys?"none":"","336",!0===_s?"140":"27",Ts,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Zs?"232":"249","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"232":"249","off"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","off"==fe.state&&"no"!==Ls?"":"none",Hs,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Zs?"251":"268","off"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"251":"268","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","off"===we.state&&"no"!==Es?"":"none",Hs,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===gs?"238":"306",!1===Xe||!1===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===ys?"377":"306",0===ys?"57":"80",!1===Xe||!0===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ts?"311":"347",!1===ts?"354":"239",!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===ts?"311":"347",!1===ts?"323":"209",!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(At||(At=e([' '," W "])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(Zt||(Zt=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0),"none"!==_t.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0):N(Et||(Et=e([''," W "])),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,"none"!==_t.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe):N(Vt||(Vt=e([''," W "])),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe),"none"!==_t.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",Ke,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",Ke,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Hs,ye.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",Ke,ge.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Be.state||""):"lite"===_t.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Qe,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===As?!1===_t.show_solar?"246px":"".concat(Vs):!1===_t.show_solar?"75%":"100%"),Qe,ps,!1===_t.show_solar?"st12":"",ds,Ke,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Qe,1===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===cs?"transparent":"".concat(ds),wt("common.daily_charge"),!1===cs?"transparent":"".concat(ds),wt("common.daily_discharge"),2===ys?"365":"415",2===ys?"182.2":"282.1",!1===Xe?"transparent":"".concat(Qe),wt("common.daily_load"),!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===vs||!1===_t.show_solar||0!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||!1===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",ps,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,wt("common.ratio"),1===ys&&!0===_t.show_solar?"":"none",Qe,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Ks,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,0===Ss?"transparent":"".concat(Qe),_n,1===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,"oven"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,0===ys||!1===_t.show_solar?"none":"",Ts,0===ys||1===ys||!1===_t.show_solar?"none":"",ks,!1===_t.show_solar?"st12":"",ps,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?1:0,ds,parseInt(ae.state)<=Cs?1:0,ds,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,Qe,Hs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_off"),"on"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===we.state&&!1!==Es?"":"none",Hs,"on"===we.state&&!1!==Es?"":"none",Hs,"off"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_batt"),"on"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||0!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||!1===Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,Ms,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"365":"400.4",2===ys?"168":"267.9",!1===Xe?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",Hs,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",Hs,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Be.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(Ot||(Ot=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Kt||(Kt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(te||(te=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));fn[e]=new Date(wn.getTime()),fn[e].setHours(s),fn[e].setMinutes(n)}));const[mn,un,qn,Tn,kn,Mn]=fn;function bn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Us.charge="none":Us.charge="both",Us.capacity=parseInt(t.capacity.state),Us.entityID=e}wn>=Mn||wn=mn&&wn=un&&wn=qn&&wn=Tn&&wn=kn&&wn0?Ys="off"===ve.state||!1===Us.show||parseInt(ae.state)<=Us.capacity?_t.battery.shutdown_soc:Us.capacity:Ps<0&&("off"===ve.state||!1===Us.show||parseInt(ae.state)>=Us.capacity?Ys=100:parseInt(ae.state)0?Qs=(parseInt(ae.state)-Ys)/100*_t.battery.energy/Ps*60*60:Ps<0&&(Qs=(Ys-parseInt(ae.state))/100*_t.battery.energy/Ps*60*60*-1);const An=new Date,Hn=1e3*Qs,Zn=new Date(An.getTime()+Hn),Ln=Zn.getHours(),En=Zn.getMinutes().toString().padStart(2,"0"),Pn=Ln.toString().padStart(2,"0");Ws="".concat(Pn,":").concat(En);const Vn=Math.floor(Qs/86400),In=Math.floor(Qs%86400/3600),Cn=Math.floor(Qs%3600/60);Vn>0&&(Gs+="".concat(Vn," days, ")),(In>0||Vn>0)&&(Gs+="".concat(In," hrs, ")),Gs+="".concat(Cn," min")}let Xs=!!(-2<=parseInt(He.state)&&parseInt(He.state)<=2&&parseInt(ae.state)>=99),Ks="",Js="",tn="",en=!1;tn="sunsynk"!==_t.inverter.model&&"lux"!==_t.inverter.model?"sunsynk":_t.inverter.model;let sn=ut[tn];for(const Bn of Object.keys(sn)){const Fn=sn[Bn],{states:Sn,color:Rn,message:jn}=Fn;if(Sn.includes(_e.state)){Ks=Rn,Js=jn,en=!0;break}}en||("none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Ks="transparent",Js="Status"):(Ks="transparent",Js=""));let nn=(isNaN(parseFloat(qt.state))?0:parseFloat(qt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),an=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=Bs+parseInt("".concat(Ps>0?Ps:0))+parseInt("".concat(Oe<0?-1*Oe:0)),hn=Ss+Rs+parseInt("".concat(Oe>0?Oe:0))+parseInt("".concat(Ps<0?-1*Ps:0)),dn=0!=hn?Math.min(Math.round(100*rn/hn),100):0,cn=0!=rn?Math.min(Math.round(100*hn/rn),100):0,pn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Nn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Bs/(_t.solar.max_power||Bs));pn=Nn>=1?Nn:1}let vn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Dn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Ps<0?-1*Ps:Ps)/(_t.battery.max_power||(Ps<0?-1*Ps:Ps)));vn=Dn>=1?Dn:1}let _n=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let $n=_t.load.animation_speed-(_t.load.animation_speed-1)*(Ss/(_t.load.max_power||Ss));_n=$n>=1?$n:1}let yn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let On=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(_t.load.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn=On>=1?On:1}let gn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let zn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))/(_t.grid.max_power||(parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))));gn=zn>=1?zn:1}let xn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Un=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Rs/(_t.grid.max_power||Rs));xn=Un>=1?Un:1}return"full"===_t.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Qe,Qe,We,Ge,Ke,Ke,!1===As?"".concat(Vs):"100%",ps,!1===_t.show_solar?"st12":"",ds,Ke,Ke,We,!1===_s?"st12":"",Qe,Hs,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ke,!1===ts?"st12":"",1===ls?"":"none",Ke,!1===ts?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",!1===_s?"30":"143",Qe,1===ys?"":"none",!1===_s?"376":"373",!1===_s?"30":"143",Qe,2===ys?"":"none",!1===_s?"413":"410",!1===_s?"30":"143",Qe,2===ys?"":"none",We,!1===_s?"none":"",1===gs||2===gs?"":"st12",We,!1===_s?"none":"",2===gs?"":"st12",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===_t.show_solar?"none":"",ps,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,_t.solar.pv4_name,Ke,Hs,Js,1!==ys&&2!==ys||!0!==_s?"":"none",Qe,0===ys||!1===_s?"none":"",Qe,!1===_s?70:181,1===ys?"":"none",Qe,_t.load.load1_name,!1===_s?47:158,1===ys?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?393:390,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load1_name,!1===_s?394:391,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?429:426,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load2_name,!1===_s?430:427,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),2===gs?"238":"306",!1===Xe||!1===_s?"transparent":"".concat(Qe),wt("common.daily_load"),0===ys?"377":"306",0===ys?71:93,!1===Xe||!0===_s?"transparent":"".concat(Qe),wt("common.daily_load"),!1===vs||!1===_t.show_solar||"false"!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||"false"===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===cs?"transparent":"".concat(ds),!1===cs?"transparent":"".concat(ds),!1===ts?"311":"347",!1===ts?"368":"253",!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===ts?"311":"347",!1===ts?"337":"222",!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),_t.load.aux_name,!1===ts?"none":"",Ke,_t.grid.nonessential_name,!1===ts||0===ls||2===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load2_name,!1===ts||0===ls||2===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,1===gs?53:14,!1===_s||0===gs?"none":"",We,_t.load.aux_load1_name,!1===_s||0===gs||1===gs?"none":"",We,_t.load.aux_load2_name,!1===bs?"st14":"st4",!1===_s||0===gs?"none":"",We,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),!1===bs?"st14":"st4",!1===_s||0===gs||1===gs?"none":"",We,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),Ks,!0===_s?"":"none",1===ys||2===ys?"":"st12",Qe,!1===_s?"":"none",1===ys?"":"st12",Qe,!1===_s?"":"none",2===ys?"":"st12",Qe,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn/2,Ue>0||0===Ue?"transparent":"".concat(Ke),gn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn,!1===_s?"st12":"",We,!1===_s||0===Oe?"st12":"",Oe<0?"transparent":"".concat(We),yn,!1===_s||0===Oe?"st12":"",Oe>0?"transparent":"".concat(We),yn,!1===_s?"st12":"",We,Ke,Hs,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,Hs,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?"1":"0",ds,parseInt(ae.state)<=Cs?1:0,ds,!1===_t.show_solar?"st12":"",ps,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,"default"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"oven"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"boiler"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"pump"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"aircon"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,!1===ts||2===ls||1===ls?"none":"",ms,"default"===us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"===us&&"default"!=qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"!=us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,!1===ts||0===ls||1===ls?"none":"",us,!1===ts||0===ls||1===ls?"none":"",qs,"default"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,!1===ts||0===ls||2===ls?"none":"",us,1!==ys&&2!==ys||!1!==_s?"none":"",Qe,1!==ys&&2!==ys||!0!==_s?"none":"",Qe,1===ys||2===ys?"none":"",Qe,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"gen"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"inverter"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"oven"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"boiler"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"aircon"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"pump"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),!1===_s||1===gs||2===gs?"none":"",xs,"on"===ss||"1"===ss?"aux-icon":"aux-off-icon",!1===_s||0===gs?"none":"",ws,!1===_s||1===gs||0===gs?"none":"",fs,"boiler"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"boiler"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"pump"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"pump"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,0===ys||1===ys?"none":"",!0===_s?"350":"383",!0===_s?"140":"5",Ts,0===ys||1===ys?"none":"",!0===_s?"446":"420",!0===_s?"140":"5",ks,0===ys||2===ys?"none":"","336",!0===_s?"140":"27",Ts,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Zs?"232":"249","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"232":"249","off"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","off"==fe.state&&"no"!==Ls?"":"none",Hs,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Zs?"251":"268","off"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"251":"268","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","off"===we.state&&"no"!==Es?"":"none",Hs,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===gs?"238":"306",!1===Xe||!1===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===ys?"377":"306",0===ys?"57":"80",!1===Xe||!0===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ts?"311":"347",!1===ts?"354":"239",!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===ts?"311":"347",!1===ts?"323":"209",!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(At||(At=e([' '," W "])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(Zt||(Zt=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0),"none"!==_t.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0):N(Et||(Et=e([''," W "])),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,"none"!==_t.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe):N(Vt||(Vt=e([''," W "])),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe),"none"!==_t.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",Ke,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",Ke,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Hs,ye.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",Ke,ge.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Be.state||""):"lite"===_t.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Qe,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===As?!1===_t.show_solar?"246px":"".concat(Vs):!1===_t.show_solar?"75%":"100%"),Qe,ps,!1===_t.show_solar?"st12":"",ds,Ke,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Qe,1===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===cs?"transparent":"".concat(ds),wt("common.daily_charge"),!1===cs?"transparent":"".concat(ds),wt("common.daily_discharge"),2===ys?"365":"415",2===ys?"182.2":"282.1",!1===Xe?"transparent":"".concat(Qe),wt("common.daily_load"),!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===vs||!1===_t.show_solar||0!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||!1===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",ps,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,wt("common.ratio"),1===ys&&!0===_t.show_solar?"":"none",Qe,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Ks,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,0===Ss?"transparent":"".concat(Qe),_n,1===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,"oven"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,0===ys||!1===_t.show_solar?"none":"",Ts,0===ys||1===ys||!1===_t.show_solar?"none":"",ks,!1===_t.show_solar?"st12":"",ps,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?1:0,ds,parseInt(ae.state)<=Cs?1:0,ds,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,Qe,Hs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_off"),"on"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===we.state&&!1!==Es?"":"none",Hs,"on"===we.state&&!1!==Es?"":"none",Hs,"off"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_batt"),"on"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||0!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||!1===Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,Ms,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"365":"400.4",2===ys?"168":"267.9",!1===Xe?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",Hs,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",Hs,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Be.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(Ot||(Ot=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Kt||(Kt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(te||(te=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); From e4ad91b6d1f7d186b9cc93631e17c18e6319f6fb Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:48:41 +0000 Subject: [PATCH 14/40] docs: move examples to sphinx docs --- .gitignore | 1 + README.md | 279 ----------------------------------- docs/contribute/docs.rst | 2 + docs/examples/lux.rst | 64 ++++++++ docs/examples/sunsynk.rst | 301 ++++++++++++++++++++++++++++++++++++++ docs/toc.rst | 9 +- package.json | 3 +- 7 files changed, 377 insertions(+), 282 deletions(-) create mode 100644 docs/examples/lux.rst create mode 100644 docs/examples/sunsynk.rst diff --git a/.gitignore b/.gitignore index 89d52e6c..d4c8b0b7 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ undefined/ .dynamodb/ docs/_build +_build diff --git a/README.md b/README.md index fcff9fbe..002424e1 100644 --- a/README.md +++ b/README.md @@ -244,282 +244,3 @@ The card calculates the sensors below based on supplied attributes in the config The modbus registers can be visualised on the `full` card below: ![image](https://user-images.githubusercontent.com/7227275/235479493-b322d5b2-f2b1-431f-9048-f845fc2989b4.png) - -### Example Card Configuration - -#### Minimum Configuration (No Solar) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -show_solar: 'no' -battery: - energy: 15960 - shutdown_soc: 20 -entities: - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - grid_ct_power_172: sensor.sunsynk_grid_ct_power -``` - -#### Minimum Configuration (Solar) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -show_solar: 'yes' -solar: - mppts: one -battery: - energy: 15960 - shutdown_soc: 20 -entities: - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - grid_ct_power_172: sensor.sunsynk_grid_ct_power - pv1_power_186: sensor.sunsynk_pv1_power -``` - -#### Minimal Configuration (No Solar) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -show_solar: 'no' -battery: - energy: 15960 - shutdown_soc: 20 -entities: - inverter_voltage_154: sensor.sunsynk_inverter_voltage - load_frequency_192: sensor.sunsynk_load_frequency - inverter_current_164: sensor.sunsynk_inverter_current - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - battery_voltage_183: sensor.sunsynk_battery_voltage - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - grid_ct_power_172: sensor.sunsynk_grid_ct_power - grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status - inverter_status_59: sensor.overall_state -``` - -#### Minimal Configuration (Solar) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -show_solar: 'yes' -solar: - mppts: two -battery: - energy: 15960 - shutdown_soc: 20 -load: - show_aux: 'no' -entities: - inverter_voltage_154: sensor.sunsynk_inverter_voltage - load_frequency_192: sensor.sunsynk_load_frequency - inverter_current_164: sensor.sunsynk_inverter_current - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - battery_voltage_183: sensor.sunsynk_battery_voltage - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - grid_ct_power_172: sensor.sunsynk_grid_ct_power - grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status - inverter_status_59: sensor.sunsynk_overall_state - pv1_power_186: sensor.sunsynk_pv1_power - pv2_power_187: sensor.sunsynk_pv2_power - pv1_voltage_109: sensor.sunsynk_pv1_voltage - pv1_current_110: sensor.sunsynk_pv1_current - pv2_voltage_111: sensor.sunsynk_pv2_voltage - pv2_current_112: sensor.sunsynk_pv2_current -``` - -#### Minimal Configuration (Solar + Daily Totals) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -show_solar: true -solar: - mppts: 2 - show_daily: true -battery: - energy: 15960 - shutdown_soc: 20 - show_daily: true -load: - show_daily: true -grid: - show_daily_buy: true -entities: - inverter_voltage_154: sensor.sunsynk_inverter_voltage - load_frequency_192: sensor.sunsynk_load_frequency - inverter_current_164: sensor.sunsynk_inverter_current - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - battery_voltage_183: sensor.sunsynk_battery_voltage - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - grid_ct_power_172: sensor.sunsynk_grid_ct_power - grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status - inverter_status_59: sensor.sunsynk_overall_state - pv1_power_186: sensor.sunsynk_pv1_power - pv2_power_187: sensor.sunsynk_pv2_power - pv1_voltage_109: sensor.sunsynk_pv1_voltage - pv1_current_110: sensor.sunsynk_pv1_current - pv2_voltage_111: sensor.sunsynk_pv2_voltage - pv2_current_112: sensor.sunsynk_pv2_current - day_pv_energy_108: sensor.sunsynk_day_pv_energy - day_battery_charge_70: sensor.sunsynk_day_battery_charge - day_battery_discharge_71: sensor.sunsynk_day_battery_discharge - day_load_energy_84: sensor.sunsynk_day_load_energy - day_grid_import_76: sensor.sunsynk_day_grid_import -``` - -#### Full Configuration (All Options) ##### - -```yaml -type: custom:sunsynk-power-flow-card -cardstyle: full -panel_mode: false -large_font: false -show_solar: true -inverter: - modern: true - colour: grey - autarky: 'power' -battery: - energy: 15960 - shutdown_soc: 20 - invert_power: false - colour: pink - show_daily: true - animation_speed: 6 - max_power: 4500 - full_capacity: 80 - empty_capacity: 30 -solar: - colour: orange - show_daily: true - mppts: 2 - animation_speed: 9 - max_power: 8000 - pv1_name: North - pv2_name: North - pv3_name: East - pv4_name: West -load: - colour: '#5fb6ad' - show_daily: true - show_aux: true - invert_aux: false - aux_name: Generator - aux_type: gen - aux_colour: green - aux_off_colour: red - aux_loads: 2 - aux_load1_name: Aux load 1 - aux_load2_name: Aux load 2 - aux_load1_icon: mdi:air-filter - aux_load2_icon: mdi:stove - animation_speed: 8 - max_power: 8000 - additional_loads: 2 - load1_name: Geyser - load2_name: Pool - load1_icon: boiler - load2_icon: mdi:pool -grid: - colour: '#5490c2' - show_daily_buy: true - show_daily_sell: true - no_grid_colour: '#a40013' - show_nonessential: true - invert_grid: false - nonessential_name: Non Essential - nonessential_icon: oven - additional_loads: 2 - load1_name: Load 1 - load2_name: Load 2 - load1_icon: boiler - load2_icon: mdi:ev-station - animation_speed: 8 - max_power: 8000 -entities: - use_timer_248: switch.sunsynk_toggle_system_timer - priority_load_243: switch.sunsynk_toggle_priority_load - day_battery_charge_70: sensor.sunsynk_day_battery_charge - day_battery_discharge_71: sensor.sunsynk_day_battery_discharge - day_load_energy_84: sensor.sunsynk_day_load_energy - day_grid_import_76: sensor.sunsynk_day_grid_import - day_grid_export_77: sensor.sunsynk_day_grid_export - day_pv_energy_108: sensor.sunsynk_day_pv_energy - inverter_voltage_154: sensor.sunsynk_inverter_voltage - load_frequency_192: sensor.sunsynk_load_frequency - inverter_current_164: sensor.sunsynk_inverter_current - inverter_power_175: sensor.sunsynk_inverter_power - grid_power_169: sensor.sunsynk_grid_power - pv1_power_186: sensor.sunsynk_pv1_power - pv2_power_187: sensor.sunsynk_pv2_power - pv3_power_188: none - pv4_power_189: none - pv_total: sensor.sunsynk_totalsolar - pv1_voltage_109: sensor.sunsynk_pv1_voltage - pv1_current_110: sensor.sunsynk_pv1_current - pv2_voltage_111: sensor.sunsynk_pv2_voltage - pv2_current_112: sensor.sunsynk_pv2_current - pv3_voltage_113: none - pv3_current_114: none - pv4_voltage_115: none - pv4_current_116: none - battery_voltage_183: sensor.sunsynk_battery_voltage - battery_soc_184: sensor.sunsynk_battery_soc - battery_power_190: sensor.sunsynk_battery_power - battery_current_191: sensor.sunsynk_battery_current - essential_power: none - essential_load1: sensor.tuya_geyser_current_consumption - essential_load2: sensor.load2_power - nonessential_power: none - non_essential_load1: sensor.nonessential1_power - non_essential_load2: sensor.nonessential2_power - grid_ct_power_172: sensor.sunsynk_grid_ct_power - grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status - inverter_status_59: sensor.sunsynk_overall_state - aux_power_166: sensor.sunsynk_aux_power - aux_connected_status: binary_sensor.sunsynk_aux_connected_status - remaining_solar: sensor.solcast_forecast_remaining_today - battery_temp_182: sensor.sunsynk_battery_temperature - radiator_temp_91: sensor.sunsynk_radiator_temperature - dc_transformer_temp_90: sensor.sunsynk_dc_transformer_temperature - prog1_time: sensor.sunsynk_time_slot_1 - prog1_capacity: number.sunsynk_system_mode_soc_time1 - prog1_charge: switch.sunsynk_system_mode_grid_charge_time1 - prog2_time: sensor.sunsynk_time_slot_2 - prog2_capacity: number.sunsynk_system_mode_soc_time2 - prog2_charge: switch.sunsynk_system_mode_grid_charge_time2 - prog3_time: sensor.sunsynk_time_slot_3 - prog3_capacity: number.sunsynk_system_mode_soc_time3 - prog3_charge: switch.sunsynk_system_mode_grid_charge_time3 - prog4_time: sensor.sunsynk_time_slot_4 - prog4_capacity: number.sunsynk_system_mode_soc_time4 - prog4_charge: switch.sunsynk_system_mode_grid_charge_time4 - prog5_time: sensor.sunsynk_time_slot_5 - prog5_capacity: number.sunsynk_system_mode_soc_time5 - prog5_charge: switch.sunsynk_system_mode_grid_charge_time5 - prog6_time: sensor.sunsynk_time_slot_6 - prog6_capacity: number.sunsynk_system_mode_soc_time6 - prog6_charge: switch.sunsynk_system_mode_grid_charge_time6 - energy_cost: sensor.tibber_energy_cost - solar_sell_247: switch.sunsynk_toggle_solar_sell -``` diff --git a/docs/contribute/docs.rst b/docs/contribute/docs.rst index 3be9deda..29d168cd 100644 --- a/docs/contribute/docs.rst +++ b/docs/contribute/docs.rst @@ -22,3 +22,5 @@ Adding pages To add new pages, add a new file in the appropriate directory, and then add a reference to the ``toc.rst`` file under the correct heading. + +You can test the pages added by running the command ``yarn run docs-test`` diff --git a/docs/examples/lux.rst b/docs/examples/lux.rst new file mode 100644 index 00000000..23e917bd --- /dev/null +++ b/docs/examples/lux.rst @@ -0,0 +1,64 @@ +########################## +Lux Inverter Configuration +########################## + + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: lite + show_solar: true + inverter: + model: lux + battery: + show: true + energy: 12800 + shutdown_soc: 1 + show_daily: true + invert_power: true + solar: + show_daily: true + mppts: 2 + pv1_name: Rear + pv2_name: Front + load: + show_daily: true + grid: + show_daily_buy: true + show_daily_sell: true + show_nonessential: false + invert_grid: true + additional_loads: 2 + entities: + inverter_voltage_154: sensor.lux_grid_voltage_live + load_frequency_192: sensor.lux_grid_frequency_live + inverter_current_164: sensor.inverter_output_current + inverter_status_59: sensor.lux_status + inverter_power_175: sensor.lux_battery_flow_live + day_battery_charge_70: sensor.lux_battery_charge_daily + day_battery_discharge_71: sensor.lux_battery_discharge_daily + battery_voltage_183: sensor.lux_battery_voltage_live + battery_soc_184: sensor.lux_battery + battery_power_190: sensor.lux_battery_flow_live + battery_current_191: sensor.lux_battery_capacity_ah + grid_power_169: sensor.lux_grid_flow_live + day_grid_import_76: sensor.lux_power_from_grid_daily + day_grid_export_77: sensor.lux_power_to_grid_daily + grid_ct_power_172: sensor.lux_grid_flow_live + day_load_energy_84: sensor.lux_power_from_inverter_to_home_daily + essential_power: sensor.lux_home_consumption_live + nonessential_power: none + aux_power_166: sensor.aux_output_power + day_pv_energy_108: sensor.lux_solar_output_daily + pv_total: sensor.lux_solar_output_live + pv1_power_186: sensor.lux_solar_output_array_1_live + pv2_power_187: sensor.lux_solar_output_array_2_live + pv1_voltage_109: sensor.lux_solar_voltage_array_1_live + pv1_current_110: none + pv2_voltage_111: sensor.lux_solar_voltage_array_2_live + pv2_current_112: none + radiator_temp_91: sensor.lux_radiator_1_temperature_live + dc_transformer_temp_90: sensor.lux_radiator_2_temperature_live + remaining_solar: sensor.forecast_remaining_today + energy_cost: sensor.octopus_energy_electricity_20e5081533_2380002009185_current_rate diff --git a/docs/examples/sunsynk.rst b/docs/examples/sunsynk.rst new file mode 100644 index 00000000..a5a1ebe8 --- /dev/null +++ b/docs/examples/sunsynk.rst @@ -0,0 +1,301 @@ +############################## +Sunsynk Inverter Configuration +############################## + + +******************************** +Minimum Configuration (No Solar) +******************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + show_solar: 'no' + battery: + energy: 15960 + shutdown_soc: 20 + entities: + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + grid_ct_power_172: sensor.sunsynk_grid_ct_power + + +***************************** +Minimum Configuration (Solar) +***************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + show_solar: 'yes' + solar: + mppts: one + battery: + energy: 15960 + shutdown_soc: 20 + entities: + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + grid_ct_power_172: sensor.sunsynk_grid_ct_power + pv1_power_186: sensor.sunsynk_pv1_power + +***************************** +Minimal Configuration (No Solar) +***************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + show_solar: 'no' + battery: + energy: 15960 + shutdown_soc: 20 + entities: + inverter_voltage_154: sensor.sunsynk_inverter_voltage + load_frequency_192: sensor.sunsynk_load_frequency + inverter_current_164: sensor.sunsynk_inverter_current + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + battery_voltage_183: sensor.sunsynk_battery_voltage + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + grid_ct_power_172: sensor.sunsynk_grid_ct_power + grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status + inverter_status_59: sensor.overall_state + + +***************************** +Minimal Configuration (Solar) +***************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + show_solar: 'yes' + solar: + mppts: two + battery: + energy: 15960 + shutdown_soc: 20 + load: + show_aux: 'no' + entities: + inverter_voltage_154: sensor.sunsynk_inverter_voltage + load_frequency_192: sensor.sunsynk_load_frequency + inverter_current_164: sensor.sunsynk_inverter_current + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + battery_voltage_183: sensor.sunsynk_battery_voltage + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + grid_ct_power_172: sensor.sunsynk_grid_ct_power + grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status + inverter_status_59: sensor.sunsynk_overall_state + pv1_power_186: sensor.sunsynk_pv1_power + pv2_power_187: sensor.sunsynk_pv2_power + pv1_voltage_109: sensor.sunsynk_pv1_voltage + pv1_current_110: sensor.sunsynk_pv1_current + pv2_voltage_111: sensor.sunsynk_pv2_voltage + pv2_current_112: sensor.sunsynk_pv2_current + +******************************************** +Minimal Configuration (Solar + Daily Totals) +******************************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + show_solar: true + solar: + mppts: 2 + show_daily: true + battery: + energy: 15960 + shutdown_soc: 20 + show_daily: true + load: + show_daily: true + grid: + show_daily_buy: true + entities: + inverter_voltage_154: sensor.sunsynk_inverter_voltage + load_frequency_192: sensor.sunsynk_load_frequency + inverter_current_164: sensor.sunsynk_inverter_current + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + battery_voltage_183: sensor.sunsynk_battery_voltage + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + grid_ct_power_172: sensor.sunsynk_grid_ct_power + grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status + inverter_status_59: sensor.sunsynk_overall_state + pv1_power_186: sensor.sunsynk_pv1_power + pv2_power_187: sensor.sunsynk_pv2_power + pv1_voltage_109: sensor.sunsynk_pv1_voltage + pv1_current_110: sensor.sunsynk_pv1_current + pv2_voltage_111: sensor.sunsynk_pv2_voltage + pv2_current_112: sensor.sunsynk_pv2_current + day_pv_energy_108: sensor.sunsynk_day_pv_energy + day_battery_charge_70: sensor.sunsynk_day_battery_charge + day_battery_discharge_71: sensor.sunsynk_day_battery_discharge + day_load_energy_84: sensor.sunsynk_day_load_energy + day_grid_import_76: sensor.sunsynk_day_grid_import + +******************************** +Full Configuration (All Options) +******************************** + +.. code-block:: yaml + :linenos: + + type: custom:sunsynk-power-flow-card + cardstyle: full + panel_mode: false + large_font: false + show_solar: true + inverter: + modern: true + colour: grey + autarky: 'power' + battery: + energy: 15960 + shutdown_soc: 20 + invert_power: false + colour: pink + show_daily: true + animation_speed: 6 + max_power: 4500 + full_capacity: 80 + empty_capacity: 30 + solar: + colour: orange + show_daily: true + mppts: 2 + animation_speed: 9 + max_power: 8000 + pv1_name: North + pv2_name: North + pv3_name: East + pv4_name: West + load: + colour: '#5fb6ad' + show_daily: true + show_aux: true + invert_aux: false + aux_name: Generator + aux_type: gen + aux_colour: green + aux_off_colour: red + aux_loads: 2 + aux_load1_name: Aux load 1 + aux_load2_name: Aux load 2 + aux_load1_icon: mdi:air-filter + aux_load2_icon: mdi:stove + animation_speed: 8 + max_power: 8000 + additional_loads: 2 + load1_name: Geyser + load2_name: Pool + load1_icon: boiler + load2_icon: mdi:pool + grid: + colour: '#5490c2' + show_daily_buy: true + show_daily_sell: true + no_grid_colour: '#a40013' + show_nonessential: true + invert_grid: false + nonessential_name: Non Essential + nonessential_icon: oven + additional_loads: 2 + load1_name: Load 1 + load2_name: Load 2 + load1_icon: boiler + load2_icon: mdi:ev-station + animation_speed: 8 + max_power: 8000 + entities: + use_timer_248: switch.sunsynk_toggle_system_timer + priority_load_243: switch.sunsynk_toggle_priority_load + day_battery_charge_70: sensor.sunsynk_day_battery_charge + day_battery_discharge_71: sensor.sunsynk_day_battery_discharge + day_load_energy_84: sensor.sunsynk_day_load_energy + day_grid_import_76: sensor.sunsynk_day_grid_import + day_grid_export_77: sensor.sunsynk_day_grid_export + day_pv_energy_108: sensor.sunsynk_day_pv_energy + inverter_voltage_154: sensor.sunsynk_inverter_voltage + load_frequency_192: sensor.sunsynk_load_frequency + inverter_current_164: sensor.sunsynk_inverter_current + inverter_power_175: sensor.sunsynk_inverter_power + grid_power_169: sensor.sunsynk_grid_power + pv1_power_186: sensor.sunsynk_pv1_power + pv2_power_187: sensor.sunsynk_pv2_power + pv3_power_188: none + pv4_power_189: none + pv_total: sensor.sunsynk_totalsolar + pv1_voltage_109: sensor.sunsynk_pv1_voltage + pv1_current_110: sensor.sunsynk_pv1_current + pv2_voltage_111: sensor.sunsynk_pv2_voltage + pv2_current_112: sensor.sunsynk_pv2_current + pv3_voltage_113: none + pv3_current_114: none + pv4_voltage_115: none + pv4_current_116: none + battery_voltage_183: sensor.sunsynk_battery_voltage + battery_soc_184: sensor.sunsynk_battery_soc + battery_power_190: sensor.sunsynk_battery_power + battery_current_191: sensor.sunsynk_battery_current + essential_power: none + essential_load1: sensor.tuya_geyser_current_consumption + essential_load2: sensor.load2_power + nonessential_power: none + non_essential_load1: sensor.nonessential1_power + non_essential_load2: sensor.nonessential2_power + grid_ct_power_172: sensor.sunsynk_grid_ct_power + grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status + inverter_status_59: sensor.sunsynk_overall_state + aux_power_166: sensor.sunsynk_aux_power + aux_connected_status: binary_sensor.sunsynk_aux_connected_status + remaining_solar: sensor.solcast_forecast_remaining_today + battery_temp_182: sensor.sunsynk_battery_temperature + radiator_temp_91: sensor.sunsynk_radiator_temperature + dc_transformer_temp_90: sensor.sunsynk_dc_transformer_temperature + prog1_time: sensor.sunsynk_time_slot_1 + prog1_capacity: number.sunsynk_system_mode_soc_time1 + prog1_charge: switch.sunsynk_system_mode_grid_charge_time1 + prog2_time: sensor.sunsynk_time_slot_2 + prog2_capacity: number.sunsynk_system_mode_soc_time2 + prog2_charge: switch.sunsynk_system_mode_grid_charge_time2 + prog3_time: sensor.sunsynk_time_slot_3 + prog3_capacity: number.sunsynk_system_mode_soc_time3 + prog3_charge: switch.sunsynk_system_mode_grid_charge_time3 + prog4_time: sensor.sunsynk_time_slot_4 + prog4_capacity: number.sunsynk_system_mode_soc_time4 + prog4_charge: switch.sunsynk_system_mode_grid_charge_time4 + prog5_time: sensor.sunsynk_time_slot_5 + prog5_capacity: number.sunsynk_system_mode_soc_time5 + prog5_charge: switch.sunsynk_system_mode_grid_charge_time5 + prog6_time: sensor.sunsynk_time_slot_6 + prog6_capacity: number.sunsynk_system_mode_soc_time6 + prog6_charge: switch.sunsynk_system_mode_grid_charge_time6 + energy_cost: sensor.tibber_energy_cost + solar_sell_247: switch.sunsynk_toggle_solar_sell diff --git a/docs/toc.rst b/docs/toc.rst index d69586e0..35ea661e 100644 --- a/docs/toc.rst +++ b/docs/toc.rst @@ -10,8 +10,13 @@ :titlesonly: configuration/main - configuration/examples/sunsynk - configuration/examples/lux + +.. toctree:: + :caption: Examples + :titlesonly: + + examples/sunsynk + examples/lux .. toctree:: :caption: Contribute diff --git a/package.json b/package.json index f6e199eb..098795a0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "lintfixall": "eslint src/*.ts --fix", "rollup": "rollup -c", "build": "rollup -c --bundleConfigAsCjs", - "watch": "rollup -c --watch --config rollup-dev.config.js" + "watch": "rollup -c --watch --config rollup-dev.config.js", + "docs-test": "sphinx-autobuild docs docs/_build/html" }, "repository": { "type": "git", From f44f54d619fc68607ff660d93ce6e41568a9aa67 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:49:55 +0000 Subject: [PATCH 15/40] chore: add devcontainer example files --- .devcontainer/post-install.sh | 14 ++++++++++++ .devcontainer/recommended-devcontainer.json | 24 +++++++++++++++++++++ .gitignore | 1 + 3 files changed, 39 insertions(+) create mode 100644 .devcontainer/post-install.sh create mode 100644 .devcontainer/recommended-devcontainer.json diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh new file mode 100644 index 00000000..e90aa89d --- /dev/null +++ b/.devcontainer/post-install.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -ex + +# Convenience workspace directory for later use +WORKSPACE_DIR=$(pwd) + +# Now install all dependencies +yarn install + +# Install documentation dependencies +pip3 install -r docs/requirements.txt +pip3 install sphinx-autobuild + +echo "Done!" diff --git a/.devcontainer/recommended-devcontainer.json b/.devcontainer/recommended-devcontainer.json new file mode 100644 index 00000000..742cc82a --- /dev/null +++ b/.devcontainer/recommended-devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "sunsynk-power-flow-card", + "dockerFile": "Dockerfile", + "context": "..", + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "github.vscode-pull-request-github", + "yzhang.markdown-all-in-one", + "bierner.lit-html", + "runem.lit-plugin", + "davidanson.vscode-markdownlint", + "redhat.vscode-yaml", + "eamodio.gitlens", + "ms-python.python", + "tht13.html-preview-vscode", + "sourcery.sourcery", + "tabnine.tabnine-vscode" + ] + } + }, + "postCreateCommand": "zsh ./.devcontainer/post-install.sh" +} diff --git a/.gitignore b/.gitignore index d4c8b0b7..e771658d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/* .devcontainer/* !.devcontainer/recommended-devcontainer.json !.devcontainer/recommended-Dockerfile +!.devcontainer/post-install.sh .vscode/* From c4059c407a1090136e24efe4c2eea341cfb658da Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:55:58 +0000 Subject: [PATCH 16/40] docs: add devcontainer documentation --- docs/contribute/devcontainer.rst | 37 ++++++++++++++++++++++++++++++++ docs/toc.rst | 1 + 2 files changed, 38 insertions(+) create mode 100644 docs/contribute/devcontainer.rst diff --git a/docs/contribute/devcontainer.rst b/docs/contribute/devcontainer.rst new file mode 100644 index 00000000..798bdb68 --- /dev/null +++ b/docs/contribute/devcontainer.rst @@ -0,0 +1,37 @@ +###################### +VS Code - DevContainer +###################### + +The easiest way to get your development environment setup is by using VS Code +with Dev Containers, this utilises Docker containers to setup a development +environment that guarantees a match with all other developers, removing any +potential headaches from incompatibilities. + +************ +Requirements +************ + +* VS Code +* Docker +* Remote - Containers (VS Code extension) + + +************* +Configuration +************* + +#. Copy the ``recommended`` files inside ``.devcontainer`` +#. Paste them in the same folder, remove the ``recommended-`` from the filename +#. In most cases no other changes will be required with these files + +.. note:: + Please ensure that the ``recommended-xxx`` files are not removed as this would remove + them from the repository when committed. + +When you open the repository with VS Code, a prompt to "Reopen in container" should +now appear. This will start the build of the development container with all components +and extensions pre-installed. + +.. note:: + If you don't see the notification, open the command pallet and select + ``Dev Containers: Open Folder in Container`` diff --git a/docs/toc.rst b/docs/toc.rst index 35ea661e..7820cad2 100644 --- a/docs/toc.rst +++ b/docs/toc.rst @@ -23,5 +23,6 @@ :titlesonly: contribute/bugs + contribute/devcontainer contribute/devcycle contribute/docs From 9d538dce80f562d32b912408cc288002e866fcd1 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 10:57:44 +0000 Subject: [PATCH 17/40] chore: rename file --- .devcontainer/recommended-Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .devcontainer/recommended-Dockerfile diff --git a/.devcontainer/recommended-Dockerfile b/.devcontainer/recommended-Dockerfile new file mode 100644 index 00000000..554f4406 --- /dev/null +++ b/.devcontainer/recommended-Dockerfile @@ -0,0 +1,9 @@ +FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye + +RUN apt update && apt upgrade -y + +RUN apt install -y zsh python3 python3-sphinx python3-pip + +RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | zsh || true + +CMD ["zsh"] From 2ffcb933e994bd8aed2239b440ab5b92e65475df Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 16 Aug 2023 14:21:08 +0000 Subject: [PATCH 18/40] refactor: add more translations, remove unnecissary or statements --- dist/sunsynk-power-flow-card.js | 4 +- src/index.ts | 148 ++++++++++++++++---------------- src/localize/languages/en.json | 3 +- src/types.ts | 6 +- 4 files changed, 81 insertions(+), 80 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 98dc7f0a..1d5b230b 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const m=window,u=m.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,C=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?C:'"'===r[3]?F:B):o===F||o===B?o=C:o===V||o===I?o=P:(o=C,i=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const c=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,f=w&&t&&!t.nodeType&&t,m=f&&f.exports===w,u=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,C=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ct,Bt=(Ct=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ct.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));fn[e]=new Date(wn.getTime()),fn[e].setHours(s),fn[e].setMinutes(n)}));const[mn,un,qn,Tn,kn,Mn]=fn;function bn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Us.charge="none":Us.charge="both",Us.capacity=parseInt(t.capacity.state),Us.entityID=e}wn>=Mn||wn=mn&&wn=un&&wn=qn&&wn=Tn&&wn=kn&&wn0?Ys="off"===ve.state||!1===Us.show||parseInt(ae.state)<=Us.capacity?_t.battery.shutdown_soc:Us.capacity:Ps<0&&("off"===ve.state||!1===Us.show||parseInt(ae.state)>=Us.capacity?Ys=100:parseInt(ae.state)0?Qs=(parseInt(ae.state)-Ys)/100*_t.battery.energy/Ps*60*60:Ps<0&&(Qs=(Ys-parseInt(ae.state))/100*_t.battery.energy/Ps*60*60*-1);const An=new Date,Hn=1e3*Qs,Zn=new Date(An.getTime()+Hn),Ln=Zn.getHours(),En=Zn.getMinutes().toString().padStart(2,"0"),Pn=Ln.toString().padStart(2,"0");Ws="".concat(Pn,":").concat(En);const Vn=Math.floor(Qs/86400),In=Math.floor(Qs%86400/3600),Cn=Math.floor(Qs%3600/60);Vn>0&&(Gs+="".concat(Vn," days, ")),(In>0||Vn>0)&&(Gs+="".concat(In," hrs, ")),Gs+="".concat(Cn," min")}let Xs=!!(-2<=parseInt(He.state)&&parseInt(He.state)<=2&&parseInt(ae.state)>=99),Ks="",Js="",tn="",en=!1;tn="sunsynk"!==_t.inverter.model&&"lux"!==_t.inverter.model?"sunsynk":_t.inverter.model;let sn=ut[tn];for(const Bn of Object.keys(sn)){const Fn=sn[Bn],{states:Sn,color:Rn,message:jn}=Fn;if(Sn.includes(_e.state)){Ks=Rn,Js=jn,en=!0;break}}en||("none"!==(null===(R=_t.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=_t.entities)||void 0===D?void 0:D.inverter_status_59)?(Ks="transparent",Js="Status"):(Ks="transparent",Js=""));let nn=(isNaN(parseFloat(qt.state))?0:parseFloat(qt.state))+(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state)),an=(isNaN(parseFloat(xt.state))?0:parseFloat(xt.state))+(isNaN(parseFloat(gt.state))?0:parseFloat(gt.state)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=Bs+parseInt("".concat(Ps>0?Ps:0))+parseInt("".concat(Oe<0?-1*Oe:0)),hn=Ss+Rs+parseInt("".concat(Oe>0?Oe:0))+parseInt("".concat(Ps<0?-1*Ps:0)),dn=0!=hn?Math.min(Math.round(100*rn/hn),100):0,cn=0!=rn?Math.min(Math.round(100*hn/rn),100):0,pn=null===($=_t.solar)||void 0===$?void 0:$.animation_speed;if(_t&&_t.solar&&_t.solar.animation_speed){let Nn=_t.solar.animation_speed-(_t.solar.animation_speed-1)*(Bs/(_t.solar.max_power||Bs));pn=Nn>=1?Nn:1}let vn=null===(O=_t.battery)||void 0===O?void 0:O.animation_speed;if(_t&&_t.battery&&_t.battery.animation_speed){let Dn=_t.battery.animation_speed-(_t.battery.animation_speed-1)*((Ps<0?-1*Ps:Ps)/(_t.battery.max_power||(Ps<0?-1*Ps:Ps)));vn=Dn>=1?Dn:1}let _n=null===(z=_t.load)||void 0===z?void 0:z.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let $n=_t.load.animation_speed-(_t.load.animation_speed-1)*(Ss/(_t.load.max_power||Ss));_n=$n>=1?$n:1}let yn=null===(U=_t.load)||void 0===U?void 0:U.animation_speed;if(_t&&_t.load&&_t.load.animation_speed){let On=_t.load.animation_speed-(_t.load.animation_speed-1)*((parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))/(_t.load.max_power||(parseInt(xe.state)<0?-1*parseInt(xe.state):parseInt(xe.state))));yn=On>=1?On:1}let gn=null===(Y=_t.grid)||void 0===Y?void 0:Y.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let zn=_t.grid.animation_speed-(_t.grid.animation_speed-1)*((parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))/(_t.grid.max_power||(parseInt(re.state)<0?-1*parseInt(re.state):parseInt(re.state))));gn=zn>=1?zn:1}let xn=null===(Q=_t.grid)||void 0===Q?void 0:Q.animation_speed;if(_t&&_t.grid&&_t.grid.animation_speed){let Un=_t.grid.animation_speed-(_t.grid.animation_speed-1)*(Rs/(_t.grid.max_power||Rs));xn=Un>=1?Un:1}return"full"===_t.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n Essential\n Essential\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n DAILY CHARGE\n DAILY DISCHARGE\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n Timer On\n Timer Off\n \n \n \n \n \n \n \n \n Priority Load\n Priority Batt\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Qe,Qe,We,Ge,Ke,Ke,!1===As?"".concat(Vs):"100%",ps,!1===_t.show_solar?"st12":"",ds,Ke,Ke,We,!1===_s?"st12":"",Qe,Hs,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Ke,!1===ts?"st12":"",1===ls?"":"none",Ke,!1===ts?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",2===ls?"":"none",Ke,!1===ts||1===ls?"st12":"",!1===_s?"30":"143",Qe,1===ys?"":"none",!1===_s?"376":"373",!1===_s?"30":"143",Qe,2===ys?"":"none",!1===_s?"413":"410",!1===_s?"30":"143",Qe,2===ys?"":"none",We,!1===_s?"none":"",1===gs||2===gs?"":"st12",We,!1===_s?"none":"",2===gs?"":"st12",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===_t.show_solar?"none":"",ps,_t.solar.pv1_name,!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,_t.solar.pv2_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,_t.solar.pv3_name,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,_t.solar.pv4_name,Ke,Hs,Js,1!==ys&&2!==ys||!0!==_s?"":"none",Qe,0===ys||!1===_s?"none":"",Qe,!1===_s?70:181,1===ys?"":"none",Qe,_t.load.load1_name,!1===_s?47:158,1===ys?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?393:390,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load1_name,!1===_s?394:391,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),!1===_s?429:426,!1===_s?59:172,2===ys?"":"none",Qe,_t.load.load2_name,!1===_s?430:427,!1===_s?42:154,2===ys?"":"none",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),2===gs?"238":"306",!1===Xe||!1===_s?"transparent":"".concat(Qe),wt("common.daily_load"),0===ys?"377":"306",0===ys?71:93,!1===Xe||!0===_s?"transparent":"".concat(Qe),wt("common.daily_load"),!1===vs||!1===_t.show_solar||"false"!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||"false"===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===cs?"transparent":"".concat(ds),!1===cs?"transparent":"".concat(ds),!1===ts?"311":"347",!1===ts?"368":"253",!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===ts?"311":"347",!1===ts?"337":"222",!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),_t.load.aux_name,!1===ts?"none":"",Ke,_t.grid.nonessential_name,!1===ts||0===ls||2===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load1_name,!1===ts||0===ls||1===ls?"none":"",Ke,_t.grid.load2_name,!1===ts||0===ls||2===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state).toFixed(0),!1===ts||0===ls||1===ls?"none":"",Ke,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,1===gs?53:14,!1===_s||0===gs?"none":"",We,_t.load.aux_load1_name,!1===_s||0===gs||1===gs?"none":"",We,_t.load.aux_load2_name,!1===bs?"st14":"st4",!1===_s||0===gs?"none":"",We,isNaN(parseFloat(Ne.state))?0:parseFloat(Ne.state).toFixed(0),!1===bs?"st14":"st4",!1===_s||0===gs||1===gs?"none":"",We,isNaN(parseFloat(De.state))?0:parseFloat(De.state).toFixed(0),Ks,!0===_s?"":"none",1===ys||2===ys?"":"st12",Qe,!1===_s?"":"none",1===ys?"":"st12",Qe,!1===_s?"":"none",2===ys?"":"st12",Qe,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn/2,Ue>0||0===Ue?"transparent":"".concat(Ke),gn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn/2,Ke,!1===ts?"st12":"",!1===ts?"st12":"",Rs<=0?"transparent":"".concat(Ke),xn,!1===_s?"st12":"",We,!1===_s||0===Oe?"st12":"",Oe<0?"transparent":"".concat(We),yn,!1===_s||0===Oe?"st12":"",Oe>0?"transparent":"".concat(We),yn,!1===_s?"st12":"",We,Ke,Hs,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,Hs,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?"1":"0",ds,parseInt(ae.state)<=Cs?1:0,ds,!1===_t.show_solar?"st12":"",ps,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,"default"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"oven"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"boiler"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"pump"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,"aircon"===ms?"1":"0",!1===ts||2===ls||1===ls?"none":"",Ke,!1===ts||2===ls||1===ls?"none":"",ms,"default"===us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"===us&&"default"!=qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"default"!=us&&"default"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"boiler"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"pump"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"oven"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,"aircon"===qs?"1":"0",!1===ts||0===ls||1===ls?"none":"",Ke,!1===ts||0===ls||1===ls?"none":"",us,!1===ts||0===ls||1===ls?"none":"",qs,"default"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"boiler"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"pump"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"oven"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,"aircon"===us?"1":"0",!1===ts||0===ls||2===ls?"none":"",Ke,!1===ts||0===ls||2===ls?"none":"",us,1!==ys&&2!==ys||!1!==_s?"none":"",Qe,1!==ys&&2!==ys||!0!==_s?"none":"",Qe,1===ys||2===ys?"none":"",Qe,(t=>this.handlePopup(t,_t.entities.aux_connected_status)),"default"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"gen"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"inverter"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"oven"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"boiler"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"aircon"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),"pump"===xs?"":"st12",!1===_s||1===gs||2===gs?"none":"","".concat("on"===ss||"1"===ss?We:Ge),!1===_s||1===gs||2===gs?"none":"",xs,"on"===ss||"1"===ss?"aux-icon":"aux-off-icon",!1===_s||0===gs?"none":"",ws,!1===_s||1===gs||0===gs?"none":"",fs,"boiler"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"boiler"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"boiler"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"aircon"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"aircon"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"pump"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"pump"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"pump"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,"pump"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",!1===_s||0===ys||1===ys?"none":"",Qe,"oven"===Ts&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===ks&&2===ys&&!1===_s?"1":"0",0===ys||1===ys?"none":"",Qe,"oven"===Ts&&1===ys&&!1===_s?"1":"0",0===ys||2===ys?"none":"",Qe,"oven"===Ts&&1===ys?"1":"0",!1===_s||0===ys||2===ys?"none":"",Qe,0===ys||1===ys?"none":"",!0===_s?"350":"383",!0===_s?"140":"5",Ts,0===ys||1===ys?"none":"",!0===_s?"446":"420",!0===_s?"140":"5",ks,0===ys||2===ys?"none":"","336",!0===_s?"140":"27",Ts,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"no"!=Zs?"232":"249","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"232":"249","off"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","on"==fe.state&&"no"!==Ls?"":"none",Hs,"no"!=Zs?"243":"260","off"==fe.state&&"no"!==Ls?"":"none",Hs,(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"none"!==_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,(t=>this.handlePopup(t,_t.entities.priority_load_243)),"no"!=Zs?"251":"268","off"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"251":"268","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","on"===we.state&&"no"!==Es?"":"none",Hs,"no"!=Zs?"262":"280","off"===we.state&&"no"!==Es?"":"none",Hs,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,"no"!=Zs?"232":"249",!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||"false"!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===gs?"238":"306",!1===Xe||!1===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),0===ys?"377":"306",0===ys?"57":"80",!1===Xe||!0===_s?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===ts?"311":"347",!1===ts?"354":"239",!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===ts?"311":"347",!1===ts?"323":"209",!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(null===(W=_t.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(At||(At=e([' '," W "])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(Zt||(Zt=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0),"none"!==_t.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.nonessential_power)),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0):N(Et||(Et=e([''," W "])),!1===ts?"none":"",!1===bs?"st14":"st4",Ke,Rs||0),(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,"none"!==_t.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.aux_power_166)),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe):N(Vt||(Vt=e([''," W "])),!1===bs?"st14":"st4",!1===_s?"none":"",We,Oe<0?-1*Oe:Oe),"none"!==_t.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ct||(Ct=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Ft||(Ft=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Rt||(Rt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Nt||(Nt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",!1===bs?"st14":"st4",Ke,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",!1===bs?"st14":"st4",Ke,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",!1===bs?"st14":"st4",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.inverter_power_175)),"none"===_t.entities.inverter_power_175?"none":"",!1===bs?"st14":"st4",Hs,ye.state||0,(t=>this.handlePopup(t,_t.entities.grid_power_169)),"none"===_t.entities.grid_power_169?"none":"",!1===bs?"st14":"st4",Ke,ge.state||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(G=_t.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),4===(null===(X=_t.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=_t.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(J=_t.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(tt=_t.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(et=_t.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Be.state||""):"lite"===_t.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Qe,!1===_t.show_solar?145.33:-.5,!1===_t.show_solar?270.67:406,"".concat(!1===As?!1===_t.show_solar?"246px":"".concat(Vs):!1===_t.show_solar?"75%":"100%"),Qe,ps,!1===_t.show_solar?"st12":"",ds,Ke,ps,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",Qe,1===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",Qe,2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",0===_t.battery.energy||!0===Xs||0===Ps?"transparent":"".concat(ds),Gs,0===_t.battery.energy||Ps<=0||!0===Xs?"transparent":"".concat(ds),wt("common.runtime_to"),Ys,Ws,0===_t.battery.energy||Ps>=0||!0===Xs?"transparent":"".concat(ds),wt("common.to"),Ys,wt("common.charge"),Ws,0===_t.battery.energy||!1===Xs?"transparent":"".concat(ds),wt("common.battery_floating"),!1===cs?"transparent":"".concat(ds),wt("common.daily_charge"),!1===cs?"transparent":"".concat(ds),wt("common.daily_discharge"),2===ys?"365":"415",2===ys?"182.2":"282.1",!1===Xe?"transparent":"".concat(Qe),wt("common.daily_load"),!1===rs?"transparent":"".concat(Ke),wt("common.daily_grid_buy"),!1===hs?"transparent":"".concat(Ke),wt("common.daily_grid_sell"),!1===vs||!1===_t.show_solar||0!=Ms?"transparent":"".concat(ps),wt("common.daily_solar"),!1===vs||!1===_t.show_solar||!1===Ms?"transparent":"".concat(ps),wt("common.daily_solar_left"),!1===_t.show_solar?"none":"",ps,(null===(st=_t.solar)||void 0===st?void 0:st.pv1_name)?"".concat(_t.solar.pv1_name):"PV1",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,(null===(nt=_t.solar)||void 0===nt?void 0:nt.pv2_name)?"".concat(_t.solar.pv2_name):"PV2",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,(null===(it=_t.solar)||void 0===it?void 0:it.pv3_name)?"".concat(_t.solar.pv3_name):"PV3",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,(null===(at=_t.solar)||void 0===at?void 0:at.pv4_name)?"".concat(_t.solar.pv4_name):"PV4","no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,on,"no"===Zs?"none":"","energy"===Zs?"st4 st8 left-align":"st12",Hs,ln,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,dn,"no"===Zs?"none":"","power"===Zs?"st4 st8 left-align":"st12",Hs,cn,"no"===Zs?"none":"",Hs,"no"===Zs?"none":"",Hs,wt("common.ratio"),1===ys&&!0===_t.show_solar?"":"none",Qe,(null===(ot=_t.load)||void 0===ot?void 0:ot.load1_name)?"".concat(_t.load.load1_name):"",1===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(lt=_t.load)||void 0===lt?void 0:lt.load1_name)?"".concat(_t.load.load1_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Ce.state))?0:parseFloat(Ce.state).toFixed(0),2===ys&&!0===_t.show_solar?"":"none",Qe,(null===(rt=_t.load)||void 0===rt?void 0:rt.load2_name)?"".concat(_t.load.load2_name):"",2===ys&&!0===_t.show_solar?"":"none",!1===bs?"st14":"st4",Qe,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Ks,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",parseInt(ne.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts?"st12":"",parseInt(se.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"st12":"",parseInt(ke.state)<=0?"transparent":"".concat(ps),pn,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",ps,!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"st12":"",parseInt(Me.state)<=0?"transparent":"".concat(ps),pn,ds,Ps<0||0===Ps?"transparent":"".concat(ds),vn,Ps>0||0===Ps?"transparent":"".concat(ds),vn,!1===_t.show_solar?"st12":"",ps,!1===_t.show_solar?"st12":"",0===Bs?"transparent":"".concat(ps),pn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Ke,Ue<0||0===Ue?"transparent":"".concat(Ke),gn,Ue>0||0===Ue?"transparent":"".concat(Ke),gn,Qe,0===Ss?"transparent":"".concat(Qe),_n,Qe,0===Ss?"transparent":"".concat(Qe),_n,1===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,2===ys&&!0===_t.show_solar?"":"st12",Qe,"oven"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"oven"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"pump"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"aircon"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"!==Ts||1!==ys&&2!==ys?"0":"1",0===ys||!1===_t.show_solar?"none":"",Qe,"boiler"===ks&&2===ys?"1":"0",0===ys||!1===_t.show_solar?"none":"",Qe,0===ys||!1===_t.show_solar?"none":"",Ts,0===ys||1===ys||!1===_t.show_solar?"none":"",ks,!1===_t.show_solar?"st12":"",ps,parseInt(ae.state)>=Is?1:0,ds,parseInt(ae.state)>=50&&parseInt(ae.state)Cs&&parseInt(ae.state)<=49?1:0,ds,parseInt(ae.state)<=Cs?1:0,ds,(t=>this.handlePopup(t,_t.entities.grid_connected_status_194)),"off"===es||"0"===es?"st12":"",Ke,"on"===es||"1"===es?"st12":"",Je,Qe,Hs,(t=>this.handlePopup(t,_t.entities.use_timer_248)),"on"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,"off"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_off"),"on"==fe.state&&!1!==Ls?"":"none",Hs,wt("common.timer_on"),(t=>this.handlePopup(t,_t.entities.priority_load_243)),"off"===we.state&&!1!==Es?"":"none",Hs,"on"===we.state&&!1!==Es?"":"none",Hs,"off"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_batt"),"on"===we.state&&!1!==Es?"":"none",Hs,wt("common.priority_load"),(t=>this.handlePopup(t,_t.entities.solar_sell_247)),_t.entities.solar_sell_247&&"off"!==Fe.state&&"0"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,_t.entities.solar_sell_247&&"on"!==Fe.state&&"1"!==Fe.state&&!1!==_t.show_solar?"":"none",ps,!1===Ye?"":"st12",(t=>this.handlePopup(t,Us.entityID)),!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"st12":"",Hs,!1===Us.show||"none"===_t.entities.use_timer_248?"none":"","none"===Us.charge?"":"st12",Hs,(t=>this.handlePopup(t,_t.entities.day_battery_charge_70)),!1===cs?"none":"",ds,parseFloat(gt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||0!=Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_pv_energy_108)),!1===vs||!1===_t.show_solar||!1===Ms?"none":"",ps,parseFloat(qt.state).toFixed(1)||0,Ms,(t=>this.handlePopup(t,_t.entities.day_battery_discharge_71)),!1===cs?"none":"",ds,parseFloat(yt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_load_energy_84)),2===ys?"365":"400.4",2===ys?"168":"267.9",!1===Xe?"none":"",Qe,parseFloat(xt.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_import_76)),!1===rs?"none":"",Ke,parseFloat(ft.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.day_grid_export_77)),!1===hs?"none":"",Ke,parseFloat(be.state).toFixed(1)||0,(t=>this.handlePopup(t,_t.entities.inverter_voltage_154)),"none"!==_t.entities.inverter_voltage_154&&_t.entities.inverter_voltage_154?"":"none",Hs,is,(t=>this.handlePopup(t,_t.entities.load_frequency_192)),"none"!==_t.entities.load_frequency_192&&_t.entities.load_frequency_192?"":"none",Hs,ns,(t=>this.handlePopup(t,_t.entities.inverter_current_164)),"none"!==_t.entities.inverter_current_164&&_t.entities.inverter_current_164?"":"none",Hs,as,(t=>this.handlePopup(t,_t.entities.battery_voltage_183)),"none"!==_t.entities.battery_voltage_183&&_t.entities.battery_voltage_183?"":"none",ds,!1===bs?"st14":"st4",os,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),"none"===_t.entities.battery_soc_184?"none":"",ds,parseInt(ae.state)||0,(t=>this.handlePopup(t,_t.entities.battery_soc_184)),ds,!1===Us.show||"none"===_t.entities.battery_soc_184?"none":"",Us.capacity||0,(t=>this.handlePopup(t,_t.entities.battery_power_190)),"none"===_t.entities.battery_power_190?"none":"",ds,!1===bs?"st14":"st4",Ps<0?-1*Ps:Ps,(t=>this.handlePopup(t,_t.entities.battery_current_191)),"none"===_t.entities.battery_current_191?"none":"",ds,!1===bs?"st14":"st4",He.state||0,(t=>this.handlePopup(t,_t.entities.grid_ct_power_172)),"none"===_t.entities.grid_ct_power_172?"none":"",!1===bs?"st14":"st4",Ke,Ue||0,(t=>this.handlePopup(t,_t.entities.pv1_voltage_109)),!1!==_t.show_solar&&_t.entities.pv1_voltage_109&&"none"!==_t.entities.pv1_voltage_109?"":"none",ps,he.state||0,(t=>this.handlePopup(t,_t.entities.pv1_current_110)),!1!==_t.show_solar&&_t.entities.pv1_current_110&&"none"!==_t.entities.pv1_current_110?"":"none",ps,de.state||0,(t=>this.handlePopup(t,_t.entities.pv2_voltage_111)),!1!==_t.show_solar&&_t.entities.pv2_voltage_111&&"none"!==_t.entities.pv2_voltage_111&&1!==_t.solar.mppts?"":"none",ps,ce.state||0,(t=>this.handlePopup(t,_t.entities.pv2_current_112)),!1!==_t.show_solar&&_t.entities.pv2_current_112&&"none"!==_t.entities.pv2_current_112&&1!==_t.solar.mppts?"":"none",ps,pe.state||0,(t=>this.handlePopup(t,_t.entities.pv3_voltage_113)),!1!==_t.show_solar&&_t.entities.pv3_voltage_113&&"none"!==_t.entities.pv3_voltage_113&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,me.state||0,(t=>this.handlePopup(t,_t.entities.pv3_current_114)),!1!==_t.show_solar&&_t.entities.pv3_current_114&&"none"!==_t.entities.pv3_current_114&&1!==_t.solar.mppts&&2!==_t.solar.mppts?"":"none",ps,ue.state||0,(t=>this.handlePopup(t,_t.entities.pv4_voltage_115)),!1!==_t.show_solar&&_t.entities.pv4_voltage_115&&"none"!==_t.entities.pv4_voltage_115&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,qe.state||0,(t=>this.handlePopup(t,_t.entities.pv4_current_116)),!1!==_t.show_solar&&_t.entities.pv4_current_116&&"none"!==_t.entities.pv4_current_116&&1!==_t.solar.mppts&&2!==_t.solar.mppts&&3!==_t.solar.mppts?"":"none",ps,Te.state||0,(t=>this.handlePopup(t,_t.entities.battery_temp_182)),"none"===_t.entities.battery_temp_182?"st12":"st3 left-align",ds,(null===(ht=_t.entities)||void 0===ht?void 0:ht.battery_temp_182)?"":"none",Le.state||"",(t=>this.handlePopup(t,_t.entities.radiator_temp_91)),"none"===_t.entities.radiator_temp_91?"st12":"st3 left-align",Hs,(null===(dt=_t.entities)||void 0===dt?void 0:dt.radiator_temp_91)?"":"none",Pe.state||"",(t=>this.handlePopup(t,_t.entities.dc_transformer_temp_90)),"none"===_t.entities.dc_transformer_temp_90?"st12":"st3 left-align",Hs,(null===(ct=_t.entities)||void 0===ct?void 0:ct.dc_transformer_temp_90)?"":"none",Ee.state||"",(t=>this.handlePopup(t,_t.entities.energy_cost)),"none"===_t.entities.energy_cost?"st12":"st3 left-align",Ke,(null===(pt=_t.entities)||void 0===pt?void 0:pt.energy_cost)?"":"none",Be.state||"",(null===(vt=_t.entities)||void 0===vt?void 0:vt.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv_total)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0):N(Ot||(Ot=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,Fs||0),"none"!==_t.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv1_power_186)),!1===bs?"st14":"st4",!1===_t.show_solar?"none":"",ps,parseFloat(ne.state).toFixed(0)||0):N(Ut||(Ut=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv1_power_186?"none":"",ps,parseFloat(ne.state).toFixed(0)||0),"none"!==_t.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv2_power_187)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0):N(Qt||(Qt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv2_power_187||1===_t.solar.mppts?"none":"",ps,parseFloat(se.state).toFixed(0)||0),"none"!==_t.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv3_power_188)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0):N(Gt||(Gt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv3_power_188||1===_t.solar.mppts||2===_t.solar.mppts?"none":"",ps,parseFloat(ke.state).toFixed(0)||0),"none"!==_t.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.pv4_power_189)),!1===bs?"st14":"st4",!1===_t.show_solar||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0):N(Kt||(Kt=e([''," W"])),!1===bs?"st14":"st4",!1===_t.show_solar||"none"===_t.entities.pv4_power_189||1===_t.solar.mppts||2===_t.solar.mppts||3===_t.solar.mppts?"none":"",ps,parseFloat(Me.state).toFixed(0)||0),"none"!==_t.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,_t.entities.essential_power)),!1===bs?"st14":"st4",Qe,Ss||0):N(te||(te=e([''," W"])),!1===bs?"st14":"st4",Qe,Ss||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var mt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,m=w&&t&&!t.nodeType&&t,f=m&&m.exports===w,u=f&&y.process,q=function(){try{var t=m&&m.require&&m.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&mt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,wn,mn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=wn&&_n=mn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,Mn=new Date(Tn.getTime()+kn),bn=Mn.getHours(),An=Mn.getMinutes().toString().padStart(2,"0"),Hn=bn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),wt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),wt("common.to"),$s,wt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),wt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,wt("common.essential"),0===cs||!1===ds?"none":"",Oe,wt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),wt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),wt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),wt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),wt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),wt("common.daily_charge"),!1===ls?"transparent":"".concat(os),wt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),wt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),wt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,en,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,sn,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,on,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,ln,"no"===Ms?"none":"",ks,"no"===Ms?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ws,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ms,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ms,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=Ms?"232":"249","on"==ye.state&&"no"!==bs?"":"none",ks,"no"!=Ms?"232":"249","off"==ye.state&&"no"!==bs?"":"none",ks,"no"!=Ms?"243":"260","on"==ye.state&&"no"!==bs?"":"none",ks,wt("common.timer_on"),"no"!=Ms?"243":"260","off"==ye.state&&"no"!==bs?"":"none",ks,wt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=Ms?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=Ms?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=Ms?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,wt("common.priority_load"),"no"!=Ms?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,wt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=Ms?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=Ms?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",be.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Pe.state):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),wt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),wt("common.to"),$s,wt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),wt("common.battery_floating"),!1===ls?"transparent":"".concat(os),wt("common.daily_charge"),!1===ls?"transparent":"".concat(os),wt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),wt("common.daily_load"),!1===is?"transparent":"".concat(Qe),wt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),wt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),wt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),wt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,en,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,sn,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,on,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,ln,"no"===Ms?"none":"",ks,"no"===Ms?"none":"",ks,wt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ms,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==bs?"":"none",ks,"off"==ye.state&&!1!==bs?"":"none",ks,"off"==ye.state&&!1!==bs?"":"none",ks,wt("common.timer_off"),"on"==ye.state&&!1!==bs?"":"none",ks,wt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,wt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,wt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",be.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",Pe.state,(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},mt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 9ffc3aaa..33d58077 100644 --- a/src/index.ts +++ b/src/index.ts @@ -370,7 +370,7 @@ export class SunsynkPowerFlowCard extends LitElement { } let typeStatusGroups = inverterStatusGroups[inverterModel]; - + for (const groupKey of Object.keys(typeStatusGroups)) { const info = typeStatusGroups[groupKey]; const { states, color, message } = info; @@ -512,8 +512,8 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.solar.pv4_name} Grid ${inverterStateMsg} - Essential - Essential + ${localize('common.essential')} + ${localize('common.essential')} ${config.load.load1_name} ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ${config.load.load1_name} @@ -524,8 +524,8 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.daily_load')} ${localize('common.daily_solar')} ${localize('common.daily_solar_left')} - DAILY CHARGE - DAILY DISCHARGE + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} ${config.load.aux_name} @@ -837,8 +837,8 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.use_timer_248)}> - Timer On - Timer Off + ${localize('common.timer_on')} + ${localize('common.timer_off')} this.handlePopup(e, config.entities.solar_sell_247)}> @@ -847,8 +847,8 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.priority_load_243)}> - Priority Load - Priority Batt + ${localize('common.priority_load')} + ${localize('common.priority_batt')} @@ -857,28 +857,28 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1) } kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj1.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj3.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj33.state).toFixed(1)} kWh ${config.entities?.pv_total @@ -907,24 +907,24 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ${parseFloat(stateObj9.state).toFixed(0) } W ` - : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0) } W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) } W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0) } W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) } W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -938,7 +938,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) || 0} % + ${parseInt(stateObj12.state) } % this.handlePopup(e, config.entities.battery_soc_184)}> | ${inverter_prog.capacity || 0} % @@ -947,49 +947,49 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state || 0} A + ${stateObj35.state } A this.handlePopup(e, config.entities.inverter_power_175)}> - ${stateObj22.state || 0} W + ${stateObj22.state} W this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state || 0} W + ${stateObj23.state } W this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state || 0} V + ${stateObj16.state} V this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state || 0} A + ${stateObj17.state} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state } V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state } A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state } V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state || ''}° + ${stateObj37.state}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state || ''}° + DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state || ''} + ${stateObj43.state}
@@ -1031,10 +1031,10 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.daily_grid_sell')} ${localize('common.daily_solar')} ${localize('common.daily_solar_left')} - ${config.solar?.pv1_name ? `${config.solar.pv1_name}` : 'PV1'} - ${config.solar?.pv2_name ? `${config.solar.pv2_name}` : 'PV2'} - ${config.solar?.pv3_name ? `${config.solar.pv3_name}` : 'PV3'} - ${config.solar?.pv4_name ? `${config.solar.pv4_name}` : 'PV4'} + ${config.solar.pv1_name} + ${config.solar.pv2_name} + ${config.solar.pv3_name} + ${config.solar.pv4_name} ${Autarky}% ${Ratio}% ${Autarkyp}% @@ -1191,25 +1191,25 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj1.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1) || 0} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj3.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1) || 0} kWh + ${parseFloat(stateObj33.state).toFixed(1)} kWh this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -1224,7 +1224,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) || 0} % + ${parseInt(stateObj12.state)} % this.handlePopup(e, config.entities.battery_soc_184)}> | ${inverter_prog.capacity || 0} % @@ -1233,46 +1233,46 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state || 0} A + ${stateObj35.state} A this.handlePopup(e, config.entities.grid_ct_power_172)}> ${grid_power || 0} W this.handlePopup(e, config.entities.pv1_voltage_109)}> - ${stateObj16.state || 0} V + ${stateObj16.state} V this.handlePopup(e, config.entities.pv1_current_110)}> - ${stateObj17.state || 0} A + ${stateObj17.state} A this.handlePopup(e, config.entities.pv2_voltage_111)}> - ${stateObj18.state || 0} V + ${stateObj18.state} V this.handlePopup(e, config.entities.pv2_current_112)}> - ${stateObj19.state || 0} A + ${stateObj19.state} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state || 0} V + ${stateObj27.state} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state || 0} A + ${stateObj28.state} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state || 0} V + ${stateObj29.state} V this.handlePopup(e, config.entities.pv4_current_116)}> - ${stateObj30.state || 0} A + ${stateObj30.state} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state || ''}° + ${stateObj37.state}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state || ''}° + AC: ${stateObj39.state}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state || ''}° + DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state || ''} + ${stateObj43.state} ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> @@ -1281,24 +1281,24 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${total_pv || 0} W`} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) || 0} W + ${parseFloat(stateObj9.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) || 0} W + ${parseFloat(stateObj8.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) || 0} W + ${parseFloat(stateObj31.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0) || 0} W + ${parseFloat(stateObj32.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0) || 0} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential || 0} W diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 8341a5a8..0f0615ff 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -25,7 +25,8 @@ "pv1_name": "PV1", "pv2_name": "PV2", "pv3_name": "PV3", - "pv4_name": "PV3" + "pv4_name": "PV3", + "essential": "Essential" }, "errors": { "cardstyle": "Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple", diff --git a/src/types.ts b/src/types.ts index 589c3e03..bc16007e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,7 +8,7 @@ declare global { export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { type: string; - cardstyle: string; + cardstyle: 'lite' | 'full'; panel_mode: boolean; large_font: boolean; show_solar: boolean; @@ -16,8 +16,8 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { inverter: { modern: boolean; colour: string; - autarky: string; - model: string; + autarky: 'energy' | 'power' | 'no'; + model: 'sunsynk' | 'lux'; } battery: { energy: number; From 43ef141d24f93caf68b6efa52c95be7a4abd50a7 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Wed, 16 Aug 2023 23:51:30 +0200 Subject: [PATCH 19/40] Chore: Update readme --- README.md | 136 +++++++++++++++++++++++++++--------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 1d919b7f..ae873acc 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ The card can be configured through the following attributes: |card_height:| Optional | `396px` | Sets the card height in pixels `400px` | |inverter: | Optional | See optional [Inverter](#inverter) attributes below |List of inverter attributes. | |battery: | **Required** |See required [Battery](#battery) attributes below | List of battery attributes. | -|solar: | Optional |See optonal [Solar](#solar) attributes below | List of solar attributes. | +|solar: | Optional |See optional [Solar](#solar) attributes below | List of solar attributes. | |load: | Optional | See optional [Load](#load) attributes below|List of load attributes. | |grid: | Optional | See optional [Grid](#grid) attributes below| List of grid attributes. | |entities:|**Required** |See required [Entities](#entities) attributes below | List of sensor entities. | @@ -84,23 +84,23 @@ The card can be configured through the following attributes: |modern:| Optional |`true`| Changes the inverter image.| |colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| -| model: | Optional | `sunsynk` | set to `lux` for Lux inverters, states overlap so require this setting.
NOTE: this still needs work as I don't have all Lux states | +| model: | Optional | `sunsynk` | Set to `lux` for Lux inverters, states overlap so require this setting.
NOTE: this still needs work as I don't have all Lux states | ### Battery -Note that the card will always display batter power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. +Note that the card will always display battery power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | -|energy: | **Required** | `0` | Total Battery Energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| +|energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| |shutdown_soc: | **Required** | `20` |The battery shutdown percentage used to calculate remaining runtime | |invert_power:| Optional | `false`|Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge| |colour:| Optional| `pink`| Changes the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional| `false` | Toggles the Daily Total | -|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on Power draw | -|max_power: | Optional | `4500` | Maximun Power draw to calculate animation speed | -|full_capacity: | Optional| `80` | If SOC >= to this value the Fully Charged battery image will be shown. Accepts any value between 80-100| -|empty_capacity: | Optional | `30` | If SOC <= to this value the Empty battery image will be shown. Accepts any value between 1-30 +|show_daily: | Optional| `false` | Toggles the daily total | +|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | +|max_power: | Optional | `4500` | Maximum power draw to calculate animation speed | +|full_capacity: | Optional| `80` | If SOC >= to this value the fully charged battery image will be shown. Accepts any value between 80-100| +|empty_capacity: | Optional | `30` | If SOC <= to this value the empty battery image will be shown. Accepts any value between 1-30 ### Solar @@ -108,10 +108,10 @@ These attributes are only needed if `show_solar` is set to `true` | Attribute | Requirement |Default | Description | | --- | --- | --- |--- | |colour:| Optional | `orange` | Changes the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional | `false` | Toggles the Daily Total | +|show_daily: | Optional | `false` | Toggles the daily total | |mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3` or `4` | |animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | -|max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | |pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | |pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | |pv3_name: | Optional | `PV3` | Set the disaply name for MPPT3 | @@ -122,23 +122,23 @@ These attributes are only needed if `show_solar` is set to `true` | Attribute | Requirement | Default | Description | | --- | --- | --- |--- | |colour:| Optional |`'#5fb6ad'`| Changes the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional |`false` | Toggles the Daily Total. Only displayed if `show_aux` is set to `true` | -|show_aux: | Optional | `false` | Toggles the display of Aux | +|show_daily: | Optional |`false` | Toggles the daily total. Only displayed if `show_aux` is set to `true` | +|show_aux: | Optional | `false` | Toggles the display of AUX | |invert_aux: | Optional | `false` | Set to `true` if your sensor provides a positive number for AUX input and negative number for AUX output | |animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | -|max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | -|aux_name: | Optional | `Auxilary` | Set the display name for the Auxilary Load +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | +|aux_name: | Optional | `Auxilary` | Set the display name for the AUX Load |aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. |aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |aux_loads:| Optional | `0` | Display additional loads on the AUX side (`0/1/2`) -|aux_load1_name: |Optional | | Set the display name for the AUX Load 1 -|aux_load2_name: |Optional | | Set the display name for the AUX Load 2 -|aux_load1_icon: | Optional | | Change the aux load 1 image using any mdi icon e.g. `mdi:ev-station` -|aux_load2_icon: | Optional | | Change the aux load 2 image using any mdi icon e.g. `mdi:ev-station` +|aux_load1_name: |Optional | | Set the display name for the AUX load 1 +|aux_load2_name: |Optional | | Set the display name for the AUX load 2 +|aux_load1_icon: | Optional | | Change the AUX load 1 image using any mdi icon e.g. `mdi:ev-station` +|aux_load2_icon: | Optional | | Change the AUX load 2 image using any mdi icon e.g. `mdi:ev-station` |additional_loads: | Optional | `0` | Display additional loads on the essential side (`0/1/2`) -|load1_name: | Optional | | Set the display name for the Essential Load 1 -|load2_name: | Optional | | Set the display name for the Essential Load 2 +|load1_name: | Optional | | Set the display name for the essential load 1 +|load2_name: | Optional | | Set the display name for the essential load 2 |load1_icon: | Optional | none | Change the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | |load2_icon: | Optional | none | Change the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | @@ -148,19 +148,19 @@ These attributes are only needed if `show_solar` is set to `true` | --- | --- | --- | --- | |colour:| Optional | `'#5490c2'`| Changes the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | |no_grid_colour:| Optional | `'#a40013'`|Changes the colour of the grid disconnected icon. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc)| -|show_daily_buy: | Optional | `false` | Toggles the Daily Buy Total | -|show_daily_sell: | Optional | `false` | Toggles the Daily Sell Total | -|show_nonessential: | Optional |`false` | Toggles the display of Non-Essential | -|nonessential_icon: | Optional | `default` | Change the nonessential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| -|nonessential_name: | Optional | `Non Essential` |Set the display name for the Non-Essential Load +|show_daily_buy: | Optional | `false` | Toggles the daily buy total | +|show_daily_sell: | Optional | `false` | Toggles the daily sell total | +|show_nonessential: | Optional |`false` | Toggles the display of non-essential | +|nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| +|nonessential_name: | Optional | `Non Essential` |Set the display name for the non-essential load |additional_loads: | Optional |`0`| Toggle the display of additional loads on the non-essential side (`0/1/2`) -|load1_name: | Optional | | Set the display name for the Non-Essential Load 1 -|load2_name: | Optional | |Set the display name for the Non-Essential Load 2 -|load1_icon: | Optional | `default` | Change the nonessential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | -|load2_icon: | Optional | `default` | Change the nonessential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | -|invert_grid:| Optional | `false`| Set to `true` if your sensor provides a negative number for Grid import and positive number for Grid export | -|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | -|max_power: | Optional | `8000` | Maximun Power draw to calculate animation speed | +|load1_name: | Optional | | Set the display name for the non-essential load 1 +|load2_name: | Optional | |Set the display name for the non-essential load 2 +|load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | +|load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | +|invert_grid:| Optional | `false`| Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | +|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | ### Entities @@ -171,52 +171,52 @@ See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Ma | Attribute | Requirement | Default | Description | | --- | --- | --- | --- | |use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | -|priority_load_243: | Optional |`switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to Priority Load or Priority Battery as an icon next to the inverter. Set to `no` to hide| -|day_battery_discharge_71: | Optional |`ssensor.sunsynk_day_battery_discharge` | Daily Battery Usage (kWh) | -|day_battery_charge_70: | Optional |`sensor.sunsynk_day_battery_charge` | Daily Battery Charge (kWh) | -|day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily Load (kWh) | -|day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily Grid Import (kWh) | -|day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily Grid Export (kWh) | -|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily Solar Usage (kWh | -|inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter Voltage (V) | -|load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load Frequency (Hz) | -|inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter Current (A) | -|inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter Power (W). Required if the essential_power attribute is set to `none` | -|grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid Power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | -|pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV String 1 Power (W)| -|pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV String 2 Power (W) | -|pv3_power_188: | Optional | `sensor.sunsynk_pv3_power` | PV String 3 Power (W) | -|pv4_power_189: | Optional | `sensor.sunsynk_pv4_power` | PV String 4 Power (W) | +|priority_load_243: | Optional |`switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide| +|day_battery_discharge_71: | Optional |`ssensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | +|day_battery_charge_70: | Optional |`sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | +|day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | +|day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | +|day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | +|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh | +|inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter voltage (V) | +|load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | +|inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter vurrent (A) | +|inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). Required if the essential_power attribute is set to `none` | +|grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | +|pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W)| +|pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | +|pv3_power_188: | Optional | `sensor.sunsynk_pv3_power` | PV string 3 power (W) | +|pv4_power_189: | Optional | `sensor.sunsynk_pv4_power` | PV string 4 power (W) | |pv_total:| Optional | `none` | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-4 power (W) -|battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery Voltage (V) | -|battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery State of Charge (%) | -|battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery Power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | -|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery Current (A) | +|battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | +|battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | +|battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | +|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery current (A) | |essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant. (W) | |essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W)| |essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W)| |nonessential_power| Optional | `none`| The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures non-essential power e.g. `Load power Non-Essential` in the case of Solar Assistant. (W) |non_essential_load1: | Optional | |Sensor that contains the power of your non-essential load 1 (W)| |non_essential_load2: | Optional | |Sensor that contains the power of your non-essential load 2 (W) -|grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT Power (W)| -|pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV String 1 Voltage (V) | -|pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV String 1 Current (A)| -|pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV String 2 Voltage (V)| -|pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV String 2 Current (A)| -|pv3_voltage_113: | Optional | `sensor.sunsynk_pv3_voltage` | PV String 3 Voltage (V) | -|pv3_current_114: | Optional | `sensor.sunsynk_pv3_current` | PV String 3 Current (A)| -|pv4_voltage_115: | Optional | `sensor.sunsynk_pv4_voltage` | PV String 4 Voltage (V)| -|pv4_current_116: | Optional | `sensor.sunsynk_pv4_current` | PV String 4 Current (A)| -|grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid Connected Status `on/off` or `1/0` | -|inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Inverter Status `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault` | -|aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary Power (W) | +|grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT power (W)| +|pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | +|pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A)| +|pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V)| +|pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A)| +|pv3_voltage_113: | Optional | `sensor.sunsynk_pv3_voltage` | PV string 3 voltage (V) | +|pv3_current_114: | Optional | `sensor.sunsynk_pv3_current` | PV string 3 current (A)| +|pv4_voltage_115: | Optional | `sensor.sunsynk_pv4_voltage` | PV string 4 voltage (V)| +|pv4_current_116: | Optional | `sensor.sunsynk_pv4_current` | PV string 4 current (A)| +|grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status `on/off` or `1/0` | +|inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Inverter status `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault` | +|aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary power (W) | |aux_load1:| Optional | | Sensor that contains the power of your AUX load 1 (W) | |aux_load2:| Optional | | Sensor that contains the power of your AUX load 2 (W) | |aux_connected_status: |Optional | None | AUX Connected Status `on/off` or `1/0` |remaining_solar: | Optional | `sensor.solcast_forecast_remaining_today`| The remaining solar forecast for the day (kWh) | -|battery_temp_182:| Optional | `sensor.sunsynk_battery_temperature` | Battery Temperature (℃)| -|radiator_temp_91:| Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC Temperature (℃)| -|dc_transformer_temp_90:| Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC Temperature (℃)| +|battery_temp_182:| Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (℃)| +|radiator_temp_91:| Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃)| +|dc_transformer_temp_90:| Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃)| |prog1_time:| Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) |prog1_capacity:| Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting |prog1_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) From 8abebddfbef5df88cf4b1c1119806739f6b55c67 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 10:00:21 +0000 Subject: [PATCH 20/40] feat: add unit of measurement to energy cost --- .github/PULL_REQUEST_TEMPLATE.md | 39 ++++++++++++++++++++++++++++++++ dist/sunsynk-power-flow-card.js | 8 +++---- src/const.ts | 20 ++++++++++++++-- src/index.ts | 28 +++++++++++------------ 4 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..a0a7e6cf --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,39 @@ + + +## Description + + + +## Related issues + + + + + +## Motivation and Context + + +## How has this been tested + + + +## Type of change + +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## Checklist + + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] Any dependent changes have been merged and published in downstream modules +- [ ] I have updated the version in `package.json` following [semver](https://semver.org/) + diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 1d5b230b..757ee4bd 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -9,19 +9,19 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let m=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var m;w[x]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const c=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const c=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o{var n,i;const a=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=a._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;a._$litPart$=o=new X(e.insertBefore(H(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return D}}lt.finalized=!0,lt._$litElement$=!0,null===(at=globalThis.litElementHydrateSupport)||void 0===at||at.call(globalThis,{LitElement:lt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:lt}),(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.3"); +var at,ot;class lt extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{var n,i;const a=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=a._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;a._$litPart$=o=new X(e.insertBefore(H(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return D}}lt.finalized=!0,lt._$litElement$=!0,null===(at=globalThis.litElementHydrateSupport)||void 0===at||at.call(globalThis,{LitElement:lt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:lt}),(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function wt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var mt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:wt("common.pv1_name"),pv2_name:wt("common.pv2_name"),pv3_name:wt("common.pv3_name"),pv4_name:wt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:wt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:wt("common.nonessential_name"),additional_loads:0,load1_name:wt("common.load1_name"),load2_name:wt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["12","20","16","4","40"],color:"green",message:"Normal"},alarm:{states:["64","7"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),w=e&&!e.nodeType&&e,m=w&&t&&!t.nodeType&&t,f=m&&m.exports===w,u=f&&y.process,q=function(){try{var t=m&&m.require&&m.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=wt(x,"Map"),X=wt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&mt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,wn,mn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=wn&&_n=mn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,Mn=new Date(Tn.getTime()+kn),bn=Mn.getHours(),An=Mn.getMinutes().toString().padStart(2,"0"),Hn=bn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),wt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),wt("common.to"),$s,wt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),wt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,wt("common.essential"),0===cs||!1===ds?"none":"",Oe,wt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),wt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),wt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),wt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),wt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),wt("common.daily_charge"),!1===ls?"transparent":"".concat(os),wt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),wt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),wt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,en,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,sn,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,on,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,ln,"no"===Ms?"none":"",ks,"no"===Ms?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ws?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ws,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ms&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ms&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ms&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ms&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ms,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ms,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=Ms?"232":"249","on"==ye.state&&"no"!==bs?"":"none",ks,"no"!=Ms?"232":"249","off"==ye.state&&"no"!==bs?"":"none",ks,"no"!=Ms?"243":"260","on"==ye.state&&"no"!==bs?"":"none",ks,wt("common.timer_on"),"no"!=Ms?"243":"260","off"==ye.state&&"no"!==bs?"":"none",ks,wt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=Ms?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=Ms?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=Ms?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,wt("common.priority_load"),"no"!=Ms?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,wt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=Ms?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=Ms?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(bt||(bt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",be.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",Pe.state):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),wt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),wt("common.to"),$s,wt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),wt("common.battery_floating"),!1===ls?"transparent":"".concat(os),wt("common.daily_charge"),!1===ls?"transparent":"".concat(os),wt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),wt("common.daily_load"),!1===is?"transparent":"".concat(Qe),wt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),wt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),wt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),wt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,en,"no"===Ms?"none":"","energy"===Ms?"st4 st8 left-align":"st12",ks,sn,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,on,"no"===Ms?"none":"","power"===Ms?"st4 st8 left-align":"st12",ks,ln,"no"===Ms?"none":"",ks,"no"===Ms?"none":"",ks,wt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ms||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ms,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==bs?"":"none",ks,"off"==ye.state&&!1!==bs?"":"none",ks,"off"==ye.state&&!1!==bs?"":"none",ks,wt("common.timer_off"),"on"==ye.state&&!1!==bs?"":"none",ks,wt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,wt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,wt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",be.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",Pe.state,(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(wt("errors.cardstyle"));if(!t.show_solar)throw Error(wt("errors.show_solar"));if(!t.battery)throw Error(wt("errors.battery.bat"));if(!t.battery.energy)throw new Error(wt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(wt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(wt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(wt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(wt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(wt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(wt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(wt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(wt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(wt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(wt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},mt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:wt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function mt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var wt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:mt("common.pv1_name"),pv2_name:mt("common.pv2_name"),pv3_name:mt("common.pv3_name"),pv4_name:mt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:mt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:mt("common.nonessential_name"),additional_loads:0,load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),m=e&&!e.nodeType&&e,w=m&&t&&!t.nodeType&&t,f=w&&w.exports===m,u=f&&y.process,q=function(){try{var t=w&&w.require&&w.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=mt(x,"Map"),X=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&wt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,mn,wn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=mn&&_n=wn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,bn=new Date(Tn.getTime()+kn),Mn=bn.getHours(),An=bn.getMinutes().toString().padStart(2,"0"),Hn=Mn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,mt("common.essential"),0===cs||!1===ds?"none":"",Oe,mt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),mt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),mt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ms,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ws,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ws,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=bs?"232":"249","on"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"232":"249","off"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"243":"260","on"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_on"),"no"!=bs?"243":"260","off"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=bs?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_load"),"no"!=bs?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"p"):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),mt("common.daily_load"),!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,mt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ws,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_off"),"on"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"p",(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},wt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); diff --git a/src/const.ts b/src/const.ts index 7cade49e..f92a0c4f 100644 --- a/src/const.ts +++ b/src/const.ts @@ -4,6 +4,22 @@ export const CARD_VERSION = version; export const validLoadValues = [0, 1, 2] + +/* Lux Status Codes +* +* Some codes may be missing, these are the ones we are aware of +* If you know any codes not in this list please let us know +* +* 0 = Standby +* 4 = Solar > Load - Surplus > Grid +* 7 = Charger Off (needs to be confirmed) +* 12 = Solar > Battery Charging +* 16 = Battery Discharging > LOAD - Surplus > Grid +* 20 = Solar + Battery Discharging > LOAD - Surplus > Grid +* 32 = Charging (needs to be confirmed) +* 40 = Solar + Grid > Battery Charging +* 64 = No AC Power (needs to be confirmed) +*/ export const inverterStatusGroups = { sunsynk: { standby: { states: ['0', 'standby'], color: 'blue', message: 'Standby' }, @@ -15,8 +31,8 @@ export const inverterStatusGroups = { lux: { standby: { states: ['0'], color: 'blue', message: 'Standby' }, selftest: { states: [], color: 'yellow', message: 'Selftest' }, - normal: { states: ['12', '20', '16', '4', '40'], color: 'green', message: 'Normal' }, - alarm: { states: ['64', '7'], color: 'orange', message: 'Alarm' }, + normal: { states: ['4', '12', '16', '20', '40'], color: 'green', message: 'Normal' }, + alarm: { states: ['7', '64'], color: 'orange', message: 'Alarm' }, fault: { states: [], color: 'red', message: 'Fault' }, } diff --git a/src/index.ts b/src/index.ts index 33d58077..c5afb43e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -863,7 +863,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1) } kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1)} kWh @@ -907,19 +907,19 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0) } W + ${parseFloat(stateObj9.state).toFixed(0)} W ` : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0) } W + ${parseFloat(stateObj8.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0) } W`} + : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0) } W + ${parseFloat(stateObj31.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0) } W`} + : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> ${parseFloat(stateObj32.state).toFixed(0)} W @@ -938,7 +938,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(stateObj12.state) } % + ${parseInt(stateObj12.state)} % this.handlePopup(e, config.entities.battery_soc_184)}> | ${inverter_prog.capacity || 0} % @@ -947,13 +947,13 @@ export class SunsynkPowerFlowCard extends LitElement { ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state } A + ${stateObj35.state} A this.handlePopup(e, config.entities.inverter_power_175)}> ${stateObj22.state} W this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state } W + ${stateObj23.state} W this.handlePopup(e, config.entities.pv1_voltage_109)}> ${stateObj16.state} V @@ -968,13 +968,13 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj19.state} A this.handlePopup(e, config.entities.pv3_voltage_113)}> - ${stateObj27.state } V + ${stateObj27.state} V this.handlePopup(e, config.entities.pv3_current_114)}> - ${stateObj28.state } A + ${stateObj28.state} A this.handlePopup(e, config.entities.pv4_voltage_115)}> - ${stateObj29.state } V + ${stateObj29.state} V this.handlePopup(e, config.entities.pv4_current_116)}> ${stateObj30.state} A @@ -989,7 +989,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state} + ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || 'p'}
@@ -1272,7 +1272,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${stateObj43.state} + ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || 'p'} ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> From 9bb1fcce00b24e2699b57aea2d37dd008cea44e4 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 10:45:15 +0000 Subject: [PATCH 21/40] refactor: change default currency measurement to blank --- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 757ee4bd..2341463e 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function mt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var wt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:mt("common.pv1_name"),pv2_name:mt("common.pv2_name"),pv3_name:mt("common.pv3_name"),pv4_name:mt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:mt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:mt("common.nonessential_name"),additional_loads:0,load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),m=e&&!e.nodeType&&e,w=m&&t&&!t.nodeType&&t,f=w&&w.exports===m,u=f&&y.process,q=function(){try{var t=w&&w.require&&w.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=mt(x,"Map"),X=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&wt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,mn,wn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=mn&&_n=wn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,bn=new Date(Tn.getTime()+kn),Mn=bn.getHours(),An=bn.getMinutes().toString().padStart(2,"0"),Hn=Mn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,mt("common.essential"),0===cs||!1===ds?"none":"",Oe,mt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),mt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),mt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ms,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ws,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ws,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=bs?"232":"249","on"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"232":"249","off"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"243":"260","on"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_on"),"no"!=bs?"243":"260","off"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=bs?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_load"),"no"!=bs?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"p"):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),mt("common.daily_load"),!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,mt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ws,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_off"),"on"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"p",(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},wt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function mt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var wt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:mt("common.pv1_name"),pv2_name:mt("common.pv2_name"),pv3_name:mt("common.pv3_name"),pv4_name:mt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:mt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:mt("common.nonessential_name"),additional_loads:0,load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),m=e&&!e.nodeType&&e,w=m&&t&&!t.nodeType&&t,f=w&&w.exports===m,u=f&&y.process,q=function(){try{var t=w&&w.require&&w.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=mt(x,"Map"),X=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&wt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,mn,wn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=mn&&_n=wn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,bn=new Date(Tn.getTime()+kn),Mn=bn.getHours(),An=bn.getMinutes().toString().padStart(2,"0"),Hn=Mn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,mt("common.essential"),0===cs||!1===ds?"none":"",Oe,mt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),mt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),mt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ms,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ws,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ws,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=bs?"232":"249","on"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"232":"249","off"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"243":"260","on"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_on"),"no"!=bs?"243":"260","off"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=bs?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_load"),"no"!=bs?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||""):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),mt("common.daily_load"),!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,mt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ws,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_off"),"on"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"",(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},wt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); diff --git a/src/index.ts b/src/index.ts index c5afb43e..ac602899 100644 --- a/src/index.ts +++ b/src/index.ts @@ -989,7 +989,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || 'p'} + ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || ''}
@@ -1272,7 +1272,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || 'p'} + ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || ''} ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> From c7f7d39d054b6a239d5f60b9f513cc7790b374c0 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Thu, 17 Aug 2023 17:39:09 +0200 Subject: [PATCH 22/40] feat: clicking additional loads shows more-info dialog for full card --- src/index.ts | 64 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index ac602899..891d407d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -515,11 +515,8 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.essential')} ${localize('common.essential')} ${config.load.load1_name} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ${config.load.load1_name} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ${config.load.load2_name} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W ${localize('common.daily_load')} ${localize('common.daily_load')} ${localize('common.daily_solar')} @@ -533,9 +530,6 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.grid.load1_name} ${config.grid.load1_name} ${config.grid.load2_name} - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj40.state)) ? 0 : parseFloat(stateObj40.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj41.state)) ? 0 : parseFloat(stateObj41.state).toFixed(0)} W ${Autarky}% ${Ratio}% ${Autarkyp}% @@ -544,8 +538,6 @@ export class SunsynkPowerFlowCard extends LitElement { Ratio ${config.load.aux_load1_name} ${config.load.aux_load2_name} - ${isNaN(parseFloat(stateObj48.state)) ? 0 : parseFloat(stateObj48.state).toFixed(0)} W - ${isNaN(parseFloat(stateObj49.state)) ? 0 : parseFloat(stateObj49.state).toFixed(0)} W @@ -886,13 +878,12 @@ export class SunsynkPowerFlowCard extends LitElement { ${total_pv || 0} W ` : svg` ${total_pv || 0} W `} - - ${config.entities.essential_power !== 'none' + ${config.entities?.essential_power ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential || 0} W ` : svg`${essential || 0} W`} - ${config.entities.nonessential_power !== 'none' + ${config.entities?.nonessential_power ? svg` this.handlePopup(e, config.entities.nonessential_power)}> ${nonessential || 0} W ` @@ -900,31 +891,72 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.grid_ct_power_172)}> ${grid_power || 0} W - ${config.entities.aux_power_166 !== 'none' + ${config.entities?.aux_power_166 ? svg` this.handlePopup(e, config.entities.aux_power_166)}> ${aux_power < 0 ? aux_power * -1 : aux_power} W ` : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} - ${config.entities.pv1_power_186 !== 'none' + ${config.entities?.pv1_power_186 ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> ${parseFloat(stateObj9.state).toFixed(0)} W ` : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} - ${config.entities.pv2_power_187 !== 'none' + ${config.entities?.pv2_power_187 ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> ${parseFloat(stateObj8.state).toFixed(0)} W ` : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} - ${config.entities.pv3_power_188 !== 'none' + ${config.entities?.pv3_power_188 ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> ${parseFloat(stateObj31.state).toFixed(0)} W ` : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} - ${config.entities.pv4_power_189 !== 'none' + ${config.entities?.pv4_power_189 ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> ${parseFloat(stateObj32.state).toFixed(0)} W ` : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} + ${config.entities?.aux_load1 + ? svg` this.handlePopup(e, config.entities.aux_load1)}> + ${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W`} + ${config.entities?.aux_load2 + ? svg` this.handlePopup(e, config.entities.aux_load1)}> + ${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W`} + ${config.entities?.non_essential_load1 + ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> + ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + ${config.entities?.non_essential_load1 + ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> + ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + ${config.entities?.non_essential_load2 + ? svg` this.handlePopup(e, config.entities.non_essential_load2)}> + ${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W`} + ${config.entities?.essential_load1 + ? svg` this.handlePopup(e, config.entities.essential_load1)}> + ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + ${config.entities?.essential_load1 + ? svg` this.handlePopup(e, config.entities.essential_load1)}> + ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + ${config.entities?.essential_load2 + ? svg` this.handlePopup(e, config.entities.essential_load2)}> + ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W + ` + : svg`${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W`} + this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V From a63117b68e780deeea86706b5e6dad53c4ec952b Mon Sep 17 00:00:00 2001 From: slipx06 Date: Thu, 17 Aug 2023 17:55:58 +0200 Subject: [PATCH 23/40] refactor: fix types --- src/index.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index 891d407d..5327772c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -918,44 +918,44 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities?.aux_load1 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W`} ${config.entities?.aux_load2 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} ${config.entities?.non_essential_load2 ? svg` this.handlePopup(e, config.entities.non_essential_load2)}> - ${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} ${config.entities?.essential_load2 ? svg` this.handlePopup(e, config.entities.essential_load2)}> - ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W + ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W ` - : svg`${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W`} + : svg`${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V From 5f5d8f3b47577b6a4a053069fb178bc43f161d57 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 16:01:20 +0000 Subject: [PATCH 24/40] refactor: invert ternary operator to remove negations --- dist/sunsynk-power-flow-card.js | 8 ++++---- src/index.ts | 36 ++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 2341463e..d6d6a2de 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -9,19 +9,19 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let m=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; + */;var h;const d=window,c=d.trustedTypes,p=c?c.emptyScript:"",v=d.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},y=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},x="finalized";let u=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const n=this._$Ep(s,e);void 0!==n&&(this._$Ev.set(n,s),t.push(n))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const i=this[t];this[e]=n,this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const s=document.createElement("style"),i=n.litNonce;void 0!==i&&s.setAttribute("nonce",i),s.textContent=e.cssText,t.appendChild(s)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=g){var n;const i=this.constructor._$Ep(t,s);if(void 0!==i&&!0===s.reflect){const a=(void 0!==(null===(n=s.converter)||void 0===n?void 0:n.toAttribute)?s.converter:_).toAttribute(e,s.type);this._$El=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,i=n._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=n.getPropertyOptions(i),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:_;this._$El=i,this[i]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var w;m[x]=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:m}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const f=window,u=f.trustedTypes,q=u?u.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,B=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,F=/"/g,S=/^(?:script|style|textarea|title)$/i,R=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),j=R(1),N=R(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?B:'"'===r[3]?F:C):o===F||o===C?o=B:o===V||o===I?o=P:(o=B,i=void 0);const c=o===B&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=u?u.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=w?w.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o{var n,i;const a=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=a._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;a._$litPart$=o=new X(e.insertBefore(H(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return D}}lt.finalized=!0,lt._$litElement$=!0,null===(at=globalThis.litElementHydrateSupport)||void 0===at||at.call(globalThis,{LitElement:lt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:lt}),(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.3"); +var at,ot;class lt extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{var n,i;const a=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let o=a._$litPart$;if(void 0===o){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;a._$litPart$=o=new X(e.insertBefore(H(),t),t,void 0,null!=s?s:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return D}}lt.finalized=!0,lt._$litElement$=!0,null===(at=globalThis.litElementHydrateSupport)||void 0===at||at.call(globalThis,{LitElement:lt});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:lt}),(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function mt(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var wt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:mt("common.pv1_name"),pv2_name:mt("common.pv2_name"),pv3_name:mt("common.pv3_name"),pv4_name:mt("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:mt("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:mt("common.nonessential_name"),additional_loads:0,load1_name:mt("common.load1_name"),load2_name:mt("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const ft=[0,1,2],ut={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),m=e&&!e.nodeType&&e,w=m&&t&&!t.nodeType&&t,f=w&&w.exports===m,u=f&&y.process,q=function(){try{var t=w&&w.require&&w.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,B=E.call(Object),C=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=f?x.Buffer:void 0,S=x.Symbol,R=x.Uint8Array,j=F?F.allocUnsafe:void 0,N=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=F?F.isBuffer:void 0,Q=Math.max,W=Date.now,G=mt(x,"Map"),X=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?C:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=ft(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=ut(t,s),r=ut(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(f=l)&&At(f)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Bt,Ct=(Bt=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Bt.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&wt(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));yn[e]=new Date(_n.getTime()),yn[e].setHours(s),yn[e].setMinutes(n)}));const[gn,xn,mn,wn,fn,un]=yn;function qn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ds.charge="none":Ds.charge="both",Ds.capacity=parseInt(t.capacity.state),Ds.entityID=e}_n>=un||_n=gn&&_n=xn&&_n=mn&&_n=wn&&_n=fn&&_n0?$s="off"===he.state||!1===Ds.show||parseInt(ee.state)<=Ds.capacity?dt.battery.shutdown_soc:Ds.capacity:Hs<0&&("off"===he.state||!1===Ds.show||parseInt(ee.state)>=Ds.capacity?$s=100:parseInt(ee.state)0?Os=(parseInt(ee.state)-$s)/100*dt.battery.energy/Hs*60*60:Hs<0&&(Os=($s-parseInt(ee.state))/100*dt.battery.energy/Hs*60*60*-1);const Tn=new Date,kn=1e3*Os,bn=new Date(Tn.getTime()+kn),Mn=bn.getHours(),An=bn.getMinutes().toString().padStart(2,"0"),Hn=Mn.toString().padStart(2,"0");zs="".concat(Hn,":").concat(An);const Zn=Math.floor(Os/86400),Ln=Math.floor(Os%86400/3600),En=Math.floor(Os%3600/60);Zn>0&&(Us+="".concat(Zn," days, ")),(Ln>0||Zn>0)&&(Us+="".concat(Ln," hrs, ")),Us+="".concat(En," min")}let Ys=!!(-2<=parseInt(ke.state)&&parseInt(ke.state)<=2&&parseInt(ee.state)>=99),Qs="",Ws="",Gs="",Xs=!1;Gs="sunsynk"!==dt.inverter.model&&"lux"!==dt.inverter.model?"sunsynk":dt.inverter.model;let Ks=ut[Gs];for(const Pn of Object.keys(Ks)){const Vn=Ks[Pn],{states:In,color:Bn,message:Cn}=Vn;if(In.includes(de.state)){Qs=Bn,Ws=Cn,Xs=!0;break}}Xs||("none"!==(null===(R=dt.entities)||void 0===R?void 0:R.inverter_status_59)&&(null===(D=dt.entities)||void 0===D?void 0:D.inverter_status_59)?(Qs="transparent",Ws="Status"):(Qs="transparent",Ws=""));let Js=(isNaN(parseFloat(yt.state))?0:parseFloat(yt.state))+(isNaN(parseFloat(ct.state))?0:parseFloat(ct.state)),tn=(isNaN(parseFloat(vt.state))?0:parseFloat(vt.state))+(isNaN(parseFloat(pt.state))?0:parseFloat(pt.state)),en=0!=tn?Math.min(Math.round(100*Js/tn),100):0,sn=0!=Js?Math.min(Math.round(100*tn/Js),100):0,nn=Ps+parseInt("".concat(Hs>0?Hs:0))+parseInt("".concat(je<0?-1*je:0)),an=Is+Bs+parseInt("".concat(je>0?je:0))+parseInt("".concat(Hs<0?-1*Hs:0)),on=0!=an?Math.min(Math.round(100*nn/an),100):0,ln=0!=nn?Math.min(Math.round(100*an/nn),100):0,rn=null===($=dt.solar)||void 0===$?void 0:$.animation_speed;if(dt&&dt.solar&&dt.solar.animation_speed){let Fn=dt.solar.animation_speed-(dt.solar.animation_speed-1)*(Ps/(dt.solar.max_power||Ps));rn=Fn>=1?Fn:1}let hn=null===(O=dt.battery)||void 0===O?void 0:O.animation_speed;if(dt&&dt.battery&&dt.battery.animation_speed){let Sn=dt.battery.animation_speed-(dt.battery.animation_speed-1)*((Hs<0?-1*Hs:Hs)/(dt.battery.max_power||(Hs<0?-1*Hs:Hs)));hn=Sn>=1?Sn:1}let dn=null===(z=dt.load)||void 0===z?void 0:z.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let Rn=dt.load.animation_speed-(dt.load.animation_speed-1)*(Is/(dt.load.max_power||Is));dn=Rn>=1?Rn:1}let cn=null===(U=dt.load)||void 0===U?void 0:U.animation_speed;if(dt&&dt.load&&dt.load.animation_speed){let jn=dt.load.animation_speed-(dt.load.animation_speed-1)*((parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))/(dt.load.max_power||(parseInt(ve.state)<0?-1*parseInt(ve.state):parseInt(ve.state))));cn=jn>=1?jn:1}let pn=null===(Y=dt.grid)||void 0===Y?void 0:Y.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Nn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*((parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))/(dt.grid.max_power||(parseInt(ie.state)<0?-1*parseInt(ie.state):parseInt(ie.state))));pn=Nn>=1?Nn:1}let vn=null===(Q=dt.grid)||void 0===Q?void 0:Q.animation_speed;if(dt&&dt.grid&&dt.grid.animation_speed){let Dn=dt.grid.animation_speed-(dt.grid.animation_speed-1)*(Bs/(dt.grid.max_power||Bs));vn=Dn>=1?Dn:1}return"full"===dt.cardstyle?j(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ',' W\n ',' W\n ',' W\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ',' W\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ",'\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),Oe,Oe,ze,Ue,Qe,Qe,!1===Ts?"".concat(Zs):"100%",rs,!1===dt.show_solar?"st12":"",os,Qe,Qe,ze,!1===ds?"st12":"",Oe,ks,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Qe,!1===Ge?"st12":"",1===ns?"":"none",Qe,!1===Ge?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",2===ns?"":"none",Qe,!1===Ge||1===ns?"st12":"",!1===ds?"30":"143",Oe,1===cs?"":"none",!1===ds?"376":"373",!1===ds?"30":"143",Oe,2===cs?"":"none",!1===ds?"413":"410",!1===ds?"30":"143",Oe,2===cs?"":"none",ze,!1===ds?"none":"",1===ps||2===ps?"":"st12",ze,!1===ds?"none":"",2===ps?"":"st12",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,Qe,ks,Ws,1!==cs&&2!==cs||!0!==ds?"":"none",Oe,mt("common.essential"),0===cs||!1===ds?"none":"",Oe,mt("common.essential"),!1===ds?70:181,1===cs?"":"none",Oe,dt.load.load1_name,!1===ds?47:158,1===cs?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?393:390,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load1_name,!1===ds?394:391,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),!1===ds?429:426,!1===ds?59:172,2===cs?"":"none",Oe,dt.load.load2_name,!1===ds?430:427,!1===ds?42:154,2===cs?"":"none",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),2===ps?"238":"306",!1===Ye||!1===ds?"transparent":"".concat(Oe),mt("common.daily_load"),0===cs?"377":"306",0===cs?71:93,!1===Ye||!0===ds?"transparent":"".concat(Oe),mt("common.daily_load"),!1===hs||!1===dt.show_solar||"false"!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||"false"===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),!1===Ge?"311":"347",!1===Ge?"368":"253",!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===Ge?"311":"347",!1===Ge?"337":"222",!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),dt.load.aux_name,!1===Ge?"none":"",Qe,dt.grid.nonessential_name,!1===Ge||0===ns||2===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load1_name,!1===Ge||0===ns||1===ns?"none":"",Qe,dt.grid.load2_name,!1===Ge||0===ns||2===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Ze.state))?0:parseFloat(Ze.state).toFixed(0),!1===Ge||0===ns||1===ns?"none":"",Qe,isNaN(parseFloat(Le.state))?0:parseFloat(Le.state).toFixed(0),"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,1===ps?53:14,!1===ds||0===ps?"none":"",ze,dt.load.aux_load1_name,!1===ds||0===ps||1===ps?"none":"",ze,dt.load.aux_load2_name,!1===qs?"st14":"st4",!1===ds||0===ps?"none":"",ze,isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state).toFixed(0),!1===qs?"st14":"st4",!1===ds||0===ps||1===ps?"none":"",ze,isNaN(parseFloat(Se.state))?0:parseFloat(Se.state).toFixed(0),Qs,!0===ds?"":"none",1===cs||2===cs?"":"st12",Oe,!1===ds?"":"none",1===cs?"":"st12",Oe,!1===ds?"":"none",2===cs?"":"st12",Oe,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn/2,De>0||0===De?"transparent":"".concat(Qe),pn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn/2,Qe,!1===Ge?"st12":"",!1===Ge?"st12":"",Bs<=0?"transparent":"".concat(Qe),vn,!1===ds?"st12":"",ze,!1===ds||0===je?"st12":"",je<0?"transparent":"".concat(ze),cn,!1===ds||0===je?"st12":"",je>0?"transparent":"".concat(ze),cn,!1===ds?"st12":"",ze,Qe,ks,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,ks,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?"1":"0",os,parseInt(ee.state)<=Es?1:0,os,!1===dt.show_solar?"st12":"",rs,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,"default"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"oven"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"boiler"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"pump"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,"aircon"===gs?"1":"0",!1===Ge||2===ns||1===ns?"none":"",Qe,!1===Ge||2===ns||1===ns?"none":"",gs,"default"===xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"===xs&&"default"!=ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"default"!=xs&&"default"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"boiler"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"pump"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"oven"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,"aircon"===ms?"1":"0",!1===Ge||0===ns||1===ns?"none":"",Qe,!1===Ge||0===ns||1===ns?"none":"",xs,!1===Ge||0===ns||1===ns?"none":"",ms,"default"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"boiler"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"pump"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"oven"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,"aircon"===xs?"1":"0",!1===Ge||0===ns||2===ns?"none":"",Qe,!1===Ge||0===ns||2===ns?"none":"",xs,1!==cs&&2!==cs||!1!==ds?"none":"",Oe,1!==cs&&2!==cs||!0!==ds?"none":"",Oe,1===cs||2===cs?"none":"",Oe,(t=>this.handlePopup(t,dt.entities.aux_connected_status)),"default"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"gen"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"inverter"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"oven"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"boiler"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"aircon"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),"pump"===vs?"":"st12",!1===ds||1===ps||2===ps?"none":"","".concat("on"===Ke||"1"===Ke?ze:Ue),!1===ds||1===ps||2===ps?"none":"",vs,"on"===Ke||"1"===Ke?"aux-icon":"aux-off-icon",!1===ds||0===ps?"none":"",_s,!1===ds||1===ps||0===ps?"none":"",ys,"boiler"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"boiler"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"boiler"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"boiler"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"aircon"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"aircon"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"aircon"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"aircon"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"pump"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"pump"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"pump"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,"pump"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",!1===ds||0===cs||1===cs?"none":"",Oe,"oven"===ws&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===fs&&2===cs&&!1===ds?"1":"0",0===cs||1===cs?"none":"",Oe,"oven"===ws&&1===cs&&!1===ds?"1":"0",0===cs||2===cs?"none":"",Oe,"oven"===ws&&1===cs?"1":"0",!1===ds||0===cs||2===cs?"none":"",Oe,0===cs||1===cs?"none":"",!0===ds?"350":"383",!0===ds?"140":"5",ws,0===cs||1===cs?"none":"",!0===ds?"446":"420",!0===ds?"140":"5",fs,0===cs||2===cs?"none":"","336",!0===ds?"140":"27",ws,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"no"!=bs?"232":"249","on"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"232":"249","off"==ye.state&&"no"!==Ms?"":"none",ks,"no"!=bs?"243":"260","on"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_on"),"no"!=bs?"243":"260","off"==ye.state&&"no"!==Ms?"":"none",ks,mt("common.timer_off"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"none"!==dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,(t=>this.handlePopup(t,dt.entities.priority_load_243)),"no"!=bs?"251":"268","off"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"251":"268","on"===_e.state&&"no"!==As?"":"none",ks,"no"!=bs?"262":"280","on"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_load"),"no"!=bs?"262":"280","off"===_e.state&&"no"!==As?"":"none",ks,mt("common.priority_batt"),!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,"no"!=bs?"232":"249",!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||"false"!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===ps?"238":"306",!1===Ye||!1===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),0===cs?"377":"306",0===cs?"57":"80",!1===Ye||!0===ds?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===Ge?"311":"347",!1===Ge?"354":"239",!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===Ge?"311":"347",!1===Ge?"323":"209",!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(null===(W=dt.entities)||void 0===W?void 0:W.pv_total)?N(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(At||(At=e([' '," W "])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.essential_power?N(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(Zt||(Zt=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0),"none"!==dt.entities.nonessential_power?N(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.nonessential_power)),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0):N(Et||(Et=e([''," W "])),!1===Ge?"none":"",!1===qs?"st14":"st4",Qe,Bs||0),(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,"none"!==dt.entities.aux_power_166?N(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.aux_power_166)),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je):N(Vt||(Vt=e([''," W "])),!1===qs?"st14":"st4",!1===ds?"none":"",ze,je<0?-1*je:je),"none"!==dt.entities.pv1_power_186?N(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Bt||(Bt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Ct||(Ct=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Ft||(Ft=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Rt||(Rt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(jt||(jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Nt||(Nt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",!1===qs?"st14":"st4",Qe,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",!1===qs?"st14":"st4",Qe,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",!1===qs?"st14":"st4",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.inverter_power_175)),"none"===dt.entities.inverter_power_175?"none":"",!1===qs?"st14":"st4",ks,ce.state,(t=>this.handlePopup(t,dt.entities.grid_power_169)),"none"===dt.entities.grid_power_169?"none":"",!1===qs?"st14":"st4",Qe,pe.state,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(G=dt.entities)||void 0===G?void 0:G.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),4===(null===(X=dt.solar)||void 0===X?void 0:X.mppts)?137:158,4===(null===(K=dt.solar)||void 0===K?void 0:K.mppts)?222:153,"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(J=dt.entities)||void 0===J?void 0:J.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(tt=dt.entities)||void 0===tt?void 0:tt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(et=dt.entities)||void 0===et?void 0:et.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||""):"lite"===dt.cardstyle?j(Dt||(Dt=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Oe,!1===dt.show_solar?145.33:-.5,!1===dt.show_solar?270.67:406,"".concat(!1===Ts?!1===dt.show_solar?"246px":"".concat(Zs):!1===dt.show_solar?"75%":"100%"),Oe,rs,!1===dt.show_solar?"st12":"",os,Qe,rs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",Oe,1===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",Oe,2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",0===dt.battery.energy||!0===Ys||0===Hs?"transparent":"".concat(os),Us,0===dt.battery.energy||Hs<=0||!0===Ys?"transparent":"".concat(os),mt("common.runtime_to"),$s,zs,0===dt.battery.energy||Hs>=0||!0===Ys?"transparent":"".concat(os),mt("common.to"),$s,mt("common.charge"),zs,0===dt.battery.energy||!1===Ys?"transparent":"".concat(os),mt("common.battery_floating"),!1===ls?"transparent":"".concat(os),mt("common.daily_charge"),!1===ls?"transparent":"".concat(os),mt("common.daily_discharge"),2===cs?"365":"415",2===cs?"182.2":"282.1",!1===Ye?"transparent":"".concat(Oe),mt("common.daily_load"),!1===is?"transparent":"".concat(Qe),mt("common.daily_grid_buy"),!1===as?"transparent":"".concat(Qe),mt("common.daily_grid_sell"),!1===hs||!1===dt.show_solar||0!=us?"transparent":"".concat(rs),mt("common.daily_solar"),!1===hs||!1===dt.show_solar||!1===us?"transparent":"".concat(rs),mt("common.daily_solar_left"),!1===dt.show_solar?"none":"",rs,dt.solar.pv1_name,!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,dt.solar.pv2_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,dt.solar.pv3_name,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,dt.solar.pv4_name,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,en,"no"===bs?"none":"","energy"===bs?"st4 st8 left-align":"st12",ks,sn,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,on,"no"===bs?"none":"","power"===bs?"st4 st8 left-align":"st12",ks,ln,"no"===bs?"none":"",ks,"no"===bs?"none":"",ks,mt("common.ratio"),1===cs&&!0===dt.show_solar?"":"none",Oe,(null===(st=dt.load)||void 0===st?void 0:st.load1_name)?"".concat(dt.load.load1_name):"",1===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(nt=dt.load)||void 0===nt?void 0:nt.load1_name)?"".concat(dt.load.load1_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state).toFixed(0),2===cs&&!0===dt.show_solar?"":"none",Oe,(null===(it=dt.load)||void 0===it?void 0:it.load2_name)?"".concat(dt.load.load2_name):"",2===cs&&!0===dt.show_solar?"":"none",!1===qs?"st14":"st4",Oe,isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state).toFixed(0),Qs,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",parseInt(Tt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts?"st12":"",parseInt(qt.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"st12":"",parseInt(fe.state)<=0?"transparent":"".concat(rs),rn,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",rs,!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"st12":"",parseInt(ue.state)<=0?"transparent":"".concat(rs),rn,os,Hs<0||0===Hs?"transparent":"".concat(os),hn,Hs>0||0===Hs?"transparent":"".concat(os),hn,!1===dt.show_solar?"st12":"",rs,!1===dt.show_solar?"st12":"",0===Ps?"transparent":"".concat(rs),rn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Qe,De<0||0===De?"transparent":"".concat(Qe),pn,De>0||0===De?"transparent":"".concat(Qe),pn,Oe,0===Is?"transparent":"".concat(Oe),dn,Oe,0===Is?"transparent":"".concat(Oe),dn,1===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,2===cs&&!0===dt.show_solar?"":"st12",Oe,"oven"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"oven"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"pump"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"aircon"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"!==ws||1!==cs&&2!==cs?"0":"1",0===cs||!1===dt.show_solar?"none":"",Oe,"boiler"===fs&&2===cs?"1":"0",0===cs||!1===dt.show_solar?"none":"",Oe,0===cs||!1===dt.show_solar?"none":"",ws,0===cs||1===cs||!1===dt.show_solar?"none":"",fs,!1===dt.show_solar?"st12":"",rs,parseInt(ee.state)>=Ls?1:0,os,parseInt(ee.state)>=50&&parseInt(ee.state)Es&&parseInt(ee.state)<=49?1:0,os,parseInt(ee.state)<=Es?1:0,os,(t=>this.handlePopup(t,dt.entities.grid_connected_status_194)),"off"===Xe||"0"===Xe?"st12":"",Qe,"on"===Xe||"1"===Xe?"st12":"",We,Oe,ks,(t=>this.handlePopup(t,dt.entities.use_timer_248)),"on"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,"off"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_off"),"on"==ye.state&&!1!==Ms?"":"none",ks,mt("common.timer_on"),(t=>this.handlePopup(t,dt.entities.priority_load_243)),"off"===_e.state&&!1!==As?"":"none",ks,"on"===_e.state&&!1!==As?"":"none",ks,"off"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_batt"),"on"===_e.state&&!1!==As?"":"none",ks,mt("common.priority_load"),(t=>this.handlePopup(t,dt.entities.solar_sell_247)),dt.entities.solar_sell_247&&"off"!==Ve.state&&"0"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,dt.entities.solar_sell_247&&"on"!==Ve.state&&"1"!==Ve.state&&!1!==dt.show_solar?"":"none",rs,!1===$e?"":"st12",(t=>this.handlePopup(t,Ds.entityID)),!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"st12":"",ks,!1===Ds.show||"none"===dt.entities.use_timer_248?"none":"","none"===Ds.charge?"":"st12",ks,(t=>this.handlePopup(t,dt.entities.day_battery_charge_70)),!1===ls?"none":"",os,parseFloat(pt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||0!=us?"none":"",rs,parseFloat(yt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_pv_energy_108)),!1===hs||!1===dt.show_solar||!1===us?"none":"",rs,parseFloat(yt.state).toFixed(1),us,(t=>this.handlePopup(t,dt.entities.day_battery_discharge_71)),!1===ls?"none":"",os,parseFloat(ct.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_load_energy_84)),2===cs?"365":"400.4",2===cs?"168":"267.9",!1===Ye?"none":"",Oe,parseFloat(vt.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_import_76)),!1===is?"none":"",Qe,parseFloat(_t.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.day_grid_export_77)),!1===as?"none":"",Qe,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,dt.entities.inverter_voltage_154)),"none"!==dt.entities.inverter_voltage_154&&dt.entities.inverter_voltage_154?"":"none",ks,ts,(t=>this.handlePopup(t,dt.entities.load_frequency_192)),"none"!==dt.entities.load_frequency_192&&dt.entities.load_frequency_192?"":"none",ks,Je,(t=>this.handlePopup(t,dt.entities.inverter_current_164)),"none"!==dt.entities.inverter_current_164&&dt.entities.inverter_current_164?"":"none",ks,es,(t=>this.handlePopup(t,dt.entities.battery_voltage_183)),"none"!==dt.entities.battery_voltage_183&&dt.entities.battery_voltage_183?"":"none",os,!1===qs?"st14":"st4",ss,(t=>this.handlePopup(t,dt.entities.battery_soc_184)),"none"===dt.entities.battery_soc_184?"none":"",os,parseInt(ee.state),(t=>this.handlePopup(t,dt.entities.battery_soc_184)),os,!1===Ds.show||"none"===dt.entities.battery_soc_184?"none":"",Ds.capacity||0,(t=>this.handlePopup(t,dt.entities.battery_power_190)),"none"===dt.entities.battery_power_190?"none":"",os,!1===qs?"st14":"st4",Hs<0?-1*Hs:Hs,(t=>this.handlePopup(t,dt.entities.battery_current_191)),"none"===dt.entities.battery_current_191?"none":"",os,!1===qs?"st14":"st4",ke.state,(t=>this.handlePopup(t,dt.entities.grid_ct_power_172)),"none"===dt.entities.grid_ct_power_172?"none":"",!1===qs?"st14":"st4",Qe,De||0,(t=>this.handlePopup(t,dt.entities.pv1_voltage_109)),!1!==dt.show_solar&&dt.entities.pv1_voltage_109&&"none"!==dt.entities.pv1_voltage_109?"":"none",rs,ae.state,(t=>this.handlePopup(t,dt.entities.pv1_current_110)),!1!==dt.show_solar&&dt.entities.pv1_current_110&&"none"!==dt.entities.pv1_current_110?"":"none",rs,oe.state,(t=>this.handlePopup(t,dt.entities.pv2_voltage_111)),!1!==dt.show_solar&&dt.entities.pv2_voltage_111&&"none"!==dt.entities.pv2_voltage_111&&1!==dt.solar.mppts?"":"none",rs,le.state,(t=>this.handlePopup(t,dt.entities.pv2_current_112)),!1!==dt.show_solar&&dt.entities.pv2_current_112&&"none"!==dt.entities.pv2_current_112&&1!==dt.solar.mppts?"":"none",rs,re.state,(t=>this.handlePopup(t,dt.entities.pv3_voltage_113)),!1!==dt.show_solar&&dt.entities.pv3_voltage_113&&"none"!==dt.entities.pv3_voltage_113&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,ge.state,(t=>this.handlePopup(t,dt.entities.pv3_current_114)),!1!==dt.show_solar&&dt.entities.pv3_current_114&&"none"!==dt.entities.pv3_current_114&&1!==dt.solar.mppts&&2!==dt.solar.mppts?"":"none",rs,xe.state,(t=>this.handlePopup(t,dt.entities.pv4_voltage_115)),!1!==dt.show_solar&&dt.entities.pv4_voltage_115&&"none"!==dt.entities.pv4_voltage_115&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,me.state,(t=>this.handlePopup(t,dt.entities.pv4_current_116)),!1!==dt.show_solar&&dt.entities.pv4_current_116&&"none"!==dt.entities.pv4_current_116&&1!==dt.solar.mppts&&2!==dt.solar.mppts&&3!==dt.solar.mppts?"":"none",rs,we.state,(t=>this.handlePopup(t,dt.entities.battery_temp_182)),"none"===dt.entities.battery_temp_182?"st12":"st3 left-align",os,(null===(at=dt.entities)||void 0===at?void 0:at.battery_temp_182)?"":"none",Me.state,(t=>this.handlePopup(t,dt.entities.radiator_temp_91)),"none"===dt.entities.radiator_temp_91?"st12":"st3 left-align",ks,(null===(ot=dt.entities)||void 0===ot?void 0:ot.radiator_temp_91)?"":"none",He.state,(t=>this.handlePopup(t,dt.entities.dc_transformer_temp_90)),"none"===dt.entities.dc_transformer_temp_90?"st12":"st3 left-align",ks,(null===(lt=dt.entities)||void 0===lt?void 0:lt.dc_transformer_temp_90)?"":"none",Ae.state,(t=>this.handlePopup(t,dt.entities.energy_cost)),"none"===dt.entities.energy_cost?"st12":"st3 left-align",Qe,(null===(rt=dt.entities)||void 0===rt?void 0:rt.energy_cost)?"":"none",parseFloat(Pe.state).toFixed(2),Pe.attributes.unit_of_measurement||"",(null===(ht=dt.entities)||void 0===ht?void 0:ht.pv_total)?N($t||($t=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv_total)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0):N(Ot||(Ot=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,Vs||0),"none"!==dt.entities.pv1_power_186?N(zt||(zt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv1_power_186)),!1===qs?"st14":"st4",!1===dt.show_solar?"none":"",rs,parseFloat(Tt.state).toFixed(0)):N(Ut||(Ut=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv1_power_186?"none":"",rs,parseFloat(Tt.state).toFixed(0)),"none"!==dt.entities.pv2_power_187?N(Yt||(Yt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv2_power_187)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)):N(Qt||(Qt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv2_power_187||1===dt.solar.mppts?"none":"",rs,parseFloat(qt.state).toFixed(0)),"none"!==dt.entities.pv3_power_188?N(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv3_power_188)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)):N(Gt||(Gt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv3_power_188||1===dt.solar.mppts||2===dt.solar.mppts?"none":"",rs,parseFloat(fe.state).toFixed(0)),"none"!==dt.entities.pv4_power_189?N(Xt||(Xt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.pv4_power_189)),!1===qs?"st14":"st4",!1===dt.show_solar||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)):N(Kt||(Kt=e([''," W"])),!1===qs?"st14":"st4",!1===dt.show_solar||"none"===dt.entities.pv4_power_189||1===dt.solar.mppts||2===dt.solar.mppts||3===dt.solar.mppts?"none":"",rs,parseFloat(ue.state).toFixed(0)),"none"!==dt.entities.essential_power?N(Jt||(Jt=e(['\n '," W\n "])),(t=>this.handlePopup(t,dt.entities.essential_power)),!1===qs?"st14":"st4",Oe,Is||0):N(te||(te=e([''," W"])),!1===qs?"st14":"st4",Oe,Is||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(mt("errors.cardstyle"));if(!t.show_solar)throw Error(mt("errors.show_solar"));if(!t.battery)throw Error(mt("errors.battery.bat"));if(!t.battery.energy)throw new Error(mt("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(mt("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(mt("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(mt("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(mt("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(mt("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(mt("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(mt("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(mt("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(mt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(mt("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=ee({},wt,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:mt("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,Q=Math.max,W=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));Un[e]=new Date(zn.getTime()),Un[e].setHours(s),Un[e].setMinutes(n)}));const[Yn,Qn,Wn,Gn,Xn,Kn]=Un;function Jn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?mn.charge="none":mn.charge="both",mn.capacity=parseInt(t.capacity.state),mn.entityID=e}zn>=Kn||zn=Yn&&zn=Qn&&zn=Wn&&zn=Gn&&zn=Xn&&zn0?wn="off"===Re.state||!1===mn.show||parseInt(Pe.state)<=mn.capacity?me.battery.shutdown_soc:mn.capacity:on<0&&("off"===Re.state||!1===mn.show||parseInt(Pe.state)>=mn.capacity?wn=100:parseInt(Pe.state)0?qn=(parseInt(Pe.state)-wn)/100*me.battery.energy/on*60*60:on<0&&(qn=(wn-parseInt(Pe.state))/100*me.battery.energy/on*60*60*-1);const ti=new Date,ei=1e3*qn,si=new Date(ti.getTime()+ei),ni=si.getHours(),ii=si.getMinutes().toString().padStart(2,"0"),ai=ni.toString().padStart(2,"0");Tn="".concat(ai,":").concat(ii);const oi=Math.floor(qn/86400),li=Math.floor(qn%86400/3600),ri=Math.floor(qn%3600/60);oi>0&&(kn+="".concat(oi," days, ")),(li>0||oi>0)&&(kn+="".concat(li," hrs, ")),kn+="".concat(ri," min")}let bn=!!(-2<=parseInt(es.state)&&parseInt(es.state)<=2&&parseInt(Pe.state)>=99),Mn="",An="",Hn="",Zn=!1;Hn="sunsynk"!==me.inverter.model&&"lux"!==me.inverter.model?"sunsynk":me.inverter.model;let Ln=wt[Hn];for(const hi of Object.keys(Ln)){const di=Ln[hi],{states:ci,color:pi,message:vi}=di;if(ci.includes(je.state)){Mn=pi,An=vi,Zn=!0;break}}Zn||("none"!==(null===(N=me.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=me.entities)||void 0===D?void 0:D.inverter_status_59)?(Mn="transparent",An="Status"):(Mn="transparent",An=""));let En=(isNaN(parseFloat(be.state))?0:parseFloat(be.state))+(isNaN(parseFloat(we.state))?0:parseFloat(we.state)),Pn=(isNaN(parseFloat(Te.state))?0:parseFloat(Te.state))+(isNaN(parseFloat(qe.state))?0:parseFloat(qe.state)),Vn=0!=Pn?Math.min(Math.round(100*En/Pn),100):0,In=0!=En?Math.min(Math.round(100*Pn/En),100):0,Fn=dn+parseInt("".concat(on>0?on:0))+parseInt("".concat(xs<0?-1*xs:0)),Bn=pn+vn+parseInt("".concat(xs>0?xs:0))+parseInt("".concat(on<0?-1*on:0)),Cn=0!=Bn?Math.min(Math.round(100*Fn/Bn),100):0,Sn=0!=Fn?Math.min(Math.round(100*Bn/Fn),100):0,Nn=null===($=me.solar)||void 0===$?void 0:$.animation_speed;if(me&&me.solar&&me.solar.animation_speed){let _i=me.solar.animation_speed-(me.solar.animation_speed-1)*(dn/(me.solar.max_power||dn));Nn=_i>=1?_i:1}let Rn=null===(O=me.battery)||void 0===O?void 0:O.animation_speed;if(me&&me.battery&&me.battery.animation_speed){let yi=me.battery.animation_speed-(me.battery.animation_speed-1)*((on<0?-1*on:on)/(me.battery.max_power||(on<0?-1*on:on)));Rn=yi>=1?yi:1}let jn=null===(z=me.load)||void 0===z?void 0:z.animation_speed;if(me&&me.load&&me.load.animation_speed){let gi=me.load.animation_speed-(me.load.animation_speed-1)*(pn/(me.load.max_power||pn));jn=gi>=1?gi:1}let Dn=null===(U=me.load)||void 0===U?void 0:U.animation_speed;if(me&&me.load&&me.load.animation_speed){let xi=me.load.animation_speed-(me.load.animation_speed-1)*((parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))/(me.load.max_power||(parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))));Dn=xi>=1?xi:1}let $n=null===(Y=me.grid)||void 0===Y?void 0:Y.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let ui=me.grid.animation_speed-(me.grid.animation_speed-1)*((parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))/(me.grid.max_power||(parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))));$n=ui>=1?ui:1}let On=null===(Q=me.grid)||void 0===Q?void 0:Q.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let fi=me.grid.animation_speed-(me.grid.animation_speed-1)*(vn/(me.grid.max_power||vn));On=fi>=1?fi:1}return"full"===me.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),ws,ws,qs,Ts,bs,bs,!1===tn?"".concat(ln):"100%",Ns,!1===me.show_solar?"st12":"",Cs,bs,bs,qs,!1===js?"st12":"",ws,en,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",bs,!1===As?"st12":"",1===Is?"":"none",bs,!1===As?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",!1===js?"30":"143",ws,1===Ds?"":"none",!1===js?"376":"373",!1===js?"30":"143",ws,2===Ds?"":"none",!1===js?"413":"410",!1===js?"30":"143",ws,2===Ds?"":"none",qs,!1===js?"none":"",1===$s||2===$s?"":"st12",qs,!1===js?"none":"",2===$s?"":"st12",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,bs,en,An,1!==Ds&&2!==Ds||!0!==js?"":"none",ws,ut("common.essential"),0===Ds||!1===js?"none":"",ws,ut("common.essential"),!1===js?70:181,1===Ds?"":"none",ws,me.load.load1_name,!1===js?393:390,!1===js?59:172,2===Ds?"":"none",ws,me.load.load1_name,!1===js?429:426,!1===js?59:172,2===Ds?"":"none",ws,me.load.load2_name,2===$s?"238":"306",!1===ks||!1===js?"transparent":"".concat(ws),ut("common.daily_load"),0===Ds?"377":"306",0===Ds?71:93,!1===ks||!0===js?"transparent":"".concat(ws),ut("common.daily_load"),!1===Rs||!1===me.show_solar||"false"!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||"false"===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),!1===As?"311":"347",!1===As?"368":"253",!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===As?"311":"347",!1===As?"337":"222",!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),me.load.aux_name,!1===As?"none":"",bs,me.grid.nonessential_name,!1===As||0===Is||2===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load2_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,1===$s?53:14,!1===js||0===$s?"none":"",qs,me.load.aux_load1_name,!1===js||0===$s||1===$s?"none":"",qs,me.load.aux_load2_name,Mn,!0===js?"":"none",1===Ds||2===Ds?"":"st12",ws,!1===js?"":"none",1===Ds?"":"st12",ws,!1===js?"":"none",2===Ds?"":"st12",ws,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n/2,fs>0||0===fs?"transparent":"".concat(bs),$n/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On,!1===js?"st12":"",qs,!1===js||0===xs?"st12":"",xs<0?"transparent":"".concat(qs),Dn,!1===js||0===xs?"st12":"",xs>0?"transparent":"".concat(qs),Dn,!1===js?"st12":"",qs,bs,en,ws,0===pn?"transparent":"".concat(ws),jn,ws,en,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?"1":"0",Cs,parseInt(Pe.state)<=hn?1:0,Cs,!1===me.show_solar?"st12":"",Ns,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,"default"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"oven"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"boiler"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"pump"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"aircon"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,!1===As||2===Is||1===Is?"none":"",Ys,"default"===Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"===Qs&&"default"!=Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"!=Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,!1===As||0===Is||1===Is?"none":"",Qs,!1===As||0===Is||1===Is?"none":"",Ws,"default"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,!1===As||0===Is||2===Is?"none":"",Qs,1!==Ds&&2!==Ds||!1!==js?"none":"",ws,1!==Ds&&2!==Ds||!0!==js?"none":"",ws,1===Ds||2===Ds?"none":"",ws,(t=>this.handlePopup(t,me.entities.aux_connected_status)),"default"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"gen"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"inverter"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"oven"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"boiler"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"aircon"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"pump"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),!1===js||1===$s||2===$s?"none":"",Os,"on"===Zs||"1"===Zs?"aux-icon":"aux-off-icon",!1===js||0===$s?"none":"",zs,!1===js||1===$s||0===$s?"none":"",Us,"boiler"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"boiler"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,0===Ds||1===Ds?"none":"",!0===js?"350":"383",!0===js?"140":"5",Gs,0===Ds||1===Ds?"none":"",!0===js?"446":"420",!0===js?"140":"5",Xs,0===Ds||2===Ds?"none":"","336",!0===js?"140":"27",Gs,(t=>this.handlePopup(t,me.entities.use_timer_248)),"no"!=sn?"232":"249","on"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"232":"249","off"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"243":"260","on"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_on"),"no"!=sn?"243":"260","off"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_off"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,(t=>this.handlePopup(t,me.entities.priority_load_243)),"no"!=sn?"251":"268","off"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"251":"268","on"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"262":"280","on"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_load"),"no"!=sn?"262":"280","off"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_batt"),!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===$s?"238":"306",!1===ks||!1===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),0===Ds?"377":"306",0===Ds?"57":"80",!1===ks||!0===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===As?"311":"347",!1===As?"354":"239",!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===As?"311":"347",!1===As?"323":"209",!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(null===(W=me.entities)||void 0===W?void 0:W.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(At||(At=e([' '," W "])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),(null===(G=me.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(Zt||(Zt=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0),(null===(X=me.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.nonessential_power)),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0):j(Et||(Et=e([''," W "])),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0),(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(null===(K=me.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_power_166)),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs):j(Vt||(Vt=e([''," W "])),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs),(null===(J=me.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),(null===(tt=me.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),(null===(et=me.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),(null===(st=me.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),(null===(nt=me.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)):j($t||($t=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)),(null===(it=me.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)),(null===(at=me.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(ot=me.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Wt||(Wt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(lt=me.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load2)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)),(null===(rt=me.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(ht=me.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(dt=me.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load2)),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",!1===Js?"st14":"st4",bs,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",!1===Js?"st14":"st4",bs,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",!1===Js?"st14":"st4",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.inverter_power_175)),"none"===me.entities.inverter_power_175?"none":"",!1===Js?"st14":"st4",en,De.state,(t=>this.handlePopup(t,me.entities.grid_power_169)),"none"===me.entities.grid_power_169?"none":"",!1===Js?"st14":"st4",bs,$e.state,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(ct=me.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),4===(null===(pt=me.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=me.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(_t=me.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(yt=me.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(gt=me.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement||""):"lite"===me.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),ws,!1===me.show_solar?145.33:-.5,!1===me.show_solar?270.67:406,"".concat(!1===tn?!1===me.show_solar?"246px":"".concat(ln):!1===me.show_solar?"75%":"100%"),ws,Ns,!1===me.show_solar?"st12":"",Cs,bs,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",ws,1===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),2===Ds?"365":"415",2===Ds?"182.2":"282.1",!1===ks?"transparent":"".concat(ws),ut("common.daily_load"),!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===Rs||!1===me.show_solar||0!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||!1===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,ut("common.ratio"),1===Ds&&!0===me.show_solar?"":"none",ws,(null===(xt=me.load)||void 0===xt?void 0:xt.load1_name)?"".concat(me.load.load1_name):"",1===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(ft=me.load)||void 0===ft?void 0:ft.load1_name)?"".concat(me.load.load1_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(qt=me.load)||void 0===qt?void 0:qt.load2_name)?"".concat(me.load.load2_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(cs.state))?0:parseFloat(cs.state).toFixed(0),Mn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,ws,0===pn?"transparent":"".concat(ws),jn,ws,0===pn?"transparent":"".concat(ws),jn,1===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,"oven"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"pump"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,0===Ds||!1===me.show_solar?"none":"",Gs,0===Ds||1===Ds||!1===me.show_solar?"none":"",Xs,!1===me.show_solar?"st12":"",Ns,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?1:0,Cs,parseInt(Pe.state)<=hn?1:0,Cs,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,ws,en,(t=>this.handlePopup(t,me.entities.use_timer_248)),"on"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_off"),"on"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_on"),(t=>this.handlePopup(t,me.entities.priority_load_243)),"off"===ze.state&&!1!==an?"":"none",en,"on"===ze.state&&!1!==an?"":"none",en,"off"===ze.state&&!1!==an?"":"none",en,ut("common.priority_batt"),"on"===ze.state&&!1!==an?"":"none",en,ut("common.priority_load"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||0!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||!1===Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),Ks,(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===Ds?"365":"400.4",2===Ds?"168":"267.9",!1===ks?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",en,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",en,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(Tt=me.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(kt=me.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(xe=me.entities)||void 0===xe?void 0:xe.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(ue=me.entities)||void 0===ue?void 0:ue.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement||"",(null===(fe=me.entities)||void 0===fe?void 0:fe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(oe||(oe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),"none"!==me.entities.pv1_power_186?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(re||(re=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),"none"!==me.entities.pv2_power_187?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(de||(de=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),"none"!==me.entities.pv3_power_188?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),"none"!==me.entities.pv4_power_189?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),"none"!==me.entities.essential_power?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(ge||(ge=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=xe({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 5327772c..e9b9c021 100644 --- a/src/index.ts +++ b/src/index.ts @@ -918,45 +918,45 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities?.aux_load1 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj48.state)) ? parseFloat(stateObj48.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W`} ${config.entities?.aux_load2 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj49.state)) ? parseFloat(stateObj49.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> - ${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W - ` - : svg`${!isNaN(parseFloat(stateObj40.state)) ? parseFloat(stateObj40.state).toFixed(0) : '0'} W`} + ${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W + ` + : svg`${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W`} ${config.entities?.non_essential_load2 ? svg` this.handlePopup(e, config.entities.non_essential_load2)}> - ${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj41.state)) ? '0' : parseFloat(stateObj41.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj41.state)) ? parseFloat(stateObj41.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj41.state)) ? '0' : parseFloat(stateObj41.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj42.state)) ? parseFloat(stateObj42.state).toFixed(0) : '0'} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load2 ? svg` this.handlePopup(e, config.entities.essential_load2)}> - ${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W + ${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W ` - : svg`${!isNaN(parseFloat(stateObj45.state)) ? parseFloat(stateObj45.state).toFixed(0) : '0'} W`} - + : svg`${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W`} + this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V From 33933ae9608ff996e4558a71bcc7b8fd83c341ec Mon Sep 17 00:00:00 2001 From: slipx06 Date: Thu, 17 Aug 2023 19:12:06 +0200 Subject: [PATCH 25/40] chore: update error messages --- src/localize/languages/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 0f0615ff..1ac4eecb 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -29,8 +29,8 @@ "essential": "Essential" }, "errors": { - "cardstyle": "Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple", - "show_style": "Please include the show_solar attribute e.g. show_solar: yes", + "cardstyle": "Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite", + "show_style": "Please include the show_solar attribute e.g. show_solar: true", "battery": { "bat": "No battery attributes defined", "energy": "Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320", @@ -41,7 +41,7 @@ }, "solar": { "sol": "No solar attributes defined", - "mppts": "Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two", + "mppts": "Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2", "show_daily": "Please include the day_pv_energy_108 attribute and entity ID" }, "grid": { From 745f3ebb25f32c5d4531b9e0647fa7a122ce00a1 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Thu, 17 Aug 2023 20:43:54 +0200 Subject: [PATCH 26/40] feat: clicking additional loads shows more-info dialog for lite card --- src/index.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/index.ts b/src/index.ts index e9b9c021..98c67e09 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1073,13 +1073,9 @@ export class SunsynkPowerFlowCard extends LitElement { ${Ratiop}% Autarky ${localize('common.ratio')} - ${config.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W - ${config.load?.load1_name ? `${config.load.load1_name}` : ''} - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${config.load?.load2_name ? `${config.load.load2_name}` : ''} - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W - + @@ -1311,31 +1307,41 @@ export class SunsynkPowerFlowCard extends LitElement { ${total_pv || 0} W ` : svg`${total_pv || 0} W`} - ${config.entities.pv1_power_186 !== 'none' + ${config.entities?.pv1_power_186 ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> ${parseFloat(stateObj9.state).toFixed(0)} W ` : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} - ${config.entities.pv2_power_187 !== 'none' + ${config.entities?.pv2_power_187 ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> ${parseFloat(stateObj8.state).toFixed(0)} W ` : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} - ${config.entities.pv3_power_188 !== 'none' + ${config.entities?.pv3_power_188 ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> ${parseFloat(stateObj31.state).toFixed(0)} W ` : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} - ${config.entities.pv4_power_189 !== 'none' + ${config.entities?.pv4_power_189 ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> ${parseFloat(stateObj32.state).toFixed(0)} W ` : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} - ${config.entities.essential_power !== 'none' + ${config.entities?.essential_power ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential || 0} W ` : svg`${essential || 0} W`} + ${config.entities?.essential_load1 + ? svg` this.handlePopup(e, config.entities.essential_load1)}> + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ` + : svg`${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W`} + ${config.entities?.essential_load2 + ? svg` this.handlePopup(e, config.entities.essential_load2)}> + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ` + : svg`${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W`}
From 3eedda101217313de094d94d3705b3004af373bd Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 19:25:54 +0000 Subject: [PATCH 27/40] fix: issue when energy_cost is not set --- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index d6d6a2de..d6037f4f 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite, simple or full e.g. cardstyle: simple",show_style:"Please include the show_solar attribute e.g. show_solar: yes",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,Q=Math.max,W=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));Un[e]=new Date(zn.getTime()),Un[e].setHours(s),Un[e].setMinutes(n)}));const[Yn,Qn,Wn,Gn,Xn,Kn]=Un;function Jn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?mn.charge="none":mn.charge="both",mn.capacity=parseInt(t.capacity.state),mn.entityID=e}zn>=Kn||zn=Yn&&zn=Qn&&zn=Wn&&zn=Gn&&zn=Xn&&zn0?wn="off"===Re.state||!1===mn.show||parseInt(Pe.state)<=mn.capacity?me.battery.shutdown_soc:mn.capacity:on<0&&("off"===Re.state||!1===mn.show||parseInt(Pe.state)>=mn.capacity?wn=100:parseInt(Pe.state)0?qn=(parseInt(Pe.state)-wn)/100*me.battery.energy/on*60*60:on<0&&(qn=(wn-parseInt(Pe.state))/100*me.battery.energy/on*60*60*-1);const ti=new Date,ei=1e3*qn,si=new Date(ti.getTime()+ei),ni=si.getHours(),ii=si.getMinutes().toString().padStart(2,"0"),ai=ni.toString().padStart(2,"0");Tn="".concat(ai,":").concat(ii);const oi=Math.floor(qn/86400),li=Math.floor(qn%86400/3600),ri=Math.floor(qn%3600/60);oi>0&&(kn+="".concat(oi," days, ")),(li>0||oi>0)&&(kn+="".concat(li," hrs, ")),kn+="".concat(ri," min")}let bn=!!(-2<=parseInt(es.state)&&parseInt(es.state)<=2&&parseInt(Pe.state)>=99),Mn="",An="",Hn="",Zn=!1;Hn="sunsynk"!==me.inverter.model&&"lux"!==me.inverter.model?"sunsynk":me.inverter.model;let Ln=wt[Hn];for(const hi of Object.keys(Ln)){const di=Ln[hi],{states:ci,color:pi,message:vi}=di;if(ci.includes(je.state)){Mn=pi,An=vi,Zn=!0;break}}Zn||("none"!==(null===(N=me.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=me.entities)||void 0===D?void 0:D.inverter_status_59)?(Mn="transparent",An="Status"):(Mn="transparent",An=""));let En=(isNaN(parseFloat(be.state))?0:parseFloat(be.state))+(isNaN(parseFloat(we.state))?0:parseFloat(we.state)),Pn=(isNaN(parseFloat(Te.state))?0:parseFloat(Te.state))+(isNaN(parseFloat(qe.state))?0:parseFloat(qe.state)),Vn=0!=Pn?Math.min(Math.round(100*En/Pn),100):0,In=0!=En?Math.min(Math.round(100*Pn/En),100):0,Fn=dn+parseInt("".concat(on>0?on:0))+parseInt("".concat(xs<0?-1*xs:0)),Bn=pn+vn+parseInt("".concat(xs>0?xs:0))+parseInt("".concat(on<0?-1*on:0)),Cn=0!=Bn?Math.min(Math.round(100*Fn/Bn),100):0,Sn=0!=Fn?Math.min(Math.round(100*Bn/Fn),100):0,Nn=null===($=me.solar)||void 0===$?void 0:$.animation_speed;if(me&&me.solar&&me.solar.animation_speed){let _i=me.solar.animation_speed-(me.solar.animation_speed-1)*(dn/(me.solar.max_power||dn));Nn=_i>=1?_i:1}let Rn=null===(O=me.battery)||void 0===O?void 0:O.animation_speed;if(me&&me.battery&&me.battery.animation_speed){let yi=me.battery.animation_speed-(me.battery.animation_speed-1)*((on<0?-1*on:on)/(me.battery.max_power||(on<0?-1*on:on)));Rn=yi>=1?yi:1}let jn=null===(z=me.load)||void 0===z?void 0:z.animation_speed;if(me&&me.load&&me.load.animation_speed){let gi=me.load.animation_speed-(me.load.animation_speed-1)*(pn/(me.load.max_power||pn));jn=gi>=1?gi:1}let Dn=null===(U=me.load)||void 0===U?void 0:U.animation_speed;if(me&&me.load&&me.load.animation_speed){let xi=me.load.animation_speed-(me.load.animation_speed-1)*((parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))/(me.load.max_power||(parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))));Dn=xi>=1?xi:1}let $n=null===(Y=me.grid)||void 0===Y?void 0:Y.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let ui=me.grid.animation_speed-(me.grid.animation_speed-1)*((parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))/(me.grid.max_power||(parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))));$n=ui>=1?ui:1}let On=null===(Q=me.grid)||void 0===Q?void 0:Q.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let fi=me.grid.animation_speed-(me.grid.animation_speed-1)*(vn/(me.grid.max_power||vn));On=fi>=1?fi:1}return"full"===me.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n
\n
\n
\n "])),ws,ws,qs,Ts,bs,bs,!1===tn?"".concat(ln):"100%",Ns,!1===me.show_solar?"st12":"",Cs,bs,bs,qs,!1===js?"st12":"",ws,en,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",bs,!1===As?"st12":"",1===Is?"":"none",bs,!1===As?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",!1===js?"30":"143",ws,1===Ds?"":"none",!1===js?"376":"373",!1===js?"30":"143",ws,2===Ds?"":"none",!1===js?"413":"410",!1===js?"30":"143",ws,2===Ds?"":"none",qs,!1===js?"none":"",1===$s||2===$s?"":"st12",qs,!1===js?"none":"",2===$s?"":"st12",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,bs,en,An,1!==Ds&&2!==Ds||!0!==js?"":"none",ws,ut("common.essential"),0===Ds||!1===js?"none":"",ws,ut("common.essential"),!1===js?70:181,1===Ds?"":"none",ws,me.load.load1_name,!1===js?393:390,!1===js?59:172,2===Ds?"":"none",ws,me.load.load1_name,!1===js?429:426,!1===js?59:172,2===Ds?"":"none",ws,me.load.load2_name,2===$s?"238":"306",!1===ks||!1===js?"transparent":"".concat(ws),ut("common.daily_load"),0===Ds?"377":"306",0===Ds?71:93,!1===ks||!0===js?"transparent":"".concat(ws),ut("common.daily_load"),!1===Rs||!1===me.show_solar||"false"!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||"false"===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),!1===As?"311":"347",!1===As?"368":"253",!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===As?"311":"347",!1===As?"337":"222",!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),me.load.aux_name,!1===As?"none":"",bs,me.grid.nonessential_name,!1===As||0===Is||2===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load2_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,1===$s?53:14,!1===js||0===$s?"none":"",qs,me.load.aux_load1_name,!1===js||0===$s||1===$s?"none":"",qs,me.load.aux_load2_name,Mn,!0===js?"":"none",1===Ds||2===Ds?"":"st12",ws,!1===js?"":"none",1===Ds?"":"st12",ws,!1===js?"":"none",2===Ds?"":"st12",ws,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n/2,fs>0||0===fs?"transparent":"".concat(bs),$n/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On,!1===js?"st12":"",qs,!1===js||0===xs?"st12":"",xs<0?"transparent":"".concat(qs),Dn,!1===js||0===xs?"st12":"",xs>0?"transparent":"".concat(qs),Dn,!1===js?"st12":"",qs,bs,en,ws,0===pn?"transparent":"".concat(ws),jn,ws,en,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?"1":"0",Cs,parseInt(Pe.state)<=hn?1:0,Cs,!1===me.show_solar?"st12":"",Ns,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,"default"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"oven"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"boiler"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"pump"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"aircon"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,!1===As||2===Is||1===Is?"none":"",Ys,"default"===Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"===Qs&&"default"!=Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"!=Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,!1===As||0===Is||1===Is?"none":"",Qs,!1===As||0===Is||1===Is?"none":"",Ws,"default"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,!1===As||0===Is||2===Is?"none":"",Qs,1!==Ds&&2!==Ds||!1!==js?"none":"",ws,1!==Ds&&2!==Ds||!0!==js?"none":"",ws,1===Ds||2===Ds?"none":"",ws,(t=>this.handlePopup(t,me.entities.aux_connected_status)),"default"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"gen"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"inverter"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"oven"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"boiler"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"aircon"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"pump"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),!1===js||1===$s||2===$s?"none":"",Os,"on"===Zs||"1"===Zs?"aux-icon":"aux-off-icon",!1===js||0===$s?"none":"",zs,!1===js||1===$s||0===$s?"none":"",Us,"boiler"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"boiler"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,0===Ds||1===Ds?"none":"",!0===js?"350":"383",!0===js?"140":"5",Gs,0===Ds||1===Ds?"none":"",!0===js?"446":"420",!0===js?"140":"5",Xs,0===Ds||2===Ds?"none":"","336",!0===js?"140":"27",Gs,(t=>this.handlePopup(t,me.entities.use_timer_248)),"no"!=sn?"232":"249","on"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"232":"249","off"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"243":"260","on"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_on"),"no"!=sn?"243":"260","off"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_off"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,(t=>this.handlePopup(t,me.entities.priority_load_243)),"no"!=sn?"251":"268","off"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"251":"268","on"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"262":"280","on"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_load"),"no"!=sn?"262":"280","off"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_batt"),!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===$s?"238":"306",!1===ks||!1===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),0===Ds?"377":"306",0===Ds?"57":"80",!1===ks||!0===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===As?"311":"347",!1===As?"354":"239",!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===As?"311":"347",!1===As?"323":"209",!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(null===(W=me.entities)||void 0===W?void 0:W.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(At||(At=e([' '," W "])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),(null===(G=me.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(Zt||(Zt=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0),(null===(X=me.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.nonessential_power)),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0):j(Et||(Et=e([''," W "])),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0),(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(null===(K=me.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_power_166)),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs):j(Vt||(Vt=e([''," W "])),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs),(null===(J=me.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),(null===(tt=me.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),(null===(et=me.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),(null===(st=me.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),(null===(nt=me.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)):j($t||($t=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)),(null===(it=me.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)),(null===(at=me.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(ot=me.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Wt||(Wt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(lt=me.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load2)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)),(null===(rt=me.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(ht=me.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(dt=me.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load2)),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",!1===Js?"st14":"st4",bs,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",!1===Js?"st14":"st4",bs,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",!1===Js?"st14":"st4",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.inverter_power_175)),"none"===me.entities.inverter_power_175?"none":"",!1===Js?"st14":"st4",en,De.state,(t=>this.handlePopup(t,me.entities.grid_power_169)),"none"===me.entities.grid_power_169?"none":"",!1===Js?"st14":"st4",bs,$e.state,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(ct=me.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),4===(null===(pt=me.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=me.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(_t=me.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(yt=me.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(gt=me.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement||""):"lite"===me.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n ',"","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),ws,!1===me.show_solar?145.33:-.5,!1===me.show_solar?270.67:406,"".concat(!1===tn?!1===me.show_solar?"246px":"".concat(ln):!1===me.show_solar?"75%":"100%"),ws,Ns,!1===me.show_solar?"st12":"",Cs,bs,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",ws,1===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),2===Ds?"365":"415",2===Ds?"182.2":"282.1",!1===ks?"transparent":"".concat(ws),ut("common.daily_load"),!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===Rs||!1===me.show_solar||0!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||!1===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,ut("common.ratio"),1===Ds&&!0===me.show_solar?"":"none",ws,(null===(xt=me.load)||void 0===xt?void 0:xt.load1_name)?"".concat(me.load.load1_name):"",1===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(ft=me.load)||void 0===ft?void 0:ft.load1_name)?"".concat(me.load.load1_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(qt=me.load)||void 0===qt?void 0:qt.load2_name)?"".concat(me.load.load2_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(cs.state))?0:parseFloat(cs.state).toFixed(0),Mn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,ws,0===pn?"transparent":"".concat(ws),jn,ws,0===pn?"transparent":"".concat(ws),jn,1===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,"oven"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"pump"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,0===Ds||!1===me.show_solar?"none":"",Gs,0===Ds||1===Ds||!1===me.show_solar?"none":"",Xs,!1===me.show_solar?"st12":"",Ns,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?1:0,Cs,parseInt(Pe.state)<=hn?1:0,Cs,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,ws,en,(t=>this.handlePopup(t,me.entities.use_timer_248)),"on"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_off"),"on"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_on"),(t=>this.handlePopup(t,me.entities.priority_load_243)),"off"===ze.state&&!1!==an?"":"none",en,"on"===ze.state&&!1!==an?"":"none",en,"off"===ze.state&&!1!==an?"":"none",en,ut("common.priority_batt"),"on"===ze.state&&!1!==an?"":"none",en,ut("common.priority_load"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||0!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||!1===Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),Ks,(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===Ds?"365":"400.4",2===Ds?"168":"267.9",!1===ks?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",en,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",en,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(Tt=me.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(kt=me.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(xe=me.entities)||void 0===xe?void 0:xe.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(ue=me.entities)||void 0===ue?void 0:ue.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement||"",(null===(fe=me.entities)||void 0===fe?void 0:fe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(oe||(oe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),"none"!==me.entities.pv1_power_186?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(re||(re=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),"none"!==me.entities.pv2_power_187?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(de||(de=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),"none"!==me.entities.pv3_power_188?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),"none"!==me.entities.pv4_power_189?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),"none"!==me.entities.essential_power?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(ge||(ge=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=xe({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,Q=Math.max,W=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));Un[e]=new Date(zn.getTime()),Un[e].setHours(s),Un[e].setMinutes(n)}));const[Yn,Qn,Wn,Gn,Xn,Kn]=Un;function Jn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?mn.charge="none":mn.charge="both",mn.capacity=parseInt(t.capacity.state),mn.entityID=e}zn>=Kn||zn=Yn&&zn=Qn&&zn=Wn&&zn=Gn&&zn=Xn&&zn0?wn="off"===Re.state||!1===mn.show||parseInt(Pe.state)<=mn.capacity?me.battery.shutdown_soc:mn.capacity:on<0&&("off"===Re.state||!1===mn.show||parseInt(Pe.state)>=mn.capacity?wn=100:parseInt(Pe.state)0?qn=(parseInt(Pe.state)-wn)/100*me.battery.energy/on*60*60:on<0&&(qn=(wn-parseInt(Pe.state))/100*me.battery.energy/on*60*60*-1);const ti=new Date,ei=1e3*qn,si=new Date(ti.getTime()+ei),ni=si.getHours(),ii=si.getMinutes().toString().padStart(2,"0"),ai=ni.toString().padStart(2,"0");Tn="".concat(ai,":").concat(ii);const oi=Math.floor(qn/86400),li=Math.floor(qn%86400/3600),ri=Math.floor(qn%3600/60);oi>0&&(kn+="".concat(oi," days, ")),(li>0||oi>0)&&(kn+="".concat(li," hrs, ")),kn+="".concat(ri," min")}let bn=!!(-2<=parseInt(es.state)&&parseInt(es.state)<=2&&parseInt(Pe.state)>=99),Mn="",An="",Hn="",Zn=!1;Hn="sunsynk"!==me.inverter.model&&"lux"!==me.inverter.model?"sunsynk":me.inverter.model;let Ln=wt[Hn];for(const hi of Object.keys(Ln)){const di=Ln[hi],{states:ci,color:pi,message:vi}=di;if(ci.includes(je.state)){Mn=pi,An=vi,Zn=!0;break}}Zn||("none"!==(null===(N=me.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=me.entities)||void 0===D?void 0:D.inverter_status_59)?(Mn="transparent",An="Status"):(Mn="transparent",An=""));let En=(isNaN(parseFloat(be.state))?0:parseFloat(be.state))+(isNaN(parseFloat(we.state))?0:parseFloat(we.state)),Pn=(isNaN(parseFloat(Te.state))?0:parseFloat(Te.state))+(isNaN(parseFloat(qe.state))?0:parseFloat(qe.state)),Vn=0!=Pn?Math.min(Math.round(100*En/Pn),100):0,In=0!=En?Math.min(Math.round(100*Pn/En),100):0,Fn=dn+parseInt("".concat(on>0?on:0))+parseInt("".concat(xs<0?-1*xs:0)),Bn=pn+vn+parseInt("".concat(xs>0?xs:0))+parseInt("".concat(on<0?-1*on:0)),Cn=0!=Bn?Math.min(Math.round(100*Fn/Bn),100):0,Sn=0!=Fn?Math.min(Math.round(100*Bn/Fn),100):0,Nn=null===($=me.solar)||void 0===$?void 0:$.animation_speed;if(me&&me.solar&&me.solar.animation_speed){let _i=me.solar.animation_speed-(me.solar.animation_speed-1)*(dn/(me.solar.max_power||dn));Nn=_i>=1?_i:1}let Rn=null===(O=me.battery)||void 0===O?void 0:O.animation_speed;if(me&&me.battery&&me.battery.animation_speed){let yi=me.battery.animation_speed-(me.battery.animation_speed-1)*((on<0?-1*on:on)/(me.battery.max_power||(on<0?-1*on:on)));Rn=yi>=1?yi:1}let jn=null===(z=me.load)||void 0===z?void 0:z.animation_speed;if(me&&me.load&&me.load.animation_speed){let gi=me.load.animation_speed-(me.load.animation_speed-1)*(pn/(me.load.max_power||pn));jn=gi>=1?gi:1}let Dn=null===(U=me.load)||void 0===U?void 0:U.animation_speed;if(me&&me.load&&me.load.animation_speed){let xi=me.load.animation_speed-(me.load.animation_speed-1)*((parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))/(me.load.max_power||(parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))));Dn=xi>=1?xi:1}let $n=null===(Y=me.grid)||void 0===Y?void 0:Y.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let ui=me.grid.animation_speed-(me.grid.animation_speed-1)*((parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))/(me.grid.max_power||(parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))));$n=ui>=1?ui:1}let On=null===(Q=me.grid)||void 0===Q?void 0:Q.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let fi=me.grid.animation_speed-(me.grid.animation_speed-1)*(vn/(me.grid.max_power||vn));On=fi>=1?fi:1}return"full"===me.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),ws,ws,qs,Ts,bs,bs,!1===tn?"".concat(ln):"100%",Ns,!1===me.show_solar?"st12":"",Cs,bs,bs,qs,!1===js?"st12":"",ws,en,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",bs,!1===As?"st12":"",1===Is?"":"none",bs,!1===As?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",!1===js?"30":"143",ws,1===Ds?"":"none",!1===js?"376":"373",!1===js?"30":"143",ws,2===Ds?"":"none",!1===js?"413":"410",!1===js?"30":"143",ws,2===Ds?"":"none",qs,!1===js?"none":"",1===$s||2===$s?"":"st12",qs,!1===js?"none":"",2===$s?"":"st12",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,bs,en,An,1!==Ds&&2!==Ds||!0!==js?"":"none",ws,ut("common.essential"),0===Ds||!1===js?"none":"",ws,ut("common.essential"),!1===js?70:181,1===Ds?"":"none",ws,me.load.load1_name,!1===js?393:390,!1===js?59:172,2===Ds?"":"none",ws,me.load.load1_name,!1===js?429:426,!1===js?59:172,2===Ds?"":"none",ws,me.load.load2_name,2===$s?"238":"306",!1===ks||!1===js?"transparent":"".concat(ws),ut("common.daily_load"),0===Ds?"377":"306",0===Ds?71:93,!1===ks||!0===js?"transparent":"".concat(ws),ut("common.daily_load"),!1===Rs||!1===me.show_solar||"false"!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||"false"===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),!1===As?"311":"347",!1===As?"368":"253",!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===As?"311":"347",!1===As?"337":"222",!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),me.load.aux_name,!1===As?"none":"",bs,me.grid.nonessential_name,!1===As||0===Is||2===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load2_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,1===$s?53:14,!1===js||0===$s?"none":"",qs,me.load.aux_load1_name,!1===js||0===$s||1===$s?"none":"",qs,me.load.aux_load2_name,Mn,!0===js?"":"none",1===Ds||2===Ds?"":"st12",ws,!1===js?"":"none",1===Ds?"":"st12",ws,!1===js?"":"none",2===Ds?"":"st12",ws,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n/2,fs>0||0===fs?"transparent":"".concat(bs),$n/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On,!1===js?"st12":"",qs,!1===js||0===xs?"st12":"",xs<0?"transparent":"".concat(qs),Dn,!1===js||0===xs?"st12":"",xs>0?"transparent":"".concat(qs),Dn,!1===js?"st12":"",qs,bs,en,ws,0===pn?"transparent":"".concat(ws),jn,ws,en,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?"1":"0",Cs,parseInt(Pe.state)<=hn?1:0,Cs,!1===me.show_solar?"st12":"",Ns,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,"default"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"oven"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"boiler"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"pump"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"aircon"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,!1===As||2===Is||1===Is?"none":"",Ys,"default"===Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"===Qs&&"default"!=Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"!=Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,!1===As||0===Is||1===Is?"none":"",Qs,!1===As||0===Is||1===Is?"none":"",Ws,"default"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,!1===As||0===Is||2===Is?"none":"",Qs,1!==Ds&&2!==Ds||!1!==js?"none":"",ws,1!==Ds&&2!==Ds||!0!==js?"none":"",ws,1===Ds||2===Ds?"none":"",ws,(t=>this.handlePopup(t,me.entities.aux_connected_status)),"default"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"gen"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"inverter"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"oven"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"boiler"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"aircon"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"pump"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),!1===js||1===$s||2===$s?"none":"",Os,"on"===Zs||"1"===Zs?"aux-icon":"aux-off-icon",!1===js||0===$s?"none":"",zs,!1===js||1===$s||0===$s?"none":"",Us,"boiler"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"boiler"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,0===Ds||1===Ds?"none":"",!0===js?"350":"383",!0===js?"140":"5",Gs,0===Ds||1===Ds?"none":"",!0===js?"446":"420",!0===js?"140":"5",Xs,0===Ds||2===Ds?"none":"","336",!0===js?"140":"27",Gs,(t=>this.handlePopup(t,me.entities.use_timer_248)),"no"!=sn?"232":"249","on"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"232":"249","off"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"243":"260","on"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_on"),"no"!=sn?"243":"260","off"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_off"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,(t=>this.handlePopup(t,me.entities.priority_load_243)),"no"!=sn?"251":"268","off"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"251":"268","on"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"262":"280","on"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_load"),"no"!=sn?"262":"280","off"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_batt"),!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===$s?"238":"306",!1===ks||!1===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),0===Ds?"377":"306",0===Ds?"57":"80",!1===ks||!0===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===As?"311":"347",!1===As?"354":"239",!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===As?"311":"347",!1===As?"323":"209",!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(null===(W=me.entities)||void 0===W?void 0:W.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(At||(At=e([' '," W "])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),(null===(G=me.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(Zt||(Zt=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0),(null===(X=me.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.nonessential_power)),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0):j(Et||(Et=e([''," W "])),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0),(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(null===(K=me.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_power_166)),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs):j(Vt||(Vt=e([''," W "])),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs),(null===(J=me.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),(null===(tt=me.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),(null===(et=me.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),(null===(st=me.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),(null===(nt=me.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)):j($t||($t=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)),(null===(it=me.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)),(null===(at=me.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(ot=me.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Wt||(Wt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(lt=me.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load2)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)),(null===(rt=me.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(ht=me.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(dt=me.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load2)),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",!1===Js?"st14":"st4",bs,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",!1===Js?"st14":"st4",bs,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",!1===Js?"st14":"st4",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.inverter_power_175)),"none"===me.entities.inverter_power_175?"none":"",!1===Js?"st14":"st4",en,De.state,(t=>this.handlePopup(t,me.entities.grid_power_169)),"none"===me.entities.grid_power_169?"none":"",!1===Js?"st14":"st4",bs,$e.state,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(ct=me.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),4===(null===(pt=me.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=me.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(_t=me.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(yt=me.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(gt=me.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement):"lite"===me.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),ws,!1===me.show_solar?145.33:-.5,!1===me.show_solar?270.67:406,"".concat(!1===tn?!1===me.show_solar?"246px":"".concat(ln):!1===me.show_solar?"75%":"100%"),ws,Ns,!1===me.show_solar?"st12":"",Cs,bs,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",ws,1===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),2===Ds?"365":"415",2===Ds?"182.2":"282.1",!1===ks?"transparent":"".concat(ws),ut("common.daily_load"),!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===Rs||!1===me.show_solar||0!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||!1===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,ut("common.ratio"),1===Ds&&!0===me.show_solar?"":"none",ws,(null===(xt=me.load)||void 0===xt?void 0:xt.load1_name)?"".concat(me.load.load1_name):"",1===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(ft=me.load)||void 0===ft?void 0:ft.load1_name)?"".concat(me.load.load1_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(qt=me.load)||void 0===qt?void 0:qt.load2_name)?"".concat(me.load.load2_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(cs.state))?0:parseFloat(cs.state).toFixed(0),Mn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,ws,0===pn?"transparent":"".concat(ws),jn,ws,0===pn?"transparent":"".concat(ws),jn,1===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,"oven"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"pump"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,0===Ds||!1===me.show_solar?"none":"",Gs,0===Ds||1===Ds||!1===me.show_solar?"none":"",Xs,!1===me.show_solar?"st12":"",Ns,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?1:0,Cs,parseInt(Pe.state)<=hn?1:0,Cs,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,ws,en,(t=>this.handlePopup(t,me.entities.use_timer_248)),"on"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_off"),"on"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_on"),(t=>this.handlePopup(t,me.entities.priority_load_243)),"off"===ze.state&&!1!==an?"":"none",en,"on"===ze.state&&!1!==an?"":"none",en,"off"===ze.state&&!1!==an?"":"none",en,ut("common.priority_batt"),"on"===ze.state&&!1!==an?"":"none",en,ut("common.priority_load"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||0!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||!1===Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),Ks,(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===Ds?"365":"400.4",2===Ds?"168":"267.9",!1===ks?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",en,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",en,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(Tt=me.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(kt=me.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(xe=me.entities)||void 0===xe?void 0:xe.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(ue=me.entities)||void 0===ue?void 0:ue.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement,(null===(fe=me.entities)||void 0===fe?void 0:fe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(oe||(oe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),"none"!==me.entities.pv1_power_186?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(re||(re=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),"none"!==me.entities.pv2_power_187?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(de||(de=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),"none"!==me.entities.pv3_power_188?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),"none"!==me.entities.pv4_power_189?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),"none"!==me.entities.essential_power?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(ge||(ge=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=xe({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index e9b9c021..96070610 100644 --- a/src/index.ts +++ b/src/index.ts @@ -124,7 +124,7 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj40 = this.hass.states[config.entities.non_essential_load1] || { state: '0' }; const stateObj41 = this.hass.states[config.entities.non_essential_load2] || { state: '0' }; const stateObj42 = this.hass.states[config.entities.essential_load1] || { state: '0' }; - const stateObj43 = this.hass.states[config.entities.energy_cost] || { state: '' }; + const stateObj43 = this.hass.states[config.entities.energy_cost] || { state: '', attributes: { unit_of_measurement: '' } }; const stateObj44 = this.hass.states[config.entities.solar_sell_247] || { state: 'undefined' }; const stateObj45 = this.hass.states[config.entities.essential_load2] || { state: '0' }; const stateObj46 = this.hass.states[config.entities.pv_total] || { state: '0' }; @@ -1021,7 +1021,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || ''} + ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement}
@@ -1304,7 +1304,7 @@ export class SunsynkPowerFlowCard extends LitElement { DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)}${stateObj43.attributes.unit_of_measurement || ''} + ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement} ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> From 4db0358f3ef57f36984ef1975d6cd1af8bc86b87 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 19:28:04 +0000 Subject: [PATCH 28/40] chore: rebuild after changes --- dist/sunsynk-power-flow-card.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index d6037f4f..9b2f2b5e 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;u[x]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:u}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const m=window,w=m.trustedTypes,q=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=Q.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=w?w.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new Q(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=W(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class W{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=W.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=w?w.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=W.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new W(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,Q=Math.max,W=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));Un[e]=new Date(zn.getTime()),Un[e].setHours(s),Un[e].setMinutes(n)}));const[Yn,Qn,Wn,Gn,Xn,Kn]=Un;function Jn(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?mn.charge="none":mn.charge="both",mn.capacity=parseInt(t.capacity.state),mn.entityID=e}zn>=Kn||zn=Yn&&zn=Qn&&zn=Wn&&zn=Gn&&zn=Xn&&zn0?wn="off"===Re.state||!1===mn.show||parseInt(Pe.state)<=mn.capacity?me.battery.shutdown_soc:mn.capacity:on<0&&("off"===Re.state||!1===mn.show||parseInt(Pe.state)>=mn.capacity?wn=100:parseInt(Pe.state)0?qn=(parseInt(Pe.state)-wn)/100*me.battery.energy/on*60*60:on<0&&(qn=(wn-parseInt(Pe.state))/100*me.battery.energy/on*60*60*-1);const ti=new Date,ei=1e3*qn,si=new Date(ti.getTime()+ei),ni=si.getHours(),ii=si.getMinutes().toString().padStart(2,"0"),ai=ni.toString().padStart(2,"0");Tn="".concat(ai,":").concat(ii);const oi=Math.floor(qn/86400),li=Math.floor(qn%86400/3600),ri=Math.floor(qn%3600/60);oi>0&&(kn+="".concat(oi," days, ")),(li>0||oi>0)&&(kn+="".concat(li," hrs, ")),kn+="".concat(ri," min")}let bn=!!(-2<=parseInt(es.state)&&parseInt(es.state)<=2&&parseInt(Pe.state)>=99),Mn="",An="",Hn="",Zn=!1;Hn="sunsynk"!==me.inverter.model&&"lux"!==me.inverter.model?"sunsynk":me.inverter.model;let Ln=wt[Hn];for(const hi of Object.keys(Ln)){const di=Ln[hi],{states:ci,color:pi,message:vi}=di;if(ci.includes(je.state)){Mn=pi,An=vi,Zn=!0;break}}Zn||("none"!==(null===(N=me.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=me.entities)||void 0===D?void 0:D.inverter_status_59)?(Mn="transparent",An="Status"):(Mn="transparent",An=""));let En=(isNaN(parseFloat(be.state))?0:parseFloat(be.state))+(isNaN(parseFloat(we.state))?0:parseFloat(we.state)),Pn=(isNaN(parseFloat(Te.state))?0:parseFloat(Te.state))+(isNaN(parseFloat(qe.state))?0:parseFloat(qe.state)),Vn=0!=Pn?Math.min(Math.round(100*En/Pn),100):0,In=0!=En?Math.min(Math.round(100*Pn/En),100):0,Fn=dn+parseInt("".concat(on>0?on:0))+parseInt("".concat(xs<0?-1*xs:0)),Bn=pn+vn+parseInt("".concat(xs>0?xs:0))+parseInt("".concat(on<0?-1*on:0)),Cn=0!=Bn?Math.min(Math.round(100*Fn/Bn),100):0,Sn=0!=Fn?Math.min(Math.round(100*Bn/Fn),100):0,Nn=null===($=me.solar)||void 0===$?void 0:$.animation_speed;if(me&&me.solar&&me.solar.animation_speed){let _i=me.solar.animation_speed-(me.solar.animation_speed-1)*(dn/(me.solar.max_power||dn));Nn=_i>=1?_i:1}let Rn=null===(O=me.battery)||void 0===O?void 0:O.animation_speed;if(me&&me.battery&&me.battery.animation_speed){let yi=me.battery.animation_speed-(me.battery.animation_speed-1)*((on<0?-1*on:on)/(me.battery.max_power||(on<0?-1*on:on)));Rn=yi>=1?yi:1}let jn=null===(z=me.load)||void 0===z?void 0:z.animation_speed;if(me&&me.load&&me.load.animation_speed){let gi=me.load.animation_speed-(me.load.animation_speed-1)*(pn/(me.load.max_power||pn));jn=gi>=1?gi:1}let Dn=null===(U=me.load)||void 0===U?void 0:U.animation_speed;if(me&&me.load&&me.load.animation_speed){let xi=me.load.animation_speed-(me.load.animation_speed-1)*((parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))/(me.load.max_power||(parseInt(Oe.state)<0?-1*parseInt(Oe.state):parseInt(Oe.state))));Dn=xi>=1?xi:1}let $n=null===(Y=me.grid)||void 0===Y?void 0:Y.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let ui=me.grid.animation_speed-(me.grid.animation_speed-1)*((parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))/(me.grid.max_power||(parseInt(Fe.state)<0?-1*parseInt(Fe.state):parseInt(Fe.state))));$n=ui>=1?ui:1}let On=null===(Q=me.grid)||void 0===Q?void 0:Q.animation_speed;if(me&&me.grid&&me.grid.animation_speed){let fi=me.grid.animation_speed-(me.grid.animation_speed-1)*(vn/(me.grid.max_power||vn));On=fi>=1?fi:1}return"full"===me.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),ws,ws,qs,Ts,bs,bs,!1===tn?"".concat(ln):"100%",Ns,!1===me.show_solar?"st12":"",Cs,bs,bs,qs,!1===js?"st12":"",ws,en,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",bs,!1===As?"st12":"",1===Is?"":"none",bs,!1===As?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",2===Is?"":"none",bs,!1===As||1===Is?"st12":"",!1===js?"30":"143",ws,1===Ds?"":"none",!1===js?"376":"373",!1===js?"30":"143",ws,2===Ds?"":"none",!1===js?"413":"410",!1===js?"30":"143",ws,2===Ds?"":"none",qs,!1===js?"none":"",1===$s||2===$s?"":"st12",qs,!1===js?"none":"",2===$s?"":"st12",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,bs,en,An,1!==Ds&&2!==Ds||!0!==js?"":"none",ws,ut("common.essential"),0===Ds||!1===js?"none":"",ws,ut("common.essential"),!1===js?70:181,1===Ds?"":"none",ws,me.load.load1_name,!1===js?393:390,!1===js?59:172,2===Ds?"":"none",ws,me.load.load1_name,!1===js?429:426,!1===js?59:172,2===Ds?"":"none",ws,me.load.load2_name,2===$s?"238":"306",!1===ks||!1===js?"transparent":"".concat(ws),ut("common.daily_load"),0===Ds?"377":"306",0===Ds?71:93,!1===ks||!0===js?"transparent":"".concat(ws),ut("common.daily_load"),!1===Rs||!1===me.show_solar||"false"!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||"false"===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),!1===As?"311":"347",!1===As?"368":"253",!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===As?"311":"347",!1===As?"337":"222",!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),me.load.aux_name,!1===As?"none":"",bs,me.grid.nonessential_name,!1===As||0===Is||2===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load1_name,!1===As||0===Is||1===Is?"none":"",bs,me.grid.load2_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,1===$s?53:14,!1===js||0===$s?"none":"",qs,me.load.aux_load1_name,!1===js||0===$s||1===$s?"none":"",qs,me.load.aux_load2_name,Mn,!0===js?"":"none",1===Ds||2===Ds?"":"st12",ws,!1===js?"":"none",1===Ds?"":"st12",ws,!1===js?"":"none",2===Ds?"":"st12",ws,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n/2,fs>0||0===fs?"transparent":"".concat(bs),$n/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On/2,bs,!1===As?"st12":"",!1===As?"st12":"",vn<=0?"transparent":"".concat(bs),On,!1===js?"st12":"",qs,!1===js||0===xs?"st12":"",xs<0?"transparent":"".concat(qs),Dn,!1===js||0===xs?"st12":"",xs>0?"transparent":"".concat(qs),Dn,!1===js?"st12":"",qs,bs,en,ws,0===pn?"transparent":"".concat(ws),jn,ws,en,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?"1":"0",Cs,parseInt(Pe.state)<=hn?1:0,Cs,!1===me.show_solar?"st12":"",Ns,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,"default"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"oven"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"boiler"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"pump"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,"aircon"===Ys?"1":"0",!1===As||2===Is||1===Is?"none":"",bs,!1===As||2===Is||1===Is?"none":"",Ys,"default"===Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"===Qs&&"default"!=Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"default"!=Qs&&"default"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"boiler"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"pump"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"oven"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,"aircon"===Ws?"1":"0",!1===As||0===Is||1===Is?"none":"",bs,!1===As||0===Is||1===Is?"none":"",Qs,!1===As||0===Is||1===Is?"none":"",Ws,"default"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"boiler"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"pump"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"oven"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,"aircon"===Qs?"1":"0",!1===As||0===Is||2===Is?"none":"",bs,!1===As||0===Is||2===Is?"none":"",Qs,1!==Ds&&2!==Ds||!1!==js?"none":"",ws,1!==Ds&&2!==Ds||!0!==js?"none":"",ws,1===Ds||2===Ds?"none":"",ws,(t=>this.handlePopup(t,me.entities.aux_connected_status)),"default"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"gen"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"inverter"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"oven"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"boiler"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"aircon"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),"pump"===Os?"":"st12",!1===js||1===$s||2===$s?"none":"","".concat("on"===Zs||"1"===Zs?qs:Ts),!1===js||1===$s||2===$s?"none":"",Os,"on"===Zs||"1"===Zs?"aux-icon":"aux-off-icon",!1===js||0===$s?"none":"",zs,!1===js||1===$s||0===$s?"none":"",Us,"boiler"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"boiler"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"boiler"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"aircon"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"aircon"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"pump"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,"pump"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",!1===js||0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Xs&&2===Ds&&!1===js?"1":"0",0===Ds||1===Ds?"none":"",ws,"oven"===Gs&&1===Ds&&!1===js?"1":"0",0===Ds||2===Ds?"none":"",ws,"oven"===Gs&&1===Ds?"1":"0",!1===js||0===Ds||2===Ds?"none":"",ws,0===Ds||1===Ds?"none":"",!0===js?"350":"383",!0===js?"140":"5",Gs,0===Ds||1===Ds?"none":"",!0===js?"446":"420",!0===js?"140":"5",Xs,0===Ds||2===Ds?"none":"","336",!0===js?"140":"27",Gs,(t=>this.handlePopup(t,me.entities.use_timer_248)),"no"!=sn?"232":"249","on"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"232":"249","off"==Ue.state&&"no"!==nn?"":"none",en,"no"!=sn?"243":"260","on"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_on"),"no"!=sn?"243":"260","off"==Ue.state&&"no"!==nn?"":"none",en,ut("common.timer_off"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"none"!==me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,(t=>this.handlePopup(t,me.entities.priority_load_243)),"no"!=sn?"251":"268","off"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"251":"268","on"===ze.state&&"no"!==an?"":"none",en,"no"!=sn?"262":"280","on"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_load"),"no"!=sn?"262":"280","off"===ze.state&&"no"!==an?"":"none",en,ut("common.priority_batt"),!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,"no"!=sn?"232":"249",!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||"false"!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===$s?"238":"306",!1===ks||!1===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),0===Ds?"377":"306",0===Ds?"57":"80",!1===ks||!0===js?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===As?"311":"347",!1===As?"354":"239",!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===As?"311":"347",!1===As?"323":"209",!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(null===(W=me.entities)||void 0===W?void 0:W.pv_total)?j(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(At||(At=e([' '," W "])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),(null===(G=me.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(Zt||(Zt=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0),(null===(X=me.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.nonessential_power)),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0):j(Et||(Et=e([''," W "])),!1===As?"none":"",!1===Js?"st14":"st4",bs,vn||0),(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(null===(K=me.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_power_166)),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs):j(Vt||(Vt=e([''," W "])),!1===Js?"st14":"st4",!1===js?"none":"",qs,xs<0?-1*xs:xs),(null===(J=me.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),(null===(tt=me.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),(null===(et=me.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),(null===(st=me.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),(null===(nt=me.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)):j($t||($t=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s?"none":"",qs,isNaN(parseFloat(_s.state))?"0":parseFloat(_s.state).toFixed(0)),(null===(it=me.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.aux_load1)),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===Js?"st14":"st4",!1===js||0===$s||1===$s?"none":"",qs,isNaN(parseFloat(ys.state))?"0":parseFloat(ys.state).toFixed(0)),(null===(at=me.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===As||0===Is||2===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(ot=me.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Qt||(Qt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load1)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)):j(Wt||(Wt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(os.state))?"0":parseFloat(os.state).toFixed(0)),(null===(lt=me.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.non_essential_load2)),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===As||0===Is||1===Is?"none":"",bs,isNaN(parseFloat(ls.state))?"0":parseFloat(ls.state).toFixed(0)),(null===(rt=me.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===js?"47":"158",1===Ds?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(ht=me.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load1)),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===js?"394":"391",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(rs.state))?"0":parseFloat(rs.state).toFixed(0)),(null===(dt=me.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_load2)),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===js?"430":"427",!1===js?"42":"154",2===Ds?"":"none",ws,isNaN(parseFloat(cs.state))?"0":parseFloat(cs.state).toFixed(0)),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",!1===Js?"st14":"st4",bs,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",!1===Js?"st14":"st4",bs,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",!1===Js?"st14":"st4",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.inverter_power_175)),"none"===me.entities.inverter_power_175?"none":"",!1===Js?"st14":"st4",en,De.state,(t=>this.handlePopup(t,me.entities.grid_power_169)),"none"===me.entities.grid_power_169?"none":"",!1===Js?"st14":"st4",bs,$e.state,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(ct=me.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),4===(null===(pt=me.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=me.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(_t=me.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(yt=me.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(gt=me.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement):"lite"===me.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ',' W\n ','\n ',' W\n ','\n ',' W\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),ws,!1===me.show_solar?145.33:-.5,!1===me.show_solar?270.67:406,"".concat(!1===tn?!1===me.show_solar?"246px":"".concat(ln):!1===me.show_solar?"75%":"100%"),ws,Ns,!1===me.show_solar?"st12":"",Cs,bs,Ns,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",ws,1===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",ws,2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",0===me.battery.energy||!0===bn||0===on?"transparent":"".concat(Cs),kn,0===me.battery.energy||on<=0||!0===bn?"transparent":"".concat(Cs),ut("common.runtime_to"),wn,Tn,0===me.battery.energy||on>=0||!0===bn?"transparent":"".concat(Cs),ut("common.to"),wn,ut("common.charge"),Tn,0===me.battery.energy||!1===bn?"transparent":"".concat(Cs),ut("common.battery_floating"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_charge"),!1===Ss?"transparent":"".concat(Cs),ut("common.daily_discharge"),2===Ds?"365":"415",2===Ds?"182.2":"282.1",!1===ks?"transparent":"".concat(ws),ut("common.daily_load"),!1===Fs?"transparent":"".concat(bs),ut("common.daily_grid_buy"),!1===Bs?"transparent":"".concat(bs),ut("common.daily_grid_sell"),!1===Rs||!1===me.show_solar||0!=Ks?"transparent":"".concat(Ns),ut("common.daily_solar"),!1===Rs||!1===me.show_solar||!1===Ks?"transparent":"".concat(Ns),ut("common.daily_solar_left"),!1===me.show_solar?"none":"",Ns,me.solar.pv1_name,!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,me.solar.pv2_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,me.solar.pv3_name,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,me.solar.pv4_name,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,Vn,"no"===sn?"none":"","energy"===sn?"st4 st8 left-align":"st12",en,In,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Cn,"no"===sn?"none":"","power"===sn?"st4 st8 left-align":"st12",en,Sn,"no"===sn?"none":"",en,"no"===sn?"none":"",en,ut("common.ratio"),1===Ds&&!0===me.show_solar?"":"none",ws,(null===(xt=me.load)||void 0===xt?void 0:xt.load1_name)?"".concat(me.load.load1_name):"",1===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(ft=me.load)||void 0===ft?void 0:ft.load1_name)?"".concat(me.load.load1_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(rs.state))?0:parseFloat(rs.state).toFixed(0),2===Ds&&!0===me.show_solar?"":"none",ws,(null===(qt=me.load)||void 0===qt?void 0:qt.load2_name)?"".concat(me.load.load2_name):"",2===Ds&&!0===me.show_solar?"":"none",!1===Js?"st14":"st4",ws,isNaN(parseFloat(cs.state))?0:parseFloat(cs.state).toFixed(0),Mn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",parseInt(Le.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts?"st12":"",parseInt(Ze.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"st12":"",parseInt(Xe.state)<=0?"transparent":"".concat(Ns),Nn,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",Ns,!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"st12":"",parseInt(Ke.state)<=0?"transparent":"".concat(Ns),Nn,Cs,on<0||0===on?"transparent":"".concat(Cs),Rn,on>0||0===on?"transparent":"".concat(Cs),Rn,!1===me.show_solar?"st12":"",Ns,!1===me.show_solar?"st12":"",0===dn?"transparent":"".concat(Ns),Nn,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,bs,fs<0||0===fs?"transparent":"".concat(bs),$n,fs>0||0===fs?"transparent":"".concat(bs),$n,ws,0===pn?"transparent":"".concat(ws),jn,ws,0===pn?"transparent":"".concat(ws),jn,1===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,2===Ds&&!0===me.show_solar?"":"st12",ws,"oven"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"oven"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"pump"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"pump"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"aircon"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"!==Gs||1!==Ds&&2!==Ds?"0":"1",0===Ds||!1===me.show_solar?"none":"",ws,"boiler"===Xs&&2===Ds?"1":"0",0===Ds||!1===me.show_solar?"none":"",ws,0===Ds||!1===me.show_solar?"none":"",Gs,0===Ds||1===Ds||!1===me.show_solar?"none":"",Xs,!1===me.show_solar?"st12":"",Ns,parseInt(Pe.state)>=rn?1:0,Cs,parseInt(Pe.state)>=50&&parseInt(Pe.state)hn&&parseInt(Pe.state)<=49?1:0,Cs,parseInt(Pe.state)<=hn?1:0,Cs,(t=>this.handlePopup(t,me.entities.grid_connected_status_194)),"off"===Hs||"0"===Hs?"st12":"",bs,"on"===Hs||"1"===Hs?"st12":"",Ms,ws,en,(t=>this.handlePopup(t,me.entities.use_timer_248)),"on"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,"off"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_off"),"on"==Ue.state&&!1!==nn?"":"none",en,ut("common.timer_on"),(t=>this.handlePopup(t,me.entities.priority_load_243)),"off"===ze.state&&!1!==an?"":"none",en,"on"===ze.state&&!1!==an?"":"none",en,"off"===ze.state&&!1!==an?"":"none",en,ut("common.priority_batt"),"on"===ze.state&&!1!==an?"":"none",en,ut("common.priority_load"),(t=>this.handlePopup(t,me.entities.solar_sell_247)),me.entities.solar_sell_247&&"off"!==ds.state&&"0"!==ds.state&&!1!==me.show_solar?"":"none",Ns,me.entities.solar_sell_247&&"on"!==ds.state&&"1"!==ds.state&&!1!==me.show_solar?"":"none",Ns,!1===ms?"":"st12",(t=>this.handlePopup(t,mn.entityID)),!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"st12":"",en,!1===mn.show||"none"===me.entities.use_timer_248?"none":"","none"===mn.charge?"":"st12",en,(t=>this.handlePopup(t,me.entities.day_battery_charge_70)),!1===Ss?"none":"",Cs,parseFloat(qe.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||0!=Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_pv_energy_108)),!1===Rs||!1===me.show_solar||!1===Ks?"none":"",Ns,parseFloat(be.state).toFixed(1),Ks,(t=>this.handlePopup(t,me.entities.day_battery_discharge_71)),!1===Ss?"none":"",Cs,parseFloat(we.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_load_energy_84)),2===Ds?"365":"400.4",2===Ds?"168":"267.9",!1===ks?"none":"",ws,parseFloat(Te.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_import_76)),!1===Fs?"none":"",bs,parseFloat(ke.state).toFixed(1),(t=>this.handlePopup(t,me.entities.day_grid_export_77)),!1===Bs?"none":"",bs,parseFloat(Je.state).toFixed(1),(t=>this.handlePopup(t,me.entities.inverter_voltage_154)),"none"!==me.entities.inverter_voltage_154&&me.entities.inverter_voltage_154?"":"none",en,Es,(t=>this.handlePopup(t,me.entities.load_frequency_192)),"none"!==me.entities.load_frequency_192&&me.entities.load_frequency_192?"":"none",en,Ls,(t=>this.handlePopup(t,me.entities.inverter_current_164)),"none"!==me.entities.inverter_current_164&&me.entities.inverter_current_164?"":"none",en,Ps,(t=>this.handlePopup(t,me.entities.battery_voltage_183)),"none"!==me.entities.battery_voltage_183&&me.entities.battery_voltage_183?"":"none",Cs,!1===Js?"st14":"st4",Vs,(t=>this.handlePopup(t,me.entities.battery_soc_184)),"none"===me.entities.battery_soc_184?"none":"",Cs,parseInt(Pe.state),(t=>this.handlePopup(t,me.entities.battery_soc_184)),Cs,!1===mn.show||"none"===me.entities.battery_soc_184?"none":"",mn.capacity||0,(t=>this.handlePopup(t,me.entities.battery_power_190)),"none"===me.entities.battery_power_190?"none":"",Cs,!1===Js?"st14":"st4",on<0?-1*on:on,(t=>this.handlePopup(t,me.entities.battery_current_191)),"none"===me.entities.battery_current_191?"none":"",Cs,!1===Js?"st14":"st4",es.state,(t=>this.handlePopup(t,me.entities.grid_ct_power_172)),"none"===me.entities.grid_ct_power_172?"none":"",!1===Js?"st14":"st4",bs,fs||0,(t=>this.handlePopup(t,me.entities.pv1_voltage_109)),!1!==me.show_solar&&me.entities.pv1_voltage_109&&"none"!==me.entities.pv1_voltage_109?"":"none",Ns,Be.state,(t=>this.handlePopup(t,me.entities.pv1_current_110)),!1!==me.show_solar&&me.entities.pv1_current_110&&"none"!==me.entities.pv1_current_110?"":"none",Ns,Ce.state,(t=>this.handlePopup(t,me.entities.pv2_voltage_111)),!1!==me.show_solar&&me.entities.pv2_voltage_111&&"none"!==me.entities.pv2_voltage_111&&1!==me.solar.mppts?"":"none",Ns,Se.state,(t=>this.handlePopup(t,me.entities.pv2_current_112)),!1!==me.show_solar&&me.entities.pv2_current_112&&"none"!==me.entities.pv2_current_112&&1!==me.solar.mppts?"":"none",Ns,Ne.state,(t=>this.handlePopup(t,me.entities.pv3_voltage_113)),!1!==me.show_solar&&me.entities.pv3_voltage_113&&"none"!==me.entities.pv3_voltage_113&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Ye.state,(t=>this.handlePopup(t,me.entities.pv3_current_114)),!1!==me.show_solar&&me.entities.pv3_current_114&&"none"!==me.entities.pv3_current_114&&1!==me.solar.mppts&&2!==me.solar.mppts?"":"none",Ns,Qe.state,(t=>this.handlePopup(t,me.entities.pv4_voltage_115)),!1!==me.show_solar&&me.entities.pv4_voltage_115&&"none"!==me.entities.pv4_voltage_115&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,We.state,(t=>this.handlePopup(t,me.entities.pv4_current_116)),!1!==me.show_solar&&me.entities.pv4_current_116&&"none"!==me.entities.pv4_current_116&&1!==me.solar.mppts&&2!==me.solar.mppts&&3!==me.solar.mppts?"":"none",Ns,Ge.state,(t=>this.handlePopup(t,me.entities.battery_temp_182)),"none"===me.entities.battery_temp_182?"st12":"st3 left-align",Cs,(null===(Tt=me.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",ns.state,(t=>this.handlePopup(t,me.entities.radiator_temp_91)),"none"===me.entities.radiator_temp_91?"st12":"st3 left-align",en,(null===(kt=me.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",as.state,(t=>this.handlePopup(t,me.entities.dc_transformer_temp_90)),"none"===me.entities.dc_transformer_temp_90?"st12":"st3 left-align",en,(null===(xe=me.entities)||void 0===xe?void 0:xe.dc_transformer_temp_90)?"":"none",is.state,(t=>this.handlePopup(t,me.entities.energy_cost)),"none"===me.entities.energy_cost?"st12":"st3 left-align",bs,(null===(ue=me.entities)||void 0===ue?void 0:ue.energy_cost)?"":"none",parseFloat(hs.state).toFixed(2),hs.attributes.unit_of_measurement,(null===(fe=me.entities)||void 0===fe?void 0:fe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv_total)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0):j(oe||(oe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,cn||0),"none"!==me.entities.pv1_power_186?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv1_power_186)),!1===Js?"st14":"st4",!1===me.show_solar?"none":"",Ns,parseFloat(Le.state).toFixed(0)):j(re||(re=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv1_power_186?"none":"",Ns,parseFloat(Le.state).toFixed(0)),"none"!==me.entities.pv2_power_187?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv2_power_187)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)):j(de||(de=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv2_power_187||1===me.solar.mppts?"none":"",Ns,parseFloat(Ze.state).toFixed(0)),"none"!==me.entities.pv3_power_188?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv3_power_188)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv3_power_188||1===me.solar.mppts||2===me.solar.mppts?"none":"",Ns,parseFloat(Xe.state).toFixed(0)),"none"!==me.entities.pv4_power_189?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.pv4_power_189)),!1===Js?"st14":"st4",!1===me.show_solar||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===Js?"st14":"st4",!1===me.show_solar||"none"===me.entities.pv4_power_189||1===me.solar.mppts||2===me.solar.mppts||3===me.solar.mppts?"none":"",Ns,parseFloat(Ke.state).toFixed(0)),"none"!==me.entities.essential_power?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,me.entities.essential_power)),!1===Js?"st14":"st4",ws,pn||0):j(ge||(ge=e([''," W"])),!1===Js?"st14":"st4",ws,pn||0)):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=xe({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));si[e]=new Date(ei.getTime()),si[e].setHours(s),si[e].setMinutes(n)}));const[ni,ii,ai,oi,li,ri]=si;function hi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ln.charge="none":Ln.charge="both",Ln.capacity=parseInt(t.capacity.state),Ln.entityID=e}ei>=ri||ei=ni&&ei=ii&&ei=ai&&ei=oi&&ei=li&&ei0?En="off"===Ge.state||!1===Ln.show||parseInt(De.state)<=Ln.capacity?Le.battery.shutdown_soc:Ln.capacity:gn<0&&("off"===Ge.state||!1===Ln.show||parseInt(De.state)>=Ln.capacity?En=100:parseInt(De.state)0?Pn=(parseInt(De.state)-En)/100*Le.battery.energy/gn*60*60:gn<0&&(Pn=(En-parseInt(De.state))/100*Le.battery.energy/gn*60*60*-1);const di=new Date,ci=1e3*Pn,pi=new Date(di.getTime()+ci),vi=pi.getHours(),_i=pi.getMinutes().toString().padStart(2,"0"),yi=vi.toString().padStart(2,"0");Vn="".concat(yi,":").concat(_i);const gi=Math.floor(Pn/86400),xi=Math.floor(Pn%86400/3600),ui=Math.floor(Pn%3600/60);gi>0&&(In+="".concat(gi," days, ")),(xi>0||gi>0)&&(In+="".concat(xi," hrs, ")),In+="".concat(ui," min")}let Fn=!!(-2<=parseInt(cs.state)&&parseInt(cs.state)<=2&&parseInt(De.state)>=99),Bn="",Cn="",Sn="",Nn=!1;Sn="sunsynk"!==Le.inverter.model&&"lux"!==Le.inverter.model?"sunsynk":Le.inverter.model;let Rn=wt[Sn];for(const fi of Object.keys(Rn)){const mi=Rn[fi],{states:wi,color:qi,message:Ti}=mi;if(wi.includes(Xe.state)){Bn=qi,Cn=Ti,Nn=!0;break}}Nn||("none"!==(null===(N=Le.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=Le.entities)||void 0===D?void 0:D.inverter_status_59)?(Bn="transparent",Cn="Status"):(Bn="transparent",Cn=""));let jn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state)),Dn=(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),$n=0!=Dn?Math.min(Math.round(100*jn/Dn),100):0,On=0!=jn?Math.min(Math.round(100*Dn/jn),100):0,zn=mn+parseInt("".concat(gn>0?gn:0))+parseInt("".concat(As<0?-1*As:0)),Un=qn+Tn+parseInt("".concat(As>0?As:0))+parseInt("".concat(gn<0?-1*gn:0)),Yn=0!=Un?Math.min(Math.round(100*zn/Un),100):0,Wn=0!=zn?Math.min(Math.round(100*Un/zn),100):0,Qn=null===($=Le.solar)||void 0===$?void 0:$.animation_speed;if(Le&&Le.solar&&Le.solar.animation_speed){let ki=Le.solar.animation_speed-(Le.solar.animation_speed-1)*(mn/(Le.solar.max_power||mn));Qn=ki>=1?ki:1}let Gn=null===(O=Le.battery)||void 0===O?void 0:O.animation_speed;if(Le&&Le.battery&&Le.battery.animation_speed){let bi=Le.battery.animation_speed-(Le.battery.animation_speed-1)*((gn<0?-1*gn:gn)/(Le.battery.max_power||(gn<0?-1*gn:gn)));Gn=bi>=1?bi:1}let Xn=null===(z=Le.load)||void 0===z?void 0:z.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Mi=Le.load.animation_speed-(Le.load.animation_speed-1)*(qn/(Le.load.max_power||qn));Xn=Mi>=1?Mi:1}let Kn=null===(U=Le.load)||void 0===U?void 0:U.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Ai=Le.load.animation_speed-(Le.load.animation_speed-1)*((parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))/(Le.load.max_power||(parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))));Kn=Ai>=1?Ai:1}let Jn=null===(Y=Le.grid)||void 0===Y?void 0:Y.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Hi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*((parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))/(Le.grid.max_power||(parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))));Jn=Hi>=1?Hi:1}let ti=null===(W=Le.grid)||void 0===W?void 0:W.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Zi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*(Tn/(Le.grid.max_power||Tn));ti=Zi>=1?Zi:1}return"full"===Le.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Es,Es,Ps,Vs,Fs,Fs,!1===cn?"".concat(xn):"100%",Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Fs,Ps,!1===Xs?"st12":"",Es,pn,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Fs,!1===Cs?"st12":"",1===Os?"":"none",Fs,!1===Cs?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",!1===Xs?"30":"143",Es,1===Ks?"":"none",!1===Xs?"376":"373",!1===Xs?"30":"143",Es,2===Ks?"":"none",!1===Xs?"413":"410",!1===Xs?"30":"143",Es,2===Ks?"":"none",Ps,!1===Xs?"none":"",1===Js||2===Js?"":"st12",Ps,!1===Xs?"none":"",2===Js?"":"st12",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,Fs,pn,Cn,1!==Ks&&2!==Ks||!0!==Xs?"":"none",Es,ut("common.essential"),0===Ks||!1===Xs?"none":"",Es,ut("common.essential"),!1===Xs?70:181,1===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?393:390,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?429:426,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load2_name,2===Js?"238":"306",!1===Is||!1===Xs?"transparent":"".concat(Es),ut("common.daily_load"),0===Ks?"377":"306",0===Ks?71:93,!1===Is||!0===Xs?"transparent":"".concat(Es),ut("common.daily_load"),!1===Gs||!1===Le.show_solar||"false"!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||"false"===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),!1===Cs?"311":"347",!1===Cs?"368":"253",!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Cs?"311":"347",!1===Cs?"337":"222",!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),Le.load.aux_name,!1===Cs?"none":"",Fs,Le.grid.nonessential_name,!1===Cs||0===Os||2===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load2_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,1===Js?53:14,!1===Xs||0===Js?"none":"",Ps,Le.load.aux_load1_name,!1===Xs||0===Js||1===Js?"none":"",Ps,Le.load.aux_load2_name,Bn,!0===Xs?"":"none",1===Ks||2===Ks?"":"st12",Es,!1===Xs?"":"none",1===Ks?"":"st12",Es,!1===Xs?"":"none",2===Ks?"":"st12",Es,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn/2,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti,!1===Xs?"st12":"",Ps,!1===Xs||0===As?"st12":"",As<0?"transparent":"".concat(Ps),Kn,!1===Xs||0===As?"st12":"",As>0?"transparent":"".concat(Ps),Kn,!1===Xs?"st12":"",Ps,Fs,pn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,pn,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?"1":"0",Ys,parseInt(De.state)<=fn?1:0,Ys,!1===Le.show_solar?"st12":"",Qs,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,"default"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"oven"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"boiler"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"pump"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"aircon"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,!1===Cs||2===Os||1===Os?"none":"",nn,"default"===an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"===an&&"default"!=on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"!=an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,!1===Cs||0===Os||1===Os?"none":"",an,!1===Cs||0===Os||1===Os?"none":"",on,"default"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,!1===Cs||0===Os||2===Os?"none":"",an,1!==Ks&&2!==Ks||!1!==Xs?"none":"",Es,1!==Ks&&2!==Ks||!0!==Xs?"none":"",Es,1===Ks||2===Ks?"none":"",Es,(t=>this.handlePopup(t,Le.entities.aux_connected_status)),"default"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"gen"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"inverter"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"oven"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"boiler"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"aircon"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"pump"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),!1===Xs||1===Js||2===Js?"none":"",tn,"on"===Ns||"1"===Ns?"aux-icon":"aux-off-icon",!1===Xs||0===Js?"none":"",en,!1===Xs||1===Js||0===Js?"none":"",sn,"boiler"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"boiler"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"pump"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"pump"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,0===Ks||1===Ks?"none":"",!0===Xs?"350":"383",!0===Xs?"140":"5",ln,0===Ks||1===Ks?"none":"",!0===Xs?"446":"420",!0===Xs?"140":"5",rn,0===Ks||2===Ks?"none":"","336",!0===Xs?"140":"27",ln,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"no"!=vn?"232":"249","on"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"232":"249","off"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"243":"260","on"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_on"),"no"!=vn?"243":"260","off"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_off"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,(t=>this.handlePopup(t,Le.entities.priority_load_243)),"no"!=vn?"251":"268","off"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"251":"268","on"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"262":"280","on"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_load"),"no"!=vn?"262":"280","off"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_batt"),!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Js?"238":"306",!1===Is||!1===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),0===Ks?"377":"306",0===Ks?"57":"80",!1===Is||!0===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===Cs?"311":"347",!1===Cs?"354":"239",!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Cs?"311":"347",!1===Cs?"323":"209",!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(null===(Q=Le.entities)||void 0===Q?void 0:Q.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(At||(At=e([' '," W "])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(G=Le.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(Zt||(Zt=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(X=Le.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.nonessential_power)),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0):j(Et||(Et=e([''," W "])),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0),(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(null===(K=Le.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_power_166)),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As):j(Vt||(Vt=e([''," W "])),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As),(null===(J=Le.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(tt=Le.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(et=Le.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(st=Le.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(nt=Le.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)):j($t||($t=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)),(null===(it=Le.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Le.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(ot=Le.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(lt=Le.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load2)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Le.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Le.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(dt=Le.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",!1===dn?"st14":"st4",Fs,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",!1===dn?"st14":"st4",Fs,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",!1===dn?"st14":"st4",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.inverter_power_175)),"none"===Le.entities.inverter_power_175?"none":"",!1===dn?"st14":"st4",pn,Ke.state,(t=>this.handlePopup(t,Le.entities.grid_power_169)),"none"===Le.entities.grid_power_169?"none":"",!1===dn?"st14":"st4",Fs,Je.state,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(ct=Le.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),4===(null===(pt=Le.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=Le.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(_t=Le.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(yt=Le.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(gt=Le.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement):"lite"===Le.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Es,!1===Le.show_solar?145.33:-.5,!1===Le.show_solar?270.67:406,"".concat(!1===cn?!1===Le.show_solar?"246px":"".concat(xn):!1===Le.show_solar?"75%":"100%"),Es,Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Es,1===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),2===Ks?"365":"415",2===Ks?"182.2":"282.1",!1===Is?"transparent":"".concat(Es),ut("common.daily_load"),!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Gs||!1===Le.show_solar||0!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||!1===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,ut("common.ratio"),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",Es,(null===(xt=Le.load)||void 0===xt?void 0:xt.load1_name)?"".concat(Le.load.load1_name):"",2===Ks&&!0===Le.show_solar?"":"none",Es,(null===(ft=Le.load)||void 0===ft?void 0:ft.load2_name)?"".concat(Le.load.load2_name):"",Bn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,0===qn?"transparent":"".concat(Es),Xn,1===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,"oven"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,0===Ks||!1===Le.show_solar?"none":"",ln,0===Ks||1===Ks||!1===Le.show_solar?"none":"",rn,!1===Le.show_solar?"st12":"",Qs,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?1:0,Ys,parseInt(De.state)<=fn?1:0,Ys,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,Es,pn,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"on"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_off"),"on"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_on"),(t=>this.handlePopup(t,Le.entities.priority_load_243)),"off"===es.state&&!1!==yn?"":"none",pn,"on"===es.state&&!1!==yn?"":"none",pn,"off"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_batt"),"on"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_load"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||0!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||!1===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Ks?"365":"400.4",2===Ks?"168":"267.9",!1===Is?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",pn,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",pn,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(qt=Le.entities)||void 0===qt?void 0:qt.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(Tt=Le.entities)||void 0===Tt?void 0:Tt.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(kt=Le.entities)||void 0===kt?void 0:kt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(we=Le.entities)||void 0===we?void 0:we.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement,(null===(qe=Le.entities)||void 0===qe?void 0:qe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(oe||(oe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(Te=Le.entities)||void 0===Te?void 0:Te.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(re||(re=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(ke=Le.entities)||void 0===ke?void 0:ke.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(de||(de=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(be=Le.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(Me=Le.entities)||void 0===Me?void 0:Me.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Le.entities)||void 0===Ae?void 0:Ae.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(ge||(ge=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(He=Le.entities)||void 0===He?void 0:He.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)),(null===(Ze=Le.entities)||void 0===Ze?void 0:Ze.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0)):j(me||(me=e([''," W"])),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); From bf5997480ad0a04410793b1e2dd659359f5eae55 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Thu, 17 Aug 2023 21:33:50 +0200 Subject: [PATCH 29/40] refactor: add missing remaining solar --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index aeb8b11c..dcf77f84 100644 --- a/src/index.ts +++ b/src/index.ts @@ -852,7 +852,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1)} kWh From fe5b9ce4815006ea8ee0915d0fb5dca1dcf6a96a Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 17 Aug 2023 20:09:00 +0000 Subject: [PATCH 30/40] chore: rebuild code --- .devcontainer/recommended-devcontainer.json | 10 +++- .github/workflows/release.yml | 60 +++++++++++++++++++-- dist/sunsynk-power-flow-card.js | 2 +- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/.devcontainer/recommended-devcontainer.json b/.devcontainer/recommended-devcontainer.json index 742cc82a..e082be7e 100644 --- a/.devcontainer/recommended-devcontainer.json +++ b/.devcontainer/recommended-devcontainer.json @@ -4,7 +4,15 @@ "context": "..", "customizations": { "vscode": { - "settings": {}, + "settings": { + "files.eol": "\n", + "editor.tabSize": 4, + "terminal.integrated.shell.linux": "/bin/zsh", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true + }, "extensions": [ "github.vscode-pull-request-github", "yzhang.markdown-all-in-one", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51cda091..b0f92a01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,22 +2,74 @@ name: release on: push: - tags: - - "v*" + branches: + - main workflow_dispatch: jobs: release: name: Create release - if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - name: Getting your configuration from GitHub uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Install dependencies + run: yarn install + + - name: Check if TypeScript files changed + id: check-changes + run: echo ::set-output name=changed::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '\.ts$' | wc -l) + + - name: Get latest tag + id: get-latest-tag + run: echo ::set-output name=latest_tag::$(git describe --tags --abbrev=0 | sed 's/^v//') + + - name: Get current version + id: get-version + run: echo ::set-output name=version::$(node -pe "require('./package.json').version") + + - name: Check if version is higher + id: check-version + run: echo ::set-output name=is_higher::$(node -pe "const semver = require('semver'); semver.gt('${{ steps.get-version.outputs.version }}', '${{ steps.get-latest-tag.outputs.latest_tag }}')") + + - name: Check if semver label is valid + id: check-semver + if: steps.check-changes.outputs.changed == 'true' + run: | + const labelsInput = ${{ toJSON(github.event.pull_request.labels) }}; + const currentVersion = ${{ steps.get-version.outputs.version }}; + const isMajor = labelsInput.some(label => label.name === 'semver/major'); + const isBreaking = labelsInput.some(label => label.name === 'type/breaking'); + const isFeature = labelsInput.some(label => label.name === 'type/feature'); + const isSemverValid = () => { + if (isMajor || isBreaking) { + return currentVersion.includes('0.0.0'); + } else if (isFeature) { + return currentVersion.includes('0.0.'); + } + }; + echo ::set-output name=is_valid::$(isSemverValid) + + - name: Build project + if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true' + run: yarn run build + - name: 🛎️ Create release - id: create_release + if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true' uses: softprops/action-gh-release@v1 with: + files: dist/sunsynk-power-flow-card.js + tag_name: ${{ steps.get-version.outputs.version }} + title: Release ${{ steps.get-version.outputs.version }} + token: ${{ secrets.GITHUB_TOKEN }} generate_release_notes: true + - name: 🏷️ Update latest tag + if: steps.check-changes.outputs.changed == 'true' && steps.check-semver.outputs.is_valid == 'true' && steps.check-version.outputs.is_higher == 'true' uses: EndBug/latest-tag@latest diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 9b2f2b5e..449da256 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));si[e]=new Date(ei.getTime()),si[e].setHours(s),si[e].setMinutes(n)}));const[ni,ii,ai,oi,li,ri]=si;function hi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ln.charge="none":Ln.charge="both",Ln.capacity=parseInt(t.capacity.state),Ln.entityID=e}ei>=ri||ei=ni&&ei=ii&&ei=ai&&ei=oi&&ei=li&&ei0?En="off"===Ge.state||!1===Ln.show||parseInt(De.state)<=Ln.capacity?Le.battery.shutdown_soc:Ln.capacity:gn<0&&("off"===Ge.state||!1===Ln.show||parseInt(De.state)>=Ln.capacity?En=100:parseInt(De.state)0?Pn=(parseInt(De.state)-En)/100*Le.battery.energy/gn*60*60:gn<0&&(Pn=(En-parseInt(De.state))/100*Le.battery.energy/gn*60*60*-1);const di=new Date,ci=1e3*Pn,pi=new Date(di.getTime()+ci),vi=pi.getHours(),_i=pi.getMinutes().toString().padStart(2,"0"),yi=vi.toString().padStart(2,"0");Vn="".concat(yi,":").concat(_i);const gi=Math.floor(Pn/86400),xi=Math.floor(Pn%86400/3600),ui=Math.floor(Pn%3600/60);gi>0&&(In+="".concat(gi," days, ")),(xi>0||gi>0)&&(In+="".concat(xi," hrs, ")),In+="".concat(ui," min")}let Fn=!!(-2<=parseInt(cs.state)&&parseInt(cs.state)<=2&&parseInt(De.state)>=99),Bn="",Cn="",Sn="",Nn=!1;Sn="sunsynk"!==Le.inverter.model&&"lux"!==Le.inverter.model?"sunsynk":Le.inverter.model;let Rn=wt[Sn];for(const fi of Object.keys(Rn)){const mi=Rn[fi],{states:wi,color:qi,message:Ti}=mi;if(wi.includes(Xe.state)){Bn=qi,Cn=Ti,Nn=!0;break}}Nn||("none"!==(null===(N=Le.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=Le.entities)||void 0===D?void 0:D.inverter_status_59)?(Bn="transparent",Cn="Status"):(Bn="transparent",Cn=""));let jn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state)),Dn=(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),$n=0!=Dn?Math.min(Math.round(100*jn/Dn),100):0,On=0!=jn?Math.min(Math.round(100*Dn/jn),100):0,zn=mn+parseInt("".concat(gn>0?gn:0))+parseInt("".concat(As<0?-1*As:0)),Un=qn+Tn+parseInt("".concat(As>0?As:0))+parseInt("".concat(gn<0?-1*gn:0)),Yn=0!=Un?Math.min(Math.round(100*zn/Un),100):0,Wn=0!=zn?Math.min(Math.round(100*Un/zn),100):0,Qn=null===($=Le.solar)||void 0===$?void 0:$.animation_speed;if(Le&&Le.solar&&Le.solar.animation_speed){let ki=Le.solar.animation_speed-(Le.solar.animation_speed-1)*(mn/(Le.solar.max_power||mn));Qn=ki>=1?ki:1}let Gn=null===(O=Le.battery)||void 0===O?void 0:O.animation_speed;if(Le&&Le.battery&&Le.battery.animation_speed){let bi=Le.battery.animation_speed-(Le.battery.animation_speed-1)*((gn<0?-1*gn:gn)/(Le.battery.max_power||(gn<0?-1*gn:gn)));Gn=bi>=1?bi:1}let Xn=null===(z=Le.load)||void 0===z?void 0:z.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Mi=Le.load.animation_speed-(Le.load.animation_speed-1)*(qn/(Le.load.max_power||qn));Xn=Mi>=1?Mi:1}let Kn=null===(U=Le.load)||void 0===U?void 0:U.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Ai=Le.load.animation_speed-(Le.load.animation_speed-1)*((parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))/(Le.load.max_power||(parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))));Kn=Ai>=1?Ai:1}let Jn=null===(Y=Le.grid)||void 0===Y?void 0:Y.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Hi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*((parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))/(Le.grid.max_power||(parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))));Jn=Hi>=1?Hi:1}let ti=null===(W=Le.grid)||void 0===W?void 0:W.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Zi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*(Tn/(Le.grid.max_power||Tn));ti=Zi>=1?Zi:1}return"full"===Le.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Es,Es,Ps,Vs,Fs,Fs,!1===cn?"".concat(xn):"100%",Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Fs,Ps,!1===Xs?"st12":"",Es,pn,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Fs,!1===Cs?"st12":"",1===Os?"":"none",Fs,!1===Cs?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",!1===Xs?"30":"143",Es,1===Ks?"":"none",!1===Xs?"376":"373",!1===Xs?"30":"143",Es,2===Ks?"":"none",!1===Xs?"413":"410",!1===Xs?"30":"143",Es,2===Ks?"":"none",Ps,!1===Xs?"none":"",1===Js||2===Js?"":"st12",Ps,!1===Xs?"none":"",2===Js?"":"st12",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,Fs,pn,Cn,1!==Ks&&2!==Ks||!0!==Xs?"":"none",Es,ut("common.essential"),0===Ks||!1===Xs?"none":"",Es,ut("common.essential"),!1===Xs?70:181,1===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?393:390,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?429:426,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load2_name,2===Js?"238":"306",!1===Is||!1===Xs?"transparent":"".concat(Es),ut("common.daily_load"),0===Ks?"377":"306",0===Ks?71:93,!1===Is||!0===Xs?"transparent":"".concat(Es),ut("common.daily_load"),!1===Gs||!1===Le.show_solar||"false"!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||"false"===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),!1===Cs?"311":"347",!1===Cs?"368":"253",!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Cs?"311":"347",!1===Cs?"337":"222",!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),Le.load.aux_name,!1===Cs?"none":"",Fs,Le.grid.nonessential_name,!1===Cs||0===Os||2===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load2_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,1===Js?53:14,!1===Xs||0===Js?"none":"",Ps,Le.load.aux_load1_name,!1===Xs||0===Js||1===Js?"none":"",Ps,Le.load.aux_load2_name,Bn,!0===Xs?"":"none",1===Ks||2===Ks?"":"st12",Es,!1===Xs?"":"none",1===Ks?"":"st12",Es,!1===Xs?"":"none",2===Ks?"":"st12",Es,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn/2,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti,!1===Xs?"st12":"",Ps,!1===Xs||0===As?"st12":"",As<0?"transparent":"".concat(Ps),Kn,!1===Xs||0===As?"st12":"",As>0?"transparent":"".concat(Ps),Kn,!1===Xs?"st12":"",Ps,Fs,pn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,pn,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?"1":"0",Ys,parseInt(De.state)<=fn?1:0,Ys,!1===Le.show_solar?"st12":"",Qs,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,"default"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"oven"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"boiler"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"pump"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"aircon"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,!1===Cs||2===Os||1===Os?"none":"",nn,"default"===an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"===an&&"default"!=on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"!=an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,!1===Cs||0===Os||1===Os?"none":"",an,!1===Cs||0===Os||1===Os?"none":"",on,"default"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,!1===Cs||0===Os||2===Os?"none":"",an,1!==Ks&&2!==Ks||!1!==Xs?"none":"",Es,1!==Ks&&2!==Ks||!0!==Xs?"none":"",Es,1===Ks||2===Ks?"none":"",Es,(t=>this.handlePopup(t,Le.entities.aux_connected_status)),"default"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"gen"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"inverter"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"oven"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"boiler"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"aircon"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"pump"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),!1===Xs||1===Js||2===Js?"none":"",tn,"on"===Ns||"1"===Ns?"aux-icon":"aux-off-icon",!1===Xs||0===Js?"none":"",en,!1===Xs||1===Js||0===Js?"none":"",sn,"boiler"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"boiler"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"pump"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"pump"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,0===Ks||1===Ks?"none":"",!0===Xs?"350":"383",!0===Xs?"140":"5",ln,0===Ks||1===Ks?"none":"",!0===Xs?"446":"420",!0===Xs?"140":"5",rn,0===Ks||2===Ks?"none":"","336",!0===Xs?"140":"27",ln,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"no"!=vn?"232":"249","on"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"232":"249","off"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"243":"260","on"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_on"),"no"!=vn?"243":"260","off"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_off"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,(t=>this.handlePopup(t,Le.entities.priority_load_243)),"no"!=vn?"251":"268","off"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"251":"268","on"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"262":"280","on"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_load"),"no"!=vn?"262":"280","off"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_batt"),!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Js?"238":"306",!1===Is||!1===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),0===Ks?"377":"306",0===Ks?"57":"80",!1===Is||!0===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===Cs?"311":"347",!1===Cs?"354":"239",!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Cs?"311":"347",!1===Cs?"323":"209",!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(null===(Q=Le.entities)||void 0===Q?void 0:Q.pv_total)?j(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(At||(At=e([' '," W "])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(G=Le.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(Zt||(Zt=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(X=Le.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.nonessential_power)),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0):j(Et||(Et=e([''," W "])),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0),(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(null===(K=Le.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_power_166)),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As):j(Vt||(Vt=e([''," W "])),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As),(null===(J=Le.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(tt=Le.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(et=Le.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(st=Le.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(nt=Le.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)):j($t||($t=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)),(null===(it=Le.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Le.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(ot=Le.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(lt=Le.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load2)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Le.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Le.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(dt=Le.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",!1===dn?"st14":"st4",Fs,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",!1===dn?"st14":"st4",Fs,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",!1===dn?"st14":"st4",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.inverter_power_175)),"none"===Le.entities.inverter_power_175?"none":"",!1===dn?"st14":"st4",pn,Ke.state,(t=>this.handlePopup(t,Le.entities.grid_power_169)),"none"===Le.entities.grid_power_169?"none":"",!1===dn?"st14":"st4",Fs,Je.state,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(ct=Le.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),4===(null===(pt=Le.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=Le.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(_t=Le.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(yt=Le.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(gt=Le.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement):"lite"===Le.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Es,!1===Le.show_solar?145.33:-.5,!1===Le.show_solar?270.67:406,"".concat(!1===cn?!1===Le.show_solar?"246px":"".concat(xn):!1===Le.show_solar?"75%":"100%"),Es,Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Es,1===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),2===Ks?"365":"415",2===Ks?"182.2":"282.1",!1===Is?"transparent":"".concat(Es),ut("common.daily_load"),!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Gs||!1===Le.show_solar||0!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||!1===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,ut("common.ratio"),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",Es,(null===(xt=Le.load)||void 0===xt?void 0:xt.load1_name)?"".concat(Le.load.load1_name):"",2===Ks&&!0===Le.show_solar?"":"none",Es,(null===(ft=Le.load)||void 0===ft?void 0:ft.load2_name)?"".concat(Le.load.load2_name):"",Bn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,0===qn?"transparent":"".concat(Es),Xn,1===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,"oven"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,0===Ks||!1===Le.show_solar?"none":"",ln,0===Ks||1===Ks||!1===Le.show_solar?"none":"",rn,!1===Le.show_solar?"st12":"",Qs,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?1:0,Ys,parseInt(De.state)<=fn?1:0,Ys,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,Es,pn,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"on"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_off"),"on"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_on"),(t=>this.handlePopup(t,Le.entities.priority_load_243)),"off"===es.state&&!1!==yn?"":"none",pn,"on"===es.state&&!1!==yn?"":"none",pn,"off"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_batt"),"on"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_load"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||0!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||!1===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Ks?"365":"400.4",2===Ks?"168":"267.9",!1===Is?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",pn,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",pn,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(qt=Le.entities)||void 0===qt?void 0:qt.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(Tt=Le.entities)||void 0===Tt?void 0:Tt.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(kt=Le.entities)||void 0===kt?void 0:kt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(we=Le.entities)||void 0===we?void 0:we.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement,(null===(qe=Le.entities)||void 0===qe?void 0:qe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(oe||(oe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(Te=Le.entities)||void 0===Te?void 0:Te.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(re||(re=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(ke=Le.entities)||void 0===ke?void 0:ke.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(de||(de=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(be=Le.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(Me=Le.entities)||void 0===Me?void 0:Me.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Le.entities)||void 0===Ae?void 0:Ae.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(ge||(ge=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(He=Le.entities)||void 0===He?void 0:He.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)),(null===(Ze=Le.entities)||void 0===Ze?void 0:Ze.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0)):j(me||(me=e([''," W"])),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));si[e]=new Date(ei.getTime()),si[e].setHours(s),si[e].setMinutes(n)}));const[ni,ii,ai,oi,li,ri]=si;function hi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ln.charge="none":Ln.charge="both",Ln.capacity=parseInt(t.capacity.state),Ln.entityID=e}ei>=ri||ei=ni&&ei=ii&&ei=ai&&ei=oi&&ei=li&&ei0?En="off"===Ge.state||!1===Ln.show||parseInt(De.state)<=Ln.capacity?Le.battery.shutdown_soc:Ln.capacity:gn<0&&("off"===Ge.state||!1===Ln.show||parseInt(De.state)>=Ln.capacity?En=100:parseInt(De.state)0?Pn=(parseInt(De.state)-En)/100*Le.battery.energy/gn*60*60:gn<0&&(Pn=(En-parseInt(De.state))/100*Le.battery.energy/gn*60*60*-1);const di=new Date,ci=1e3*Pn,pi=new Date(di.getTime()+ci),vi=pi.getHours(),_i=pi.getMinutes().toString().padStart(2,"0"),yi=vi.toString().padStart(2,"0");Vn="".concat(yi,":").concat(_i);const gi=Math.floor(Pn/86400),xi=Math.floor(Pn%86400/3600),ui=Math.floor(Pn%3600/60);gi>0&&(In+="".concat(gi," days, ")),(xi>0||gi>0)&&(In+="".concat(xi," hrs, ")),In+="".concat(ui," min")}let Fn=!!(-2<=parseInt(cs.state)&&parseInt(cs.state)<=2&&parseInt(De.state)>=99),Bn="",Cn="",Sn="",Nn=!1;Sn="sunsynk"!==Le.inverter.model&&"lux"!==Le.inverter.model?"sunsynk":Le.inverter.model;let Rn=wt[Sn];for(const fi of Object.keys(Rn)){const mi=Rn[fi],{states:wi,color:qi,message:Ti}=mi;if(wi.includes(Xe.state)){Bn=qi,Cn=Ti,Nn=!0;break}}Nn||("none"!==(null===(N=Le.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=Le.entities)||void 0===D?void 0:D.inverter_status_59)?(Bn="transparent",Cn="Status"):(Bn="transparent",Cn=""));let jn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state)),Dn=(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),$n=0!=Dn?Math.min(Math.round(100*jn/Dn),100):0,On=0!=jn?Math.min(Math.round(100*Dn/jn),100):0,zn=mn+parseInt("".concat(gn>0?gn:0))+parseInt("".concat(As<0?-1*As:0)),Un=qn+Tn+parseInt("".concat(As>0?As:0))+parseInt("".concat(gn<0?-1*gn:0)),Yn=0!=Un?Math.min(Math.round(100*zn/Un),100):0,Wn=0!=zn?Math.min(Math.round(100*Un/zn),100):0,Qn=null===($=Le.solar)||void 0===$?void 0:$.animation_speed;if(Le&&Le.solar&&Le.solar.animation_speed){let ki=Le.solar.animation_speed-(Le.solar.animation_speed-1)*(mn/(Le.solar.max_power||mn));Qn=ki>=1?ki:1}let Gn=null===(O=Le.battery)||void 0===O?void 0:O.animation_speed;if(Le&&Le.battery&&Le.battery.animation_speed){let bi=Le.battery.animation_speed-(Le.battery.animation_speed-1)*((gn<0?-1*gn:gn)/(Le.battery.max_power||(gn<0?-1*gn:gn)));Gn=bi>=1?bi:1}let Xn=null===(z=Le.load)||void 0===z?void 0:z.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Mi=Le.load.animation_speed-(Le.load.animation_speed-1)*(qn/(Le.load.max_power||qn));Xn=Mi>=1?Mi:1}let Kn=null===(U=Le.load)||void 0===U?void 0:U.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Ai=Le.load.animation_speed-(Le.load.animation_speed-1)*((parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))/(Le.load.max_power||(parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))));Kn=Ai>=1?Ai:1}let Jn=null===(Y=Le.grid)||void 0===Y?void 0:Y.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Hi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*((parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))/(Le.grid.max_power||(parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))));Jn=Hi>=1?Hi:1}let ti=null===(W=Le.grid)||void 0===W?void 0:W.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Zi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*(Tn/(Le.grid.max_power||Tn));ti=Zi>=1?Zi:1}return"full"===Le.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Es,Es,Ps,Vs,Fs,Fs,!1===cn?"".concat(xn):"100%",Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Fs,Ps,!1===Xs?"st12":"",Es,pn,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Fs,!1===Cs?"st12":"",1===Os?"":"none",Fs,!1===Cs?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",!1===Xs?"30":"143",Es,1===Ks?"":"none",!1===Xs?"376":"373",!1===Xs?"30":"143",Es,2===Ks?"":"none",!1===Xs?"413":"410",!1===Xs?"30":"143",Es,2===Ks?"":"none",Ps,!1===Xs?"none":"",1===Js||2===Js?"":"st12",Ps,!1===Xs?"none":"",2===Js?"":"st12",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,Fs,pn,Cn,1!==Ks&&2!==Ks||!0!==Xs?"":"none",Es,ut("common.essential"),0===Ks||!1===Xs?"none":"",Es,ut("common.essential"),!1===Xs?70:181,1===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?393:390,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?429:426,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load2_name,2===Js?"238":"306",!1===Is||!1===Xs?"transparent":"".concat(Es),ut("common.daily_load"),0===Ks?"377":"306",0===Ks?71:93,!1===Is||!0===Xs?"transparent":"".concat(Es),ut("common.daily_load"),!1===Gs||!1===Le.show_solar||"false"!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||"false"===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),!1===Cs?"311":"347",!1===Cs?"368":"253",!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Cs?"311":"347",!1===Cs?"337":"222",!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),Le.load.aux_name,!1===Cs?"none":"",Fs,Le.grid.nonessential_name,!1===Cs||0===Os||2===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load2_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,1===Js?53:14,!1===Xs||0===Js?"none":"",Ps,Le.load.aux_load1_name,!1===Xs||0===Js||1===Js?"none":"",Ps,Le.load.aux_load2_name,Bn,!0===Xs?"":"none",1===Ks||2===Ks?"":"st12",Es,!1===Xs?"":"none",1===Ks?"":"st12",Es,!1===Xs?"":"none",2===Ks?"":"st12",Es,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn/2,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti,!1===Xs?"st12":"",Ps,!1===Xs||0===As?"st12":"",As<0?"transparent":"".concat(Ps),Kn,!1===Xs||0===As?"st12":"",As>0?"transparent":"".concat(Ps),Kn,!1===Xs?"st12":"",Ps,Fs,pn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,pn,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?"1":"0",Ys,parseInt(De.state)<=fn?1:0,Ys,!1===Le.show_solar?"st12":"",Qs,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,"default"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"oven"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"boiler"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"pump"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"aircon"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,!1===Cs||2===Os||1===Os?"none":"",nn,"default"===an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"===an&&"default"!=on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"!=an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,!1===Cs||0===Os||1===Os?"none":"",an,!1===Cs||0===Os||1===Os?"none":"",on,"default"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,!1===Cs||0===Os||2===Os?"none":"",an,1!==Ks&&2!==Ks||!1!==Xs?"none":"",Es,1!==Ks&&2!==Ks||!0!==Xs?"none":"",Es,1===Ks||2===Ks?"none":"",Es,(t=>this.handlePopup(t,Le.entities.aux_connected_status)),"default"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"gen"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"inverter"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"oven"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"boiler"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"aircon"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"pump"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),!1===Xs||1===Js||2===Js?"none":"",tn,"on"===Ns||"1"===Ns?"aux-icon":"aux-off-icon",!1===Xs||0===Js?"none":"",en,!1===Xs||1===Js||0===Js?"none":"",sn,"boiler"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"boiler"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"pump"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"pump"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,0===Ks||1===Ks?"none":"",!0===Xs?"350":"383",!0===Xs?"140":"5",ln,0===Ks||1===Ks?"none":"",!0===Xs?"446":"420",!0===Xs?"140":"5",rn,0===Ks||2===Ks?"none":"","336",!0===Xs?"140":"27",ln,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"no"!=vn?"232":"249","on"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"232":"249","off"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"243":"260","on"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_on"),"no"!=vn?"243":"260","off"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_off"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,(t=>this.handlePopup(t,Le.entities.priority_load_243)),"no"!=vn?"251":"268","off"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"251":"268","on"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"262":"280","on"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_load"),"no"!=vn?"262":"280","off"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_batt"),!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Js?"238":"306",!1===Is||!1===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),0===Ks?"377":"306",0===Ks?"57":"80",!1===Is||!0===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===Cs?"311":"347",!1===Cs?"354":"239",!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Cs?"311":"347",!1===Cs?"323":"209",!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(null===(Q=Le.entities)||void 0===Q?void 0:Q.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(At||(At=e([' '," W "])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(G=Le.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(Zt||(Zt=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(X=Le.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.nonessential_power)),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0):j(Et||(Et=e([''," W "])),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0),(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(null===(K=Le.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_power_166)),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As):j(Vt||(Vt=e([''," W "])),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As),(null===(J=Le.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(tt=Le.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(et=Le.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(st=Le.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(nt=Le.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)):j($t||($t=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)),(null===(it=Le.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Le.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(ot=Le.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(lt=Le.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load2)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Le.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Le.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(dt=Le.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",!1===dn?"st14":"st4",Fs,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",!1===dn?"st14":"st4",Fs,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",!1===dn?"st14":"st4",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.inverter_power_175)),"none"===Le.entities.inverter_power_175?"none":"",!1===dn?"st14":"st4",pn,Ke.state,(t=>this.handlePopup(t,Le.entities.grid_power_169)),"none"===Le.entities.grid_power_169?"none":"",!1===dn?"st14":"st4",Fs,Je.state,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(ct=Le.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),4===(null===(pt=Le.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=Le.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(_t=Le.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(yt=Le.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(gt=Le.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement):"lite"===Le.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Es,!1===Le.show_solar?145.33:-.5,!1===Le.show_solar?270.67:406,"".concat(!1===cn?!1===Le.show_solar?"246px":"".concat(xn):!1===Le.show_solar?"75%":"100%"),Es,Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Es,1===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),2===Ks?"365":"415",2===Ks?"182.2":"282.1",!1===Is?"transparent":"".concat(Es),ut("common.daily_load"),!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Gs||!1===Le.show_solar||0!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||!1===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,ut("common.ratio"),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",Es,(null===(xt=Le.load)||void 0===xt?void 0:xt.load1_name)?"".concat(Le.load.load1_name):"",2===Ks&&!0===Le.show_solar?"":"none",Es,(null===(ft=Le.load)||void 0===ft?void 0:ft.load2_name)?"".concat(Le.load.load2_name):"",Bn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,0===qn?"transparent":"".concat(Es),Xn,1===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,"oven"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,0===Ks||!1===Le.show_solar?"none":"",ln,0===Ks||1===Ks||!1===Le.show_solar?"none":"",rn,!1===Le.show_solar?"st12":"",Qs,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?1:0,Ys,parseInt(De.state)<=fn?1:0,Ys,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,Es,pn,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"on"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_off"),"on"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_on"),(t=>this.handlePopup(t,Le.entities.priority_load_243)),"off"===es.state&&!1!==yn?"":"none",pn,"on"===es.state&&!1!==yn?"":"none",pn,"off"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_batt"),"on"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_load"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||0!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||!1===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Ks?"365":"400.4",2===Ks?"168":"267.9",!1===Is?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",pn,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",pn,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(qt=Le.entities)||void 0===qt?void 0:qt.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(Tt=Le.entities)||void 0===Tt?void 0:Tt.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(kt=Le.entities)||void 0===kt?void 0:kt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(we=Le.entities)||void 0===we?void 0:we.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement,(null===(qe=Le.entities)||void 0===qe?void 0:qe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(oe||(oe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(Te=Le.entities)||void 0===Te?void 0:Te.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(re||(re=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(ke=Le.entities)||void 0===ke?void 0:ke.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(de||(de=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(be=Le.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(Me=Le.entities)||void 0===Me?void 0:Me.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Le.entities)||void 0===Ae?void 0:Ae.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(ge||(ge=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(He=Le.entities)||void 0===He?void 0:He.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)),(null===(Ze=Le.entities)||void 0===Ze?void 0:Ze.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0)):j(me||(me=e([''," W"])),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); From 595563044aa2dd2b9dfd7af4062b2150c841575f Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Thu, 17 Aug 2023 23:19:20 +0200 Subject: [PATCH 31/40] feat: add daily aux load --- README.md | 6 ++++-- dist/sunsynk-power-flow-card.js | 2 +- docs/examples/sunsynk.rst | 2 ++ src/defaults.ts | 1 + src/index.ts | 12 +++++++++++- src/localize/languages/en.json | 1 + src/types.ts | 1 + 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae873acc..d52b4355 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,8 @@ These attributes are only needed if `show_solar` is set to `true` | Attribute | Requirement | Default | Description | | --- | --- | --- |--- | |colour:| Optional |`'#5fb6ad'`| Changes the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional |`false` | Toggles the daily total. Only displayed if `show_aux` is set to `true` | +|show_daily: | Optional |`false` | Toggles the daily total. | +|show_daily_aux" | Optional |`false` | Toggles the daily AUX total. Only displayed if `show_aux` is set to `true` | |show_aux: | Optional | `false` | Toggles the display of AUX | |invert_aux: | Optional | `false` | Set to `true` if your sensor provides a positive number for AUX input and negative number for AUX output | |animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | @@ -177,7 +178,8 @@ See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Ma |day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | |day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | |day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | -|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh | +|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh) | +|day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) |inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter voltage (V) | |load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | |inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter vurrent (A) | diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 449da256..c05c2167 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));si[e]=new Date(ei.getTime()),si[e].setHours(s),si[e].setMinutes(n)}));const[ni,ii,ai,oi,li,ri]=si;function hi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Ln.charge="none":Ln.charge="both",Ln.capacity=parseInt(t.capacity.state),Ln.entityID=e}ei>=ri||ei=ni&&ei=ii&&ei=ai&&ei=oi&&ei=li&&ei0?En="off"===Ge.state||!1===Ln.show||parseInt(De.state)<=Ln.capacity?Le.battery.shutdown_soc:Ln.capacity:gn<0&&("off"===Ge.state||!1===Ln.show||parseInt(De.state)>=Ln.capacity?En=100:parseInt(De.state)0?Pn=(parseInt(De.state)-En)/100*Le.battery.energy/gn*60*60:gn<0&&(Pn=(En-parseInt(De.state))/100*Le.battery.energy/gn*60*60*-1);const di=new Date,ci=1e3*Pn,pi=new Date(di.getTime()+ci),vi=pi.getHours(),_i=pi.getMinutes().toString().padStart(2,"0"),yi=vi.toString().padStart(2,"0");Vn="".concat(yi,":").concat(_i);const gi=Math.floor(Pn/86400),xi=Math.floor(Pn%86400/3600),ui=Math.floor(Pn%3600/60);gi>0&&(In+="".concat(gi," days, ")),(xi>0||gi>0)&&(In+="".concat(xi," hrs, ")),In+="".concat(ui," min")}let Fn=!!(-2<=parseInt(cs.state)&&parseInt(cs.state)<=2&&parseInt(De.state)>=99),Bn="",Cn="",Sn="",Nn=!1;Sn="sunsynk"!==Le.inverter.model&&"lux"!==Le.inverter.model?"sunsynk":Le.inverter.model;let Rn=wt[Sn];for(const fi of Object.keys(Rn)){const mi=Rn[fi],{states:wi,color:qi,message:Ti}=mi;if(wi.includes(Xe.state)){Bn=qi,Cn=Ti,Nn=!0;break}}Nn||("none"!==(null===(N=Le.entities)||void 0===N?void 0:N.inverter_status_59)&&(null===(D=Le.entities)||void 0===D?void 0:D.inverter_status_59)?(Bn="transparent",Cn="Status"):(Bn="transparent",Cn=""));let jn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ee.state))?0:parseFloat(Ee.state)),Dn=(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),$n=0!=Dn?Math.min(Math.round(100*jn/Dn),100):0,On=0!=jn?Math.min(Math.round(100*Dn/jn),100):0,zn=mn+parseInt("".concat(gn>0?gn:0))+parseInt("".concat(As<0?-1*As:0)),Un=qn+Tn+parseInt("".concat(As>0?As:0))+parseInt("".concat(gn<0?-1*gn:0)),Yn=0!=Un?Math.min(Math.round(100*zn/Un),100):0,Wn=0!=zn?Math.min(Math.round(100*Un/zn),100):0,Qn=null===($=Le.solar)||void 0===$?void 0:$.animation_speed;if(Le&&Le.solar&&Le.solar.animation_speed){let ki=Le.solar.animation_speed-(Le.solar.animation_speed-1)*(mn/(Le.solar.max_power||mn));Qn=ki>=1?ki:1}let Gn=null===(O=Le.battery)||void 0===O?void 0:O.animation_speed;if(Le&&Le.battery&&Le.battery.animation_speed){let bi=Le.battery.animation_speed-(Le.battery.animation_speed-1)*((gn<0?-1*gn:gn)/(Le.battery.max_power||(gn<0?-1*gn:gn)));Gn=bi>=1?bi:1}let Xn=null===(z=Le.load)||void 0===z?void 0:z.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Mi=Le.load.animation_speed-(Le.load.animation_speed-1)*(qn/(Le.load.max_power||qn));Xn=Mi>=1?Mi:1}let Kn=null===(U=Le.load)||void 0===U?void 0:U.animation_speed;if(Le&&Le.load&&Le.load.animation_speed){let Ai=Le.load.animation_speed-(Le.load.animation_speed-1)*((parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))/(Le.load.max_power||(parseInt(ts.state)<0?-1*parseInt(ts.state):parseInt(ts.state))));Kn=Ai>=1?Ai:1}let Jn=null===(Y=Le.grid)||void 0===Y?void 0:Y.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Hi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*((parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))/(Le.grid.max_power||(parseInt(ze.state)<0?-1*parseInt(ze.state):parseInt(ze.state))));Jn=Hi>=1?Hi:1}let ti=null===(W=Le.grid)||void 0===W?void 0:W.animation_speed;if(Le&&Le.grid&&Le.grid.animation_speed){let Zi=Le.grid.animation_speed-(Le.grid.animation_speed-1)*(Tn/(Le.grid.max_power||Tn));ti=Zi>=1?Zi:1}return"full"===Le.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Es,Es,Ps,Vs,Fs,Fs,!1===cn?"".concat(xn):"100%",Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Fs,Ps,!1===Xs?"st12":"",Es,pn,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Fs,!1===Cs?"st12":"",1===Os?"":"none",Fs,!1===Cs?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",2===Os?"":"none",Fs,!1===Cs||1===Os?"st12":"",!1===Xs?"30":"143",Es,1===Ks?"":"none",!1===Xs?"376":"373",!1===Xs?"30":"143",Es,2===Ks?"":"none",!1===Xs?"413":"410",!1===Xs?"30":"143",Es,2===Ks?"":"none",Ps,!1===Xs?"none":"",1===Js||2===Js?"":"st12",Ps,!1===Xs?"none":"",2===Js?"":"st12",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,Fs,pn,Cn,1!==Ks&&2!==Ks||!0!==Xs?"":"none",Es,ut("common.essential"),0===Ks||!1===Xs?"none":"",Es,ut("common.essential"),!1===Xs?70:181,1===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?393:390,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load1_name,!1===Xs?429:426,!1===Xs?59:172,2===Ks?"":"none",Es,Le.load.load2_name,2===Js?"238":"306",!1===Is||!1===Xs?"transparent":"".concat(Es),ut("common.daily_load"),0===Ks?"377":"306",0===Ks?71:93,!1===Is||!0===Xs?"transparent":"".concat(Es),ut("common.daily_load"),!1===Gs||!1===Le.show_solar||"false"!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||"false"===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),!1===Cs?"311":"347",!1===Cs?"368":"253",!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Cs?"311":"347",!1===Cs?"337":"222",!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),Le.load.aux_name,!1===Cs?"none":"",Fs,Le.grid.nonessential_name,!1===Cs||0===Os||2===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load1_name,!1===Cs||0===Os||1===Os?"none":"",Fs,Le.grid.load2_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,1===Js?53:14,!1===Xs||0===Js?"none":"",Ps,Le.load.aux_load1_name,!1===Xs||0===Js||1===Js?"none":"",Ps,Le.load.aux_load2_name,Bn,!0===Xs?"":"none",1===Ks||2===Ks?"":"st12",Es,!1===Xs?"":"none",1===Ks?"":"st12",Es,!1===Xs?"":"none",2===Ks?"":"st12",Es,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn/2,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti/2,Fs,!1===Cs?"st12":"",!1===Cs?"st12":"",Tn<=0?"transparent":"".concat(Fs),ti,!1===Xs?"st12":"",Ps,!1===Xs||0===As?"st12":"",As<0?"transparent":"".concat(Ps),Kn,!1===Xs||0===As?"st12":"",As>0?"transparent":"".concat(Ps),Kn,!1===Xs?"st12":"",Ps,Fs,pn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,pn,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?"1":"0",Ys,parseInt(De.state)<=fn?1:0,Ys,!1===Le.show_solar?"st12":"",Qs,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,"default"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"oven"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"boiler"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"pump"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,"aircon"===nn?"1":"0",!1===Cs||2===Os||1===Os?"none":"",Fs,!1===Cs||2===Os||1===Os?"none":"",nn,"default"===an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"===an&&"default"!=on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"default"!=an&&"default"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"boiler"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"pump"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"oven"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,"aircon"===on?"1":"0",!1===Cs||0===Os||1===Os?"none":"",Fs,!1===Cs||0===Os||1===Os?"none":"",an,!1===Cs||0===Os||1===Os?"none":"",on,"default"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"boiler"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"pump"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"oven"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,"aircon"===an?"1":"0",!1===Cs||0===Os||2===Os?"none":"",Fs,!1===Cs||0===Os||2===Os?"none":"",an,1!==Ks&&2!==Ks||!1!==Xs?"none":"",Es,1!==Ks&&2!==Ks||!0!==Xs?"none":"",Es,1===Ks||2===Ks?"none":"",Es,(t=>this.handlePopup(t,Le.entities.aux_connected_status)),"default"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"gen"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"inverter"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"oven"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"boiler"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"aircon"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),"pump"===tn?"":"st12",!1===Xs||1===Js||2===Js?"none":"","".concat("on"===Ns||"1"===Ns?Ps:Vs),!1===Xs||1===Js||2===Js?"none":"",tn,"on"===Ns||"1"===Ns?"aux-icon":"aux-off-icon",!1===Xs||0===Js?"none":"",en,!1===Xs||1===Js||0===Js?"none":"",sn,"boiler"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"boiler"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"boiler"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"aircon"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"aircon"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"pump"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"pump"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"pump"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,"pump"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",!1===Xs||0===Ks||1===Ks?"none":"",Es,"oven"===ln&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===rn&&2===Ks&&!1===Xs?"1":"0",0===Ks||1===Ks?"none":"",Es,"oven"===ln&&1===Ks&&!1===Xs?"1":"0",0===Ks||2===Ks?"none":"",Es,"oven"===ln&&1===Ks?"1":"0",!1===Xs||0===Ks||2===Ks?"none":"",Es,0===Ks||1===Ks?"none":"",!0===Xs?"350":"383",!0===Xs?"140":"5",ln,0===Ks||1===Ks?"none":"",!0===Xs?"446":"420",!0===Xs?"140":"5",rn,0===Ks||2===Ks?"none":"","336",!0===Xs?"140":"27",ln,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"no"!=vn?"232":"249","on"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"232":"249","off"==ss.state&&"no"!==_n?"":"none",pn,"no"!=vn?"243":"260","on"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_on"),"no"!=vn?"243":"260","off"==ss.state&&"no"!==_n?"":"none",pn,ut("common.timer_off"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"none"!==Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,(t=>this.handlePopup(t,Le.entities.priority_load_243)),"no"!=vn?"251":"268","off"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"251":"268","on"===es.state&&"no"!==yn?"":"none",pn,"no"!=vn?"262":"280","on"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_load"),"no"!=vn?"262":"280","off"===es.state&&"no"!==yn?"":"none",pn,ut("common.priority_batt"),!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,"no"!=vn?"232":"249",!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||"false"===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Js?"238":"306",!1===Is||!1===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),0===Ks?"377":"306",0===Ks?"57":"80",!1===Is||!0===Xs?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===Cs?"311":"347",!1===Cs?"354":"239",!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Cs?"311":"347",!1===Cs?"323":"209",!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(null===(Q=Le.entities)||void 0===Q?void 0:Q.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(At||(At=e([' '," W "])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(G=Le.entities)||void 0===G?void 0:G.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(Zt||(Zt=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(X=Le.entities)||void 0===X?void 0:X.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.nonessential_power)),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0):j(Et||(Et=e([''," W "])),!1===Cs?"none":"",!1===dn?"st14":"st4",Fs,Tn||0),(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(null===(K=Le.entities)||void 0===K?void 0:K.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_power_166)),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As):j(Vt||(Vt=e([''," W "])),!1===dn?"st14":"st4",!1===Xs?"none":"",Ps,As<0?-1*As:As),(null===(J=Le.entities)||void 0===J?void 0:J.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(tt=Le.entities)||void 0===tt?void 0:tt.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(et=Le.entities)||void 0===et?void 0:et.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(st=Le.entities)||void 0===st?void 0:st.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(nt=Le.entities)||void 0===nt?void 0:nt.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)):j($t||($t=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js?"none":"",Ps,isNaN(parseFloat(ks.state))?"0":parseFloat(ks.state).toFixed(0)),(null===(it=Le.entities)||void 0===it?void 0:it.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.aux_load1)),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===dn?"st14":"st4",!1===Xs||0===Js||1===Js?"none":"",Ps,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Le.entities)||void 0===at?void 0:at.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Cs||0===Os||2===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(ot=Le.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load1)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(gs.state))?"0":parseFloat(gs.state).toFixed(0)),(null===(lt=Le.entities)||void 0===lt?void 0:lt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.non_essential_load2)),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Cs||0===Os||1===Os?"none":"",Fs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Le.entities)||void 0===rt?void 0:rt.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Xs?"47":"158",1===Ks?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Le.entities)||void 0===ht?void 0:ht.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Xs?"394":"391",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(dt=Le.entities)||void 0===dt?void 0:dt.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Xs?"430":"427",!1===Xs?"42":"154",2===Ks?"":"none",Es,isNaN(parseFloat(ws.state))?"0":parseFloat(ws.state).toFixed(0)),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",!1===dn?"st14":"st4",Fs,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",!1===dn?"st14":"st4",Fs,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",!1===dn?"st14":"st4",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.inverter_power_175)),"none"===Le.entities.inverter_power_175?"none":"",!1===dn?"st14":"st4",pn,Ke.state,(t=>this.handlePopup(t,Le.entities.grid_power_169)),"none"===Le.entities.grid_power_169?"none":"",!1===dn?"st14":"st4",Fs,Je.state,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(ct=Le.entities)||void 0===ct?void 0:ct.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),4===(null===(pt=Le.solar)||void 0===pt?void 0:pt.mppts)?137:158,4===(null===(vt=Le.solar)||void 0===vt?void 0:vt.mppts)?222:153,"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(_t=Le.entities)||void 0===_t?void 0:_t.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(yt=Le.entities)||void 0===yt?void 0:yt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(gt=Le.entities)||void 0===gt?void 0:gt.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement):"lite"===Le.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Es,!1===Le.show_solar?145.33:-.5,!1===Le.show_solar?270.67:406,"".concat(!1===cn?!1===Le.show_solar?"246px":"".concat(xn):!1===Le.show_solar?"75%":"100%"),Es,Qs,!1===Le.show_solar?"st12":"",Ys,Fs,Qs,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Es,1===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",Es,2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",0===Le.battery.energy||!0===Fn||0===gn?"transparent":"".concat(Ys),In,0===Le.battery.energy||gn<=0||!0===Fn?"transparent":"".concat(Ys),ut("common.runtime_to"),En,Vn,0===Le.battery.energy||gn>=0||!0===Fn?"transparent":"".concat(Ys),ut("common.to"),En,ut("common.charge"),Vn,0===Le.battery.energy||!1===Fn?"transparent":"".concat(Ys),ut("common.battery_floating"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_charge"),!1===Ws?"transparent":"".concat(Ys),ut("common.daily_discharge"),2===Ks?"365":"415",2===Ks?"182.2":"282.1",!1===Is?"transparent":"".concat(Es),ut("common.daily_load"),!1===zs?"transparent":"".concat(Fs),ut("common.daily_grid_buy"),!1===Us?"transparent":"".concat(Fs),ut("common.daily_grid_sell"),!1===Gs||!1===Le.show_solar||0!=hn?"transparent":"".concat(Qs),ut("common.daily_solar"),!1===Gs||!1===Le.show_solar||!1===hn?"transparent":"".concat(Qs),ut("common.daily_solar_left"),!1===Le.show_solar?"none":"",Qs,Le.solar.pv1_name,!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,Le.solar.pv2_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,Le.solar.pv3_name,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,Le.solar.pv4_name,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,$n,"no"===vn?"none":"","energy"===vn?"st4 st8 left-align":"st12",pn,On,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Yn,"no"===vn?"none":"","power"===vn?"st4 st8 left-align":"st12",pn,Wn,"no"===vn?"none":"",pn,"no"===vn?"none":"",pn,ut("common.ratio"),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",Es,(null===(xt=Le.load)||void 0===xt?void 0:xt.load1_name)?"".concat(Le.load.load1_name):"",2===Ks&&!0===Le.show_solar?"":"none",Es,(null===(ft=Le.load)||void 0===ft?void 0:ft.load2_name)?"".concat(Le.load.load2_name):"",Bn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts?"st12":"",parseInt(Ne.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"st12":"",parseInt(ls.state)<=0?"transparent":"".concat(Qs),Qn,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",Qs,!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Qs),Qn,Ys,gn<0||0===gn?"transparent":"".concat(Ys),Gn,gn>0||0===gn?"transparent":"".concat(Ys),Gn,!1===Le.show_solar?"st12":"",Qs,!1===Le.show_solar?"st12":"",0===mn?"transparent":"".concat(Qs),Qn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Fs,Zs<0||0===Zs?"transparent":"".concat(Fs),Jn,Zs>0||0===Zs?"transparent":"".concat(Fs),Jn,Es,0===qn?"transparent":"".concat(Es),Xn,Es,0===qn?"transparent":"".concat(Es),Xn,1===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,2===Ks&&!0===Le.show_solar?"":"st12",Es,"oven"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"oven"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"pump"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"aircon"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"!==ln||1!==Ks&&2!==Ks?"0":"1",0===Ks||!1===Le.show_solar?"none":"",Es,"boiler"===rn&&2===Ks?"1":"0",0===Ks||!1===Le.show_solar?"none":"",Es,0===Ks||!1===Le.show_solar?"none":"",ln,0===Ks||1===Ks||!1===Le.show_solar?"none":"",rn,!1===Le.show_solar?"st12":"",Qs,parseInt(De.state)>=un?1:0,Ys,parseInt(De.state)>=50&&parseInt(De.state)fn&&parseInt(De.state)<=49?1:0,Ys,parseInt(De.state)<=fn?1:0,Ys,(t=>this.handlePopup(t,Le.entities.grid_connected_status_194)),"off"===Ss||"0"===Ss?"st12":"",Fs,"on"===Ss||"1"===Ss?"st12":"",Bs,Es,pn,(t=>this.handlePopup(t,Le.entities.use_timer_248)),"on"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,"off"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_off"),"on"==ss.state&&!1!==_n?"":"none",pn,ut("common.timer_on"),(t=>this.handlePopup(t,Le.entities.priority_load_243)),"off"===es.state&&!1!==yn?"":"none",pn,"on"===es.state&&!1!==yn?"":"none",pn,"off"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_batt"),"on"===es.state&&!1!==yn?"":"none",pn,ut("common.priority_load"),(t=>this.handlePopup(t,Le.entities.solar_sell_247)),Le.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,Le.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Le.show_solar?"":"none",Qs,!1===Ls?"":"st12",(t=>this.handlePopup(t,Ln.entityID)),!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"st12":"",pn,!1===Ln.show||"none"===Le.entities.use_timer_248?"none":"","none"===Ln.charge?"":"st12",pn,(t=>this.handlePopup(t,Le.entities.day_battery_charge_70)),!1===Ws?"none":"",Ys,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||0!=hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_pv_energy_108)),!1===Gs||!1===Le.show_solar||!1===hn?"none":"",Qs,parseFloat(Fe.state).toFixed(1),hn,(t=>this.handlePopup(t,Le.entities.day_battery_discharge_71)),!1===Ws?"none":"",Ys,parseFloat(Ee.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_load_energy_84)),2===Ks?"365":"400.4",2===Ks?"168":"267.9",!1===Is?"none":"",Es,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_import_76)),!1===zs?"none":"",Fs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.day_grid_export_77)),!1===Us?"none":"",Fs,parseFloat(hs.state).toFixed(1),(t=>this.handlePopup(t,Le.entities.inverter_voltage_154)),"none"!==Le.entities.inverter_voltage_154&&Le.entities.inverter_voltage_154?"":"none",pn,js,(t=>this.handlePopup(t,Le.entities.load_frequency_192)),"none"!==Le.entities.load_frequency_192&&Le.entities.load_frequency_192?"":"none",pn,Rs,(t=>this.handlePopup(t,Le.entities.inverter_current_164)),"none"!==Le.entities.inverter_current_164&&Le.entities.inverter_current_164?"":"none",pn,Ds,(t=>this.handlePopup(t,Le.entities.battery_voltage_183)),"none"!==Le.entities.battery_voltage_183&&Le.entities.battery_voltage_183?"":"none",Ys,!1===dn?"st14":"st4",$s,(t=>this.handlePopup(t,Le.entities.battery_soc_184)),"none"===Le.entities.battery_soc_184?"none":"",Ys,parseInt(De.state),(t=>this.handlePopup(t,Le.entities.battery_soc_184)),Ys,!1===Ln.show||"none"===Le.entities.battery_soc_184?"none":"",Ln.capacity||0,(t=>this.handlePopup(t,Le.entities.battery_power_190)),"none"===Le.entities.battery_power_190?"none":"",Ys,!1===dn?"st14":"st4",gn<0?-1*gn:gn,(t=>this.handlePopup(t,Le.entities.battery_current_191)),"none"===Le.entities.battery_current_191?"none":"",Ys,!1===dn?"st14":"st4",cs.state,(t=>this.handlePopup(t,Le.entities.grid_ct_power_172)),"none"===Le.entities.grid_ct_power_172?"none":"",!1===dn?"st14":"st4",Fs,Zs||0,(t=>this.handlePopup(t,Le.entities.pv1_voltage_109)),!1!==Le.show_solar&&Le.entities.pv1_voltage_109&&"none"!==Le.entities.pv1_voltage_109?"":"none",Qs,Ue.state,(t=>this.handlePopup(t,Le.entities.pv1_current_110)),!1!==Le.show_solar&&Le.entities.pv1_current_110&&"none"!==Le.entities.pv1_current_110?"":"none",Qs,Ye.state,(t=>this.handlePopup(t,Le.entities.pv2_voltage_111)),!1!==Le.show_solar&&Le.entities.pv2_voltage_111&&"none"!==Le.entities.pv2_voltage_111&&1!==Le.solar.mppts?"":"none",Qs,We.state,(t=>this.handlePopup(t,Le.entities.pv2_current_112)),!1!==Le.show_solar&&Le.entities.pv2_current_112&&"none"!==Le.entities.pv2_current_112&&1!==Le.solar.mppts?"":"none",Qs,Qe.state,(t=>this.handlePopup(t,Le.entities.pv3_voltage_113)),!1!==Le.show_solar&&Le.entities.pv3_voltage_113&&"none"!==Le.entities.pv3_voltage_113&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,ns.state,(t=>this.handlePopup(t,Le.entities.pv3_current_114)),!1!==Le.show_solar&&Le.entities.pv3_current_114&&"none"!==Le.entities.pv3_current_114&&1!==Le.solar.mppts&&2!==Le.solar.mppts?"":"none",Qs,is.state,(t=>this.handlePopup(t,Le.entities.pv4_voltage_115)),!1!==Le.show_solar&&Le.entities.pv4_voltage_115&&"none"!==Le.entities.pv4_voltage_115&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,as.state,(t=>this.handlePopup(t,Le.entities.pv4_current_116)),!1!==Le.show_solar&&Le.entities.pv4_current_116&&"none"!==Le.entities.pv4_current_116&&1!==Le.solar.mppts&&2!==Le.solar.mppts&&3!==Le.solar.mppts?"":"none",Qs,os.state,(t=>this.handlePopup(t,Le.entities.battery_temp_182)),"none"===Le.entities.battery_temp_182?"st12":"st3 left-align",Ys,(null===(qt=Le.entities)||void 0===qt?void 0:qt.battery_temp_182)?"":"none",vs.state,(t=>this.handlePopup(t,Le.entities.radiator_temp_91)),"none"===Le.entities.radiator_temp_91?"st12":"st3 left-align",pn,(null===(Tt=Le.entities)||void 0===Tt?void 0:Tt.radiator_temp_91)?"":"none",ys.state,(t=>this.handlePopup(t,Le.entities.dc_transformer_temp_90)),"none"===Le.entities.dc_transformer_temp_90?"st12":"st3 left-align",pn,(null===(kt=Le.entities)||void 0===kt?void 0:kt.dc_transformer_temp_90)?"":"none",_s.state,(t=>this.handlePopup(t,Le.entities.energy_cost)),"none"===Le.entities.energy_cost?"st12":"st3 left-align",Fs,(null===(we=Le.entities)||void 0===we?void 0:we.energy_cost)?"":"none",parseFloat(fs.state).toFixed(2),fs.attributes.unit_of_measurement,(null===(qe=Le.entities)||void 0===qe?void 0:qe.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv_total)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0):j(oe||(oe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,wn||0),(null===(Te=Le.entities)||void 0===Te?void 0:Te.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv1_power_186)),!1===dn?"st14":"st4",!1===Le.show_solar?"none":"",Qs,parseFloat(Re.state).toFixed(0)):j(re||(re=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv1_power_186?"none":"",Qs,parseFloat(Re.state).toFixed(0)),(null===(ke=Le.entities)||void 0===ke?void 0:ke.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv2_power_187)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)):j(de||(de=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv2_power_187||1===Le.solar.mppts?"none":"",Qs,parseFloat(Ne.state).toFixed(0)),(null===(be=Le.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv3_power_188)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv3_power_188||1===Le.solar.mppts||2===Le.solar.mppts?"none":"",Qs,parseFloat(ls.state).toFixed(0)),(null===(Me=Le.entities)||void 0===Me?void 0:Me.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.pv4_power_189)),!1===dn?"st14":"st4",!1===Le.show_solar||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===dn?"st14":"st4",!1===Le.show_solar||"none"===Le.entities.pv4_power_189||1===Le.solar.mppts||2===Le.solar.mppts||3===Le.solar.mppts?"none":"",Qs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Le.entities)||void 0===Ae?void 0:Ae.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_power)),!1===dn?"st14":"st4",Es,qn||0):j(ge||(ge=e([''," W"])),!1===dn?"st14":"st4",Es,qn||0),(null===(He=Le.entities)||void 0===He?void 0:He.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load1)),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==Ks&&2!==Ks||!0!==Le.show_solar?"none":"",!1===dn?"st14":"st4",Es,isNaN(parseFloat(us.state))?0:parseFloat(us.state).toFixed(0)),(null===(Ze=Le.entities)||void 0===Ze?void 0:Ze.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Le.entities.essential_load2)),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0)):j(me||(me=e([''," W"])),2===Ks&&!0===Le.show_solar?"":"none",!1===dn?"st14":"st4",Es,isNaN(parseFloat(ws.state))?0:parseFloat(ws.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||"false"!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||"false"===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/docs/examples/sunsynk.rst b/docs/examples/sunsynk.rst index a5a1ebe8..53ae890f 100644 --- a/docs/examples/sunsynk.rst +++ b/docs/examples/sunsynk.rst @@ -199,6 +199,7 @@ Full Configuration (All Options) load: colour: '#5fb6ad' show_daily: true + show_daily_aux: true show_aux: true invert_aux: false aux_name: Generator @@ -242,6 +243,7 @@ Full Configuration (All Options) day_grid_import_76: sensor.sunsynk_day_grid_import day_grid_export_77: sensor.sunsynk_day_grid_export day_pv_energy_108: sensor.sunsynk_day_pv_energy + day_aux_energy: sensor.sunsynk_day_aux_energy inverter_voltage_154: sensor.sunsynk_inverter_voltage load_frequency_192: sensor.sunsynk_load_frequency inverter_current_164: sensor.sunsynk_inverter_current diff --git a/src/defaults.ts b/src/defaults.ts index 8c5afc9c..6509247b 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -39,6 +39,7 @@ export default { colour: '#5fb6ad', show_daily: false, show_aux: false, + show_daily_aux: false, invert_aux: false, animation_speed: 4, max_power: 8000, diff --git a/src/index.ts b/src/index.ts index dcf77f84..b0790b08 100644 --- a/src/index.ts +++ b/src/index.ts @@ -131,6 +131,7 @@ export class SunsynkPowerFlowCard extends LitElement { const stateObj47 = this.hass.states[config.entities.aux_connected_status] || { state: 'on' }; const stateObj48 = this.hass.states[config.entities.aux_load1] || { state: '0' }; const stateObj49 = this.hass.states[config.entities.aux_load2] || { state: '0' }; + const stateObj50 = this.hass.states[config.entities.day_aux_energy] || { state: '0' }; //Set defaults let { invert_aux } = config.load; @@ -164,6 +165,7 @@ export class SunsynkPowerFlowCard extends LitElement { let solar_colour = config.solar?.colour; let solar_showdaily = config.solar?.show_daily; let show_aux = config.load?.show_aux; + let show_dailyaux = config.load?.show_daily_aux; let additional_load = config.load?.additional_loads; if (!validLoadValues.includes(additional_load)) { @@ -465,6 +467,10 @@ export class SunsynkPowerFlowCard extends LitElement { color: ${aux_colour} !important; --mdc-icon-size: 70px; } + .aux-small-icon { + color: ${aux_colour} !important; + --mdc-icon-size: 24px; + } .aux-off-icon { color: ${aux_off_colour} !important; --mdc-icon-size: 70px; @@ -538,7 +544,8 @@ export class SunsynkPowerFlowCard extends LitElement { Ratio ${config.load.aux_load1_name} ${config.load.aux_load2_name} - + ${localize('common.daily_aux')} + @@ -872,6 +879,9 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_grid_export_77)}> ${parseFloat(stateObj33.state).toFixed(1)} kWh + this.handlePopup(e, config.entities.day_aux_energy)}> + ${parseFloat(stateObj50.state).toFixed(1)} kWh + ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 1ac4eecb..61796c4e 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -7,6 +7,7 @@ "charge": "CHARGE", "to": "TO", "daily_load": "DAILY LOAD", + "daily_aux": "DAILY AUX", "daily_grid_buy": "DAILY GRID BUY", "daily_grid_sell": "DAILY GRID SELL", "daily_solar": "DAILY SOLAR", diff --git a/src/types.ts b/src/types.ts index bc16007e..4a366213 100644 --- a/src/types.ts +++ b/src/types.ts @@ -62,6 +62,7 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig { load1_icon: string; load2_icon: string; show_aux: boolean; + show_daily_aux: boolean; } grid: { colour: string; From 93eea986f787b1f3899435b4537a46c04225ed03 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Thu, 17 Aug 2023 23:33:02 +0200 Subject: [PATCH 32/40] refactor: fix show_solar error --- dist/sunsynk-power-flow-card.js | 2 +- src/localize/languages/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index c05c2167..7d69dd60 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_style:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||"false"!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||"false"===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||"false"!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||"false"===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 61796c4e..f651a1bc 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -31,7 +31,7 @@ }, "errors": { "cardstyle": "Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite", - "show_style": "Please include the show_solar attribute e.g. show_solar: true", + "show_solar": "Please include the show_solar attribute e.g. show_solar: true", "battery": { "bat": "No battery attributes defined", "energy": "Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320", From a9f58bd212510256faca273a7230252ea9c97247 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Thu, 17 Aug 2023 23:51:44 +0200 Subject: [PATCH 33/40] fix: remaining_solar conditional check --- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 7d69dd60..fdb09db9 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||"false"!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||"false"===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||"false"===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index b0790b08..9267a27f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -525,8 +525,8 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.load.load2_name} ${localize('common.daily_load')} ${localize('common.daily_load')} - ${localize('common.daily_solar')} - ${localize('common.daily_solar_left')} + ${localize('common.daily_solar')} + ${localize('common.daily_solar_left')} ${localize('common.daily_charge')} ${localize('common.daily_discharge')} ${localize('common.daily_grid_buy')} @@ -856,10 +856,10 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1)} kWh From d6990e410cfbdcb98b768d9347cd8b79780e2f95 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Fri, 18 Aug 2023 00:27:36 +0200 Subject: [PATCH 34/40] fix: temperature positioning and styling --- dist/sunsynk-power-flow-card.js | 4 ++-- src/index.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index fdb09db9..40bbd0ea 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;u[x]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:u}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const m=window,w=m.trustedTypes,q=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class W{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=W.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=w?w.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=W.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new W(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class W{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=W.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=W.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new W(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),mi=Math.floor(Fn%86400/3600),wi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?137:158,4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?222:153,"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),"none"===Ee.entities.battery_temp_182?"st12":"st3 left-align",Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),"none"===Ee.entities.radiator_temp_91?"st12":"st3 left-align",yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),"none"===Ee.entities.dc_transformer_temp_90?"st12":"st3 left-align",yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),"none"===Ee.entities.energy_cost?"st12":"st3 left-align",Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=we({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const wt=[0,1,2],mt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,w=f&&f.exports===u,m=w&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=w?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=wt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=mt(t,s),r=mt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(w=l)&&At(w)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),wi=Math.floor(Fn%86400/3600),mi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(wi>0||fi>0)&&(Cn+="".concat(wi," hrs, ")),Cn+="".concat(mi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=mt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(wn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=mn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ws.state).toFixed(2),ws.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(wn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=mn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(me=Ee.entities)||void 0===me?void 0:me.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ws.state).toFixed(2),ws.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(we||(we=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=me({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 9267a27f..6dc398e2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1020,18 +1020,18 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.pv4_current_116)}> ${stateObj30.state} A - + this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state}° + ${stateObj37.state}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state}° + AC: ${stateObj39.state}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state}° + DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement} + ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement}
@@ -1301,16 +1301,16 @@ export class SunsynkPowerFlowCard extends LitElement { ${stateObj30.state} A this.handlePopup(e, config.entities.battery_temp_182)}> - ${stateObj37.state}° + ${stateObj37.state}° this.handlePopup(e, config.entities.radiator_temp_91)}> - AC: ${stateObj39.state}° + AC: ${stateObj39.state}° this.handlePopup(e, config.entities.dc_transformer_temp_90)}> - DC: ${stateObj38.state}° + DC: ${stateObj38.state}° this.handlePopup(e, config.entities.energy_cost)}> - ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement} + ${parseFloat(stateObj43.state).toFixed(2)} ${stateObj43.attributes.unit_of_measurement} ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> From 29d805c17858c6568ee4b1a7ee1ec1b5955481b7 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Fri, 18 Aug 2023 08:50:10 +0000 Subject: [PATCH 35/40] fix: error messages not functioning as expected --- .github/workflows/release.yml | 15 ++++++++++----- dist/sunsynk-power-flow-card.js | 4 ++-- src/index.ts | 30 ++++++++---------------------- src/localize/languages/en.json | 5 ++--- 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0f92a01..eb9e90c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,14 +44,19 @@ jobs: run: | const labelsInput = ${{ toJSON(github.event.pull_request.labels) }}; const currentVersion = ${{ steps.get-version.outputs.version }}; - const isMajor = labelsInput.some(label => label.name === 'semver/major'); - const isBreaking = labelsInput.some(label => label.name === 'type/breaking'); - const isFeature = labelsInput.some(label => label.name === 'type/feature'); + const isMajor = labelsInput.some(label => label.name === 'semver/major' || label.name === 'type/breaking'); + const isMinor = labelsInput.some(label => label.name === 'semver/minor' || label.name === 'type/feature); + const isPatch = labelsInput.some(label => label.name === 'semver/patch' || label.name === 'type/bug); + const isSemverValid = () => { - if (isMajor || isBreaking) { + if (isMajor) { return currentVersion.includes('0.0.0'); - } else if (isFeature) { + } else if (isMinor) { return currentVersion.includes('0.0.'); + } else if (isPatch) { + return currentVersion.includes('0.'); + } else { + return false } }; echo ::set-output name=is_valid::$(isSemverValid) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 40bbd0ea..f06062b9 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -15,7 +15,7 @@ const n=window,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&" * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var f;u[x]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:u}),(null!==(h=d.reactiveElementVersions)&&void 0!==h?h:d.reactiveElementVersions=[]).push("1.6.3");const w=window,m=w.trustedTypes,q=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,b="?"+k,M=`<${b}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,I=/>/g,F=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?F:'"'===r[3]?C:B):o===C||o===B?o=F:o===V||o===I?o=P:(o=F,i=void 0);const c=o===F&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+M:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class W{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=W.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=m?m.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=W.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new W(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;ot}):void 0,T="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,M="?"+k,b=`<${M}>`,A=document,H=()=>A.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,E="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,F=/>/g,I=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,C=/"/g,S=/^(?:script|style|textarea|title)$/i,N=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=N(1),j=N(2),D=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,z=A.createTreeWalker(A,129,null,!1);function U(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==q?q.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,n=[];let i,a=2===e?"":"",o=P;for(let e=0;e"===r[0]?(o=null!=i?i:P,h=-1):void 0===r[1]?h=-2:(h=o.lastIndex-r[2].length,l=r[1],o=void 0===r[3]?I:'"'===r[3]?C:B):o===C||o===B?o=I:o===V||o===F?o=P:(o=I,i=void 0);const c=o===I&&t[e+1].startsWith("/>")?" ":"";a+=o===P?s+b:h>=0?(n.push(l),s.slice(0,h)+T+s.slice(h)+k+c):s+k+(-2===h?(n.push(void 0),e):c)}return[U(t,a+(t[s]||"")+(2===e?"":"")),n]};class W{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,a=0;const o=t.length-1,l=this.parts,[r,h]=Y(t,e);if(this.el=W.createElement(r,s),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=z.nextNode())&&l.length0){n.textContent=w?w.emptyScript:"";for(let s=0;sL(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=W.createElement(U(n.h,n.h[0]),this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(s);else{const t=new G(i,this),e=t.u(this.options);t.v(s),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new W(t)),e}T(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new X(this.k(H()),this.k(H()),this,this.options)):s=e[n],s._$AI(i),n++;n2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,e,0),a=!Z(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const n=t;let o,l;for(t=i[0],o=0;o"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={cardstyle:"Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite",show_solar:"Please include the show_solar attribute e.g. show_solar: true",battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value."},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const wt=[0,1,2],mt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,w=f&&f.exports===u,m=w&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,b,M,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",I=Z.toString,F=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=w?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(b=Object.getPrototypeOf,M=Object,function(t){return b(M(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=I.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return I.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=wt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=mt(t,s),r=mt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=Mt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?Mt(l)?c=l:Pt(w=l)&&At(w)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var bt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},Mt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function It(t){return At(t)?nt(t,!0):vt(t)}var Ft,Bt=(Ft=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=Ft.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?In="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?In=100:parseInt($e.state)0?Fn=(parseInt($e.state)-In)/100*Ee.battery.energy/fn*60*60:fn<0&&(Fn=(In-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*Fn,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(Fn/86400),wi=Math.floor(Fn%86400/3600),mi=Math.floor(Fn%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(wi>0||fi>0)&&(Cn+="".concat(wi," hrs, ")),Cn+="".concat(mi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=mt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:bi,message:Mi}=Ti;if(ki.includes(Ke.state)){Nn=bi,Rn=Mi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Ie.state))?0:parseFloat(Ie.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=bn+Mn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(bn/(Ee.load.max_power||bn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(Mn/(Ee.grid.max_power||Mn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(bt||(bt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Is,Is,Fs,Cs,Cs,!1===_n?"".concat(wn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Is,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Is,!1===Js?"none":"",1===sn||2===sn?"":"st12",Is,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Is,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Is,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",Mn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Is,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Is),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Is),ei,!1===Js?"st12":"",Is,Cs,yn,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=mn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Is:Fs),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Is,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(Mt||(Mt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,Mn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Is,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(It||(It=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(Ft||(Ft=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Is,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Is,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ws.state).toFixed(2),ws.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(wn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),In,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),In,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===bn?"transparent":"".concat(Vs),ti,Vs,0===bn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=mn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ms.state&&"0"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ms.state&&"1"!==ms.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(me=Ee.entities)||void 0===me?void 0:me.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ws.state).toFixed(2),ws.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,bn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,bn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(we||(we=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.cardstyle)throw Error(ut("errors.cardstyle"));if(!t.show_solar)throw Error(ut("errors.show_solar"));if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172"];for(const s of e)if(!t.entities[s])throw new Error("Please include the ".concat(s," attribute and entity ID e.g. ").concat(s,": sensor.example"));const s=["pv1_power_186"];for(const e of s)if(!0===t.show_solar&&!t.entities[e])throw new Error("Please include the ".concat(e," attribute and entity ID e.g. ").concat(e,": sensor.example"));const n=JSON.parse(JSON.stringify(t));this._config=me({},ft,n)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Fs,!1===Js?"none":"",1===sn||2===sn?"":"st12",Fs,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Fs,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!1===Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 6dc398e2..96bfbb1c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -544,8 +544,8 @@ export class SunsynkPowerFlowCard extends LitElement { Ratio ${config.load.aux_load1_name} ${config.load.aux_load2_name} - ${localize('common.daily_aux')} - + ${localize('common.daily_aux')} + @@ -1020,7 +1020,7 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.pv4_current_116)}> ${stateObj30.state} A - + this.handlePopup(e, config.entities.battery_temp_182)}> ${stateObj37.state}° @@ -1085,7 +1085,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.ratio')} ${config.load?.load1_name ? `${config.load.load1_name}` : ''} ${config.load?.load2_name ? `${config.load.load2_name}` : ''} - + @@ -1360,12 +1360,7 @@ export class SunsynkPowerFlowCard extends LitElement { } setConfig(config) { - if (!config.cardstyle) { - throw Error(localize('errors.cardstyle')); - } - if (!config.show_solar) { - throw Error(localize('errors.show_solar')); - } + if (!config.battery) { throw Error(localize('errors.battery.bat')); } else { @@ -1409,22 +1404,13 @@ export class SunsynkPowerFlowCard extends LitElement { } const all_attributes = [ - 'battery_soc_184', 'battery_power_190', 'battery_current_191', 'grid_ct_power_172' + 'battery_soc_184', 'battery_power_190', 'battery_current_191', 'grid_ct_power_172', 'pv1_power_186' ]; for (const attr of all_attributes) { - if (!config.entities[attr]) { - throw new Error(`Please include the ${attr} attribute and entity ID e.g. ${attr}: sensor.example`); - } - } - - const solar_attributes = [ - 'pv1_power_186' - ]; - for (const attr1 of solar_attributes) { - if (config.show_solar === true && !config.entities[attr1]) { - throw new Error(`Please include the ${attr1} attribute and entity ID e.g. ${attr1}: sensor.example`); + if ((attr === 'pv1_power_186' && config.show_solar === true && !config.entities[attr]) && !config.entities[attr]) { + throw new Error(`${localize('errors.missing_entity')} e.g: ${attr}: sensor.example`); } } diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index f651a1bc..3f12a6cc 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -30,8 +30,6 @@ "essential": "Essential" }, "errors": { - "cardstyle": "Please include the cardstyle attribute and value; lite or full e.g. cardstyle: lite", - "show_solar": "Please include the show_solar attribute e.g. show_solar: true", "battery": { "bat": "No battery attributes defined", "energy": "Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320", @@ -49,6 +47,7 @@ "show_daily": "Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs" }, "essential_power": "The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.", - "nonessential_power": "The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value." + "nonessential_power": "The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.", + "missing_entity": "`Please include the attribute and entity ID" } } From 2021b3c2bead9fd095f20131bf5c040654f58714 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Fri, 18 Aug 2023 09:00:41 +0000 Subject: [PATCH 36/40] fix: show_aux not hidden correctly --- .github/workflows/HACS.yml | 6 +- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 142 ++++++++++++++++---------------- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/.github/workflows/HACS.yml b/.github/workflows/HACS.yml index cb129e86..5004036f 100644 --- a/.github/workflows/HACS.yml +++ b/.github/workflows/HACS.yml @@ -7,11 +7,11 @@ on: - cron: "0 0 * * *" jobs: - hacs: - name: HACS Action + validate-hacs: runs-on: "ubuntu-latest" steps: - - name: HACS Action + - uses: "actions/checkout@v3" + - name: HACS validation uses: "hacs/action@main" with: category: "plugin" diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index f06062b9..f917961a 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!1===Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!1===Js?"30":"143",Vs,1===en?"":"none",!1===Js?"376":"373",!1===Js?"30":"143",Vs,2===en?"":"none",!1===Js?"413":"410",!1===Js?"30":"143",Vs,2===en?"":"none",Fs,!1===Js?"none":"",1===sn||2===sn?"":"st12",Fs,!1===Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!1===Js?"none":"",Vs,ut("common.essential"),!1===Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!1===Js?393:390,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!1===Js?429:426,!1===Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!1===Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!1===Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!1===Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!1===Js?"":"none",1===en?"":"st12",Vs,!1===Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!1===Js?"st12":"",Fs,!1===Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!1===Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!1===Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!1!==Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!1===Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!1===Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!1===Js||0===sn?"none":"",an,!1===Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!1===Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!1===Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!1===Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!1===Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!1===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!1===Js||!1===tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!1===Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!1===Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!1===Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!1===Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!1===Js?"394":"391",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!1===Js?"430":"427",!1===Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!0!==Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!0!==Js?"30":"143",Vs,1===en?"":"none",!0!==Js?"376":"373",!0!==Js?"30":"143",Vs,2===en?"":"none",!0!==Js?"413":"410",!0!==Js?"30":"143",Vs,2===en?"":"none",Fs,!0!==Js?"none":"",1===sn||2===sn?"":"st12",Fs,!0!==Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!0!==Js?"none":"",Vs,ut("common.essential"),!0!==Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?393:390,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?429:426,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!0!==Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!0!==Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!0!==Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!0!==Js||!1===tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!0!==Js?"":"none",1===en?"":"st12",Vs,!0!==Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!0!==Js?"st12":"",Fs,!0!==Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!0!==Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!0!==Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!0===Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!0!==Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!0!==Js||0===sn?"none":"",an,!0!==Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!0!==Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!0!==Js||!1===tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!0!==Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 96bfbb1c..4f3ff2df 100644 --- a/src/index.ts +++ b/src/index.ts @@ -491,7 +491,7 @@ export class SunsynkPowerFlowCard extends LitElement { - + @@ -502,11 +502,11 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - + + + + + ${duration} ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} @@ -519,11 +519,11 @@ export class SunsynkPowerFlowCard extends LitElement { Grid ${inverterStateMsg} ${localize('common.essential')} - ${localize('common.essential')} - ${config.load.load1_name} - ${config.load.load1_name} - ${config.load.load2_name} - ${localize('common.daily_load')} + ${localize('common.essential')} + ${config.load.load1_name} + ${config.load.load1_name} + ${config.load.load2_name} + ${localize('common.daily_load')} ${localize('common.daily_load')} ${localize('common.daily_solar')} ${localize('common.daily_solar_left')} @@ -531,7 +531,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${localize('common.daily_discharge')} ${localize('common.daily_grid_buy')} ${localize('common.daily_grid_sell')} - ${config.load.aux_name} + ${config.load.aux_name} ${config.grid.nonessential_name} ${config.grid.load1_name} ${config.grid.load1_name} @@ -542,15 +542,15 @@ export class SunsynkPowerFlowCard extends LitElement { ${Ratiop}% Autarky Ratio - ${config.load.aux_load1_name} - ${config.load.aux_load2_name} - ${localize('common.daily_aux')} + ${config.load.aux_load1_name} + ${config.load.aux_load2_name} + ${localize('common.daily_aux')} - - + + @@ -626,18 +626,18 @@ export class SunsynkPowerFlowCard extends LitElement { - - + + - + - + @@ -726,21 +726,21 @@ export class SunsynkPowerFlowCard extends LitElement {
- + this.handlePopup(e, config.entities.aux_connected_status)}> - - - - - - - - - + + + + + + + + +
@@ -751,7 +751,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -761,7 +761,7 @@ export class SunsynkPowerFlowCard extends LitElement { - +
@@ -772,36 +772,36 @@ export class SunsynkPowerFlowCard extends LitElement { - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -862,7 +862,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1)} kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1)} kWh @@ -880,7 +880,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${parseFloat(stateObj33.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_aux_energy)}> - ${parseFloat(stateObj50.state).toFixed(1)} kWh + ${parseFloat(stateObj50.state).toFixed(1)} kWh ${config.entities?.pv_total @@ -903,9 +903,9 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.entities?.aux_power_166 ? svg` this.handlePopup(e, config.entities.aux_power_166)}> - ${aux_power < 0 ? aux_power * -1 : aux_power} W + ${aux_power < 0 ? aux_power * -1 : aux_power} W ` - : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} + : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities?.pv1_power_186 ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> ${parseFloat(stateObj9.state).toFixed(0)} W @@ -928,14 +928,14 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities?.aux_load1 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W`} ${config.entities?.aux_load2 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> ${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W @@ -953,19 +953,19 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${isNaN(parseFloat(stateObj41.state)) ? '0' : parseFloat(stateObj41.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load2 ? svg` this.handlePopup(e, config.entities.essential_load2)}> - ${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V From 775d58a96968b009091eb6c703b5ce2e91c13403 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Fri, 18 Aug 2023 14:19:01 +0200 Subject: [PATCH 37/40] fix: logic when default value is false --- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 168 ++++++++++++++++---------------- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index f917961a..8c795fef 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!1===_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!0!==Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!0!==Js?"30":"143",Vs,1===en?"":"none",!0!==Js?"376":"373",!0!==Js?"30":"143",Vs,2===en?"":"none",!0!==Js?"413":"410",!0!==Js?"30":"143",Vs,2===en?"":"none",Fs,!0!==Js?"none":"",1===sn||2===sn?"":"st12",Fs,!0!==Js?"none":"",2===sn?"":"st12",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!0!==Js?"none":"",Vs,ut("common.essential"),!0!==Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?393:390,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?429:426,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!1===Bs||!0!==Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!1===Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!0!==Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!0!==Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!0!==Js||!1===tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!0!==Js?"":"none",1===en?"":"st12",Vs,!0!==Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!0!==Js?"st12":"",Fs,!0!==Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!0!==Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!0!==Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!0===Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!0!==Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!0!==Js||0===sn?"none":"",an,!0!==Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!1===Bs||!0!==Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!1===Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!0!==Js||!1===tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['
\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!1===vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!1===vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!1===vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!1===vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!1===vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!1===vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!0!==Js?"47":"158",1===en?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!1===vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!1===vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!1===vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!1===vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!1===vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!1===Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!1===Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!1===Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!1===Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!1===Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!1===Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!1===Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!1===vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!1===vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!1===vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!1===vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!1===vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!1===vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!1===vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!1===vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!1===vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!1===vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!0!==_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!0!==Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!0!==Js?"30":"143",Vs,1===en?"":"none",!0!==Js?"376":"373",!0!==Js?"30":"143",Vs,2===en?"":"none",!0!==Js?"413":"410",!0!==Js?"30":"143",Vs,2===en?"":"none",Fs,!0!==Js?"none":"",1===sn||2===sn?"":"st12",Fs,!0!==Js?"none":"",2===sn?"":"st12",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!0!==Js?"none":"",Vs,ut("common.essential"),!0!==Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?393:390,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?429:426,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!0!==Bs||!0!==Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!0!==Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!0!==Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!0!==Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!0!==Js?"":"none",1===en?"":"st12",Vs,!0!==Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!0!==Js?"st12":"",Fs,!0!==Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!0!==Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!0!==Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!0===Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!0!==Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!0!==Js||0===sn?"none":"",an,!0!==Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!0!==Bs||!0!==Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!0!==Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!0!==vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!0!==vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!0!==vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!0!==vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!0!==vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 4f3ff2df..12239c3c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -486,7 +486,7 @@ export class SunsynkPowerFlowCard extends LitElement {
- + @@ -508,7 +508,7 @@ export class SunsynkPowerFlowCard extends LitElement { - ${duration} + ${duration} ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} ${localize('common.battery_floating')} @@ -523,14 +523,14 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.load.load1_name} ${config.load.load1_name} ${config.load.load2_name} - ${localize('common.daily_load')} - ${localize('common.daily_load')} - ${localize('common.daily_solar')} - ${localize('common.daily_solar_left')} - ${localize('common.daily_charge')} - ${localize('common.daily_discharge')} - ${localize('common.daily_grid_buy')} - ${localize('common.daily_grid_sell')} + ${localize('common.daily_load')} + ${localize('common.daily_load')} + ${localize('common.daily_solar')} + ${localize('common.daily_solar_left')} + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} ${config.load.aux_name} ${config.grid.nonessential_name} ${config.grid.load1_name} @@ -544,7 +544,7 @@ export class SunsynkPowerFlowCard extends LitElement { Ratio ${config.load.aux_load1_name} ${config.load.aux_load2_name} - ${localize('common.daily_aux')} + ${localize('common.daily_aux')} @@ -856,86 +856,86 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1)} kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> - ${parseFloat(stateObj2.state).toFixed(1)} kWh + ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1)} kWh + ${parseFloat(stateObj1.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1)} kWh + ${parseFloat(stateObj.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1)} kWh + ${parseFloat(stateObj3.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1)} kWh + ${parseFloat(stateObj33.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_aux_energy)}> - ${parseFloat(stateObj50.state).toFixed(1)} kWh + ${parseFloat(stateObj50.state).toFixed(1)} kWh ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv || 0} W + ${total_pv || 0} W ` - : svg` ${total_pv || 0} W `} + : svg` ${total_pv || 0} W `} ${config.entities?.essential_power ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential || 0} W + ${essential || 0} W ` - : svg`${essential || 0} W`} + : svg`${essential || 0} W`} ${config.entities?.nonessential_power ? svg` this.handlePopup(e, config.entities.nonessential_power)}> - ${nonessential || 0} W + ${nonessential || 0} W ` - : svg`${nonessential || 0} W `} + : svg`${nonessential || 0} W `} this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power || 0} W + ${grid_power || 0} W ${config.entities?.aux_power_166 ? svg` this.handlePopup(e, config.entities.aux_power_166)}> - ${aux_power < 0 ? aux_power * -1 : aux_power} W + ${aux_power < 0 ? aux_power * -1 : aux_power} W ` - : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} + : svg`${aux_power < 0 ? aux_power * -1 : aux_power} W `} ${config.entities?.pv1_power_186 ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0)} W + ${parseFloat(stateObj9.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} ${config.entities?.pv2_power_187 ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0)} W + ${parseFloat(stateObj8.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} ${config.entities?.pv3_power_188 ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0)} W + ${parseFloat(stateObj31.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} ${config.entities?.pv4_power_189 ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0)} W + ${parseFloat(stateObj32.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities?.aux_load1 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj48.state)) ? '0' : parseFloat(stateObj48.state).toFixed(0)} W`} ${config.entities?.aux_load2 ? svg` this.handlePopup(e, config.entities.aux_load1)}> - ${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj49.state)) ? '0' : parseFloat(stateObj49.state).toFixed(0)} W`} ${config.entities?.non_essential_load1 ? svg` this.handlePopup(e, config.entities.non_essential_load1)}> ${isNaN(parseFloat(stateObj40.state)) ? '0' : parseFloat(stateObj40.state).toFixed(0)} W @@ -953,9 +953,9 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${isNaN(parseFloat(stateObj41.state)) ? '0' : parseFloat(stateObj41.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> ${isNaN(parseFloat(stateObj42.state)) ? '0' : parseFloat(stateObj42.state).toFixed(0)} W @@ -968,16 +968,16 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${isNaN(parseFloat(stateObj45.state)) ? '0' : parseFloat(stateObj45.state).toFixed(0)} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> - ${inverter_voltage} V + ${inverter_voltage} V this.handlePopup(e, config.entities.load_frequency_192)}> - ${load_frequency} Hz + ${load_frequency} Hz this.handlePopup(e, config.entities.inverter_current_164)}> - ${inverter_current} A + ${inverter_current} A this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V + ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> ${parseInt(stateObj12.state)} % @@ -986,16 +986,16 @@ export class SunsynkPowerFlowCard extends LitElement { | ${inverter_prog.capacity || 0} % this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < 0 ? battery_power * -1 : battery_power} W + ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state} A + ${stateObj35.state} A this.handlePopup(e, config.entities.inverter_power_175)}> - ${stateObj22.state} W + ${stateObj22.state} W this.handlePopup(e, config.entities.grid_power_169)}> - ${stateObj23.state} W + ${stateObj23.state} W this.handlePopup(e, config.entities.pv1_voltage_109)}> ${stateObj16.state} V @@ -1062,17 +1062,17 @@ export class SunsynkPowerFlowCard extends LitElement { - ${duration} + ${duration} ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} ${localize('common.to')} ${battery_capacity}% ${localize('common.charge')} @${formattedResultTime} ${localize('common.battery_floating')} - ${localize('common.daily_charge')} - ${localize('common.daily_discharge')} + ${localize('common.daily_charge')} + ${localize('common.daily_discharge')} ${localize('common.daily_load')} - ${localize('common.daily_grid_buy')} - ${localize('common.daily_grid_sell')} - ${localize('common.daily_solar')} - ${localize('common.daily_solar_left')} + ${localize('common.daily_grid_buy')} + ${localize('common.daily_grid_sell')} + ${localize('common.daily_solar')} + ${localize('common.daily_solar_left')} ${config.solar.pv1_name} ${config.solar.pv2_name} ${config.solar.pv3_name} @@ -1229,25 +1229,25 @@ export class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.day_battery_charge_70)}> - ${parseFloat(stateObj1.state).toFixed(1)} kWh + ${parseFloat(stateObj1.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_pv_energy_108)}> - ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh + ${parseFloat(stateObj4.state).toFixed(1)} kWh / ${remaining_solar} kWh this.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${parseFloat(stateObj.state).toFixed(1)} kWh + ${parseFloat(stateObj.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_import_76)}> - ${parseFloat(stateObj3.state).toFixed(1)} kWh + ${parseFloat(stateObj3.state).toFixed(1)} kWh this.handlePopup(e, config.entities.day_grid_export_77)}> - ${parseFloat(stateObj33.state).toFixed(1)} kWh + ${parseFloat(stateObj33.state).toFixed(1)} kWh this.handlePopup(e, config.entities.inverter_voltage_154)}> ${inverter_voltage} V @@ -1259,7 +1259,7 @@ export class SunsynkPowerFlowCard extends LitElement { ${inverter_current} A this.handlePopup(e, config.entities.battery_voltage_183)}> - ${battery_voltage} V + ${battery_voltage} V this.handlePopup(e, config.entities.battery_soc_184)}> ${parseInt(stateObj12.state)} % @@ -1268,13 +1268,13 @@ export class SunsynkPowerFlowCard extends LitElement { | ${inverter_prog.capacity || 0} % this.handlePopup(e, config.entities.battery_power_190)}> - ${battery_power < 0 ? battery_power * -1 : battery_power} W + ${battery_power < 0 ? battery_power * -1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> - ${stateObj35.state} A + ${stateObj35.state} A this.handlePopup(e, config.entities.grid_ct_power_172)}> - ${grid_power || 0} W + ${grid_power || 0} W this.handlePopup(e, config.entities.pv1_voltage_109)}> ${stateObj16.state} V @@ -1314,44 +1314,44 @@ export class SunsynkPowerFlowCard extends LitElement { ${config.entities?.pv_total ? svg` this.handlePopup(e, config.entities.pv_total)}> - ${total_pv || 0} W + ${total_pv || 0} W ` - : svg`${total_pv || 0} W`} + : svg`${total_pv || 0} W`} ${config.entities?.pv1_power_186 ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${parseFloat(stateObj9.state).toFixed(0)} W + ${parseFloat(stateObj9.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0)} W`} ${config.entities?.pv2_power_187 ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${parseFloat(stateObj8.state).toFixed(0)} W + ${parseFloat(stateObj8.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0)} W`} ${config.entities?.pv3_power_188 ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${parseFloat(stateObj31.state).toFixed(0)} W + ${parseFloat(stateObj31.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0)} W`} ${config.entities?.pv4_power_189 ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${parseFloat(stateObj32.state).toFixed(0)} W + ${parseFloat(stateObj32.state).toFixed(0)} W ` - : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0)} W`} ${config.entities?.essential_power ? svg` this.handlePopup(e, config.entities.essential_power)}> - ${essential || 0} W + ${essential || 0} W ` - : svg`${essential || 0} W`} + : svg`${essential || 0} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load2 ? svg` this.handlePopup(e, config.entities.essential_load2)}> - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W`}
From 6a163276d7de29ea9eb019299fdb7a27dd7f4ab9 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Fri, 18 Aug 2023 12:27:49 +0000 Subject: [PATCH 38/40] docs: update documentation --- .devcontainer/recommended-devcontainer.json | 3 +- README.md | 194 ------------------- docs/_templates/layout.html | 22 +++ docs/configuration.md | 198 ++++++++++++++++++++ docs/contribute/bugs.rst | 15 +- docs/toc.rst | 9 +- 6 files changed, 229 insertions(+), 212 deletions(-) create mode 100644 docs/_templates/layout.html create mode 100644 docs/configuration.md diff --git a/.devcontainer/recommended-devcontainer.json b/.devcontainer/recommended-devcontainer.json index e082be7e..6a6c24e5 100644 --- a/.devcontainer/recommended-devcontainer.json +++ b/.devcontainer/recommended-devcontainer.json @@ -24,7 +24,8 @@ "ms-python.python", "tht13.html-preview-vscode", "sourcery.sourcery", - "tabnine.tabnine-vscode" + "tabnine.tabnine-vscode", + "trond-snekvik.simple-rst" ] } }, diff --git a/README.md b/README.md index d52b4355..daad9b0f 100644 --- a/README.md +++ b/README.md @@ -58,197 +58,3 @@ Add the `Custom: Sunsynk Power Flow Card` to your Dashboard view. ![image](https://user-images.githubusercontent.com/7227275/235375690-65d17663-e117-4626-9151-1a41979a13b8.png) -### Card Options - -The card can be configured through the following attributes: - -| Attribute | Requirement | Default |Description | -| --- | --- | --- | --- | -|type: | **Required** | `custom:sunsynk-power-flow-card`| The custom card | -|cardstyle: | **Required** | `lite` | Selects the card layout that is used `lite` or `full` | -|panel_mode:| Optional | `false` |Toggles panel mode removing any card height restrictions. For use with Panel(1 card) view types or grid layouts| -|large_font:| Optional | `false` | Increases font size of sensor data | -|show_solar:|**Required** |`true` | Toggle display of solar information | -|card_height:| Optional | `396px` | Sets the card height in pixels `400px` | -|inverter: | Optional | See optional [Inverter](#inverter) attributes below |List of inverter attributes. | -|battery: | **Required** |See required [Battery](#battery) attributes below | List of battery attributes. | -|solar: | Optional |See optional [Solar](#solar) attributes below | List of solar attributes. | -|load: | Optional | See optional [Load](#load) attributes below|List of load attributes. | -|grid: | Optional | See optional [Grid](#grid) attributes below| List of grid attributes. | -|entities:|**Required** |See required [Entities](#entities) attributes below | List of sensor entities. | - -### Inverter - -| Attribute | Requirement |Default | Description | -| --- | --- | --- |--- | -|modern:| Optional |`true`| Changes the inverter image.| -|colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| -| model: | Optional | `sunsynk` | Set to `lux` for Lux inverters, states overlap so require this setting.
NOTE: this still needs work as I don't have all Lux states | - -### Battery - -Note that the card will always display battery power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. - -| Attribute | Requirement |Default | Description | -| --- | --- | --- |--- | -|energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| -|shutdown_soc: | **Required** | `20` |The battery shutdown percentage used to calculate remaining runtime | -|invert_power:| Optional | `false`|Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge| -|colour:| Optional| `pink`| Changes the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional| `false` | Toggles the daily total | -|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | -|max_power: | Optional | `4500` | Maximum power draw to calculate animation speed | -|full_capacity: | Optional| `80` | If SOC >= to this value the fully charged battery image will be shown. Accepts any value between 80-100| -|empty_capacity: | Optional | `30` | If SOC <= to this value the empty battery image will be shown. Accepts any value between 1-30 - -### Solar - -These attributes are only needed if `show_solar` is set to `true` -| Attribute | Requirement |Default | Description | -| --- | --- | --- |--- | -|colour:| Optional | `orange` | Changes the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional | `false` | Toggles the daily total | -|mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3` or `4` | -|animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | -|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | -|pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | -|pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | -|pv3_name: | Optional | `PV3` | Set the disaply name for MPPT3 | -|pv4_name: | Optional | `PV4` | Set the disaply name for MPPT4 | - -### Load - -| Attribute | Requirement | Default | Description | -| --- | --- | --- |--- | -|colour:| Optional |`'#5fb6ad'`| Changes the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|show_daily: | Optional |`false` | Toggles the daily total. | -|show_daily_aux" | Optional |`false` | Toggles the daily AUX total. Only displayed if `show_aux` is set to `true` | -|show_aux: | Optional | `false` | Toggles the display of AUX | -|invert_aux: | Optional | `false` | Set to `true` if your sensor provides a positive number for AUX input and negative number for AUX output | -|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | -|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | -|aux_name: | Optional | `Auxilary` | Set the display name for the AUX Load -|aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. -|aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|aux_loads:| Optional | `0` | Display additional loads on the AUX side (`0/1/2`) -|aux_load1_name: |Optional | | Set the display name for the AUX load 1 -|aux_load2_name: |Optional | | Set the display name for the AUX load 2 -|aux_load1_icon: | Optional | | Change the AUX load 1 image using any mdi icon e.g. `mdi:ev-station` -|aux_load2_icon: | Optional | | Change the AUX load 2 image using any mdi icon e.g. `mdi:ev-station` -|additional_loads: | Optional | `0` | Display additional loads on the essential side (`0/1/2`) -|load1_name: | Optional | | Set the display name for the essential load 1 -|load2_name: | Optional | | Set the display name for the essential load 2 -|load1_icon: | Optional | none | Change the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | -|load2_icon: | Optional | none | Change the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | - -### Grid - -| Attribute | Requirement | Default | Description | -| --- | --- | --- | --- | -|colour:| Optional | `'#5490c2'`| Changes the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -|no_grid_colour:| Optional | `'#a40013'`|Changes the colour of the grid disconnected icon. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc)| -|show_daily_buy: | Optional | `false` | Toggles the daily buy total | -|show_daily_sell: | Optional | `false` | Toggles the daily sell total | -|show_nonessential: | Optional |`false` | Toggles the display of non-essential | -|nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| -|nonessential_name: | Optional | `Non Essential` |Set the display name for the non-essential load -|additional_loads: | Optional |`0`| Toggle the display of additional loads on the non-essential side (`0/1/2`) -|load1_name: | Optional | | Set the display name for the non-essential load 1 -|load2_name: | Optional | |Set the display name for the non-essential load 2 -|load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | -|load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | -|invert_grid:| Optional | `false`| Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | -|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | -|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | - -### Entities - -Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. It is important that your sensors read the expected modbus register value. If you have missing sensors for any attribute set it to none i.e. `day_pv_energy_108: none`. This will hide the sensor data from the card. To display a placeholder with a default value of 0 set it to `zero` or any other value i.e. `solarday_108: zero`. - -See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor mappings if using other integration methods. - -| Attribute | Requirement | Default | Description | -| --- | --- | --- | --- | -|use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | -|priority_load_243: | Optional |`switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide| -|day_battery_discharge_71: | Optional |`ssensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | -|day_battery_charge_70: | Optional |`sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | -|day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | -|day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | -|day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | -|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh) | -|day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) -|inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter voltage (V) | -|load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | -|inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter vurrent (A) | -|inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). Required if the essential_power attribute is set to `none` | -|grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | -|pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W)| -|pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | -|pv3_power_188: | Optional | `sensor.sunsynk_pv3_power` | PV string 3 power (W) | -|pv4_power_189: | Optional | `sensor.sunsynk_pv4_power` | PV string 4 power (W) | -|pv_total:| Optional | `none` | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-4 power (W) -|battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | -|battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | -|battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | -|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery current (A) | -|essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant. (W) | -|essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W)| -|essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W)| -|nonessential_power| Optional | `none`| The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures non-essential power e.g. `Load power Non-Essential` in the case of Solar Assistant. (W) -|non_essential_load1: | Optional | |Sensor that contains the power of your non-essential load 1 (W)| -|non_essential_load2: | Optional | |Sensor that contains the power of your non-essential load 2 (W) -|grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT power (W)| -|pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | -|pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A)| -|pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V)| -|pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A)| -|pv3_voltage_113: | Optional | `sensor.sunsynk_pv3_voltage` | PV string 3 voltage (V) | -|pv3_current_114: | Optional | `sensor.sunsynk_pv3_current` | PV string 3 current (A)| -|pv4_voltage_115: | Optional | `sensor.sunsynk_pv4_voltage` | PV string 4 voltage (V)| -|pv4_current_116: | Optional | `sensor.sunsynk_pv4_current` | PV string 4 current (A)| -|grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status `on/off` or `1/0` | -|inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Inverter status `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault` | -|aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary power (W) | -|aux_load1:| Optional | | Sensor that contains the power of your AUX load 1 (W) | -|aux_load2:| Optional | | Sensor that contains the power of your AUX load 2 (W) | -|aux_connected_status: |Optional | None | AUX Connected Status `on/off` or `1/0` -|remaining_solar: | Optional | `sensor.solcast_forecast_remaining_today`| The remaining solar forecast for the day (kWh) | -|battery_temp_182:| Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (℃)| -|radiator_temp_91:| Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃)| -|dc_transformer_temp_90:| Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃)| -|prog1_time:| Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) -|prog1_capacity:| Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting -|prog1_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|prog2_time:| Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) -|prog2_capacity:| Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting -|prog2_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|prog3_time:| Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) -|prog3_capacity:| Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting -|prog3_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|prog4_time:| Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) -|prog4_capacity:| Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting -|prog4_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|prog5_time:| Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) -|prog5_capacity:| Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting -|prog5_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|prog6_time:| Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) -|prog6_capacity:| Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting -|prog6_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) -|energy_cost:| Optional | | Sensor that provides current energy cost per kWh -|solar_sell_247:|Optional | `switch.sunsynk_toggle_solar_sell` | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) - -The card calculates the sensors below based on supplied attributes in the config so you dont need to define them in Home Assistant. NOTE if your essential and non-essential readings are innacurate replace sensor 169 with 167. Alternatively provide the card with sensors that calculate this data i.e essential_power: and nonessential_power: - - ``` - totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 - nonessential = grid_ct_power_172 - grid_power_169 - essential = inverter_power_175 + grid_power_169 - aux_power_166 - ``` - -The modbus registers can be visualised on the `full` card below: - -![image](https://user-images.githubusercontent.com/7227275/235479493-b322d5b2-f2b1-431f-9048-f845fc2989b4.png) - diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 00000000..918ac7f9 --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,22 @@ +{% extends "!layout.html" %} + {% block footer %} {{ super() }} + + + +{% endblock %} diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..708e7027 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,198 @@ +--- +myst: + enable_extensions: ["colon_fence"] +--- + +# Configuration + +The card can be configured through the following attributes: + +| Attribute | Requirement | Default |Description | +| --- | --- | --- | --- | +|type: | **Required** | `custom:sunsynk-power-flow-card`| The custom card | +|cardstyle: | **Required** | `lite` | Selects the card layout that is used `lite` or `full` | +|panel_mode:| Optional | `false` |Toggles panel mode removing any card height restrictions. For use with Panel(1 card) view types or grid layouts| +|large_font:| Optional | `false` | Increases font size of sensor data | +|show_solar:|**Required** |`true` | Toggle display of solar information | +|card_height:| Optional | `396px` | Sets the card height in pixels `400px` | +|inverter: | Optional | See optional [Inverter](#inverter) attributes below |List of inverter attributes. | +|battery: | **Required** |See required [Battery](#battery) attributes below | List of battery attributes. | +|solar: | Optional |See optional [Solar](#solar) attributes below | List of solar attributes. | +|load: | Optional | See optional [Load](#load) attributes below|List of load attributes. | +|grid: | Optional | See optional [Grid](#grid) attributes below| List of grid attributes. | +|entities:|**Required** |See required [Entities](#entities) attributes below | List of sensor entities. | + +### Inverter + +| Attribute | Requirement |Default | Description | +| --- | --- | --- |--- | +|modern:| Optional |`true`| Changes the inverter image.| +|colour:| Optional |`grey`| Changes the colour of the inverter. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|autarky:| Optional| `power`| Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
| +| model: | Optional | `sunsynk` | Selects which status codes to use. Set to `lux` for Lux inverters. | + +### Battery + +Note that the card will always display battery power as a positive number regardless of your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. + +| Attribute | Requirement |Default | Description | +| --- | --- | --- |--- | +|energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden| +|shutdown_soc: | **Required** | `20` |The battery shutdown percentage used to calculate remaining runtime | +|invert_power:| Optional | `false`|Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge| +|colour:| Optional| `pink`| Changes the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|show_daily: | Optional| `false` | Toggles the daily total | +|animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | +|max_power: | Optional | `4500` | Maximum power draw to calculate animation speed | +|full_capacity: | Optional| `80` | If SOC >= to this value the fully charged battery image will be shown. Accepts any value between 80-100| +|empty_capacity: | Optional | `30` | If SOC <= to this value the empty battery image will be shown. Accepts any value between 1-30 + +### Solar + +These attributes are only needed if `show_solar` is set to `true` +| Attribute | Requirement |Default | Description | +| --- | --- | --- |--- | +|colour:| Optional | `orange` | Changes the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|show_daily: | Optional | `false` | Toggles the daily total | +|mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3` or `4` | +|animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | +|pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | +|pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | +|pv3_name: | Optional | `PV3` | Set the disaply name for MPPT3 | +|pv4_name: | Optional | `PV4` | Set the disaply name for MPPT4 | + +### Load + +| Attribute | Requirement | Default | Description | +| --- | --- | --- |--- | +|colour:| Optional |`'#5fb6ad'`| Changes the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|show_daily: | Optional |`false` | Toggles the daily total. | +|show_daily_aux" | Optional |`false` | Toggles the daily AUX total. Only displayed if `show_aux` is set to `true` | +|show_aux: | Optional | `false` | Toggles the display of AUX | +|invert_aux: | Optional | `false` | Set to `true` if your sensor provides a positive number for AUX input and negative number for AUX output | +|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | +|aux_name: | Optional | `Auxilary` | Set the display name for the AUX Load +|aux_type: | Optional | `default` | Changes the AUX image using preset or any mdi icon e.g. `mdi:ev-station`. Presets are: `gen`, `inverter` `default`, `oven`, `pump`, `aircon` and `boiler`. +|aux_colour:| Optional | `the load colour` | Changes the colour of all the AUX card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|aux_off_colour:| Optional| `the load colour` | Changes the colour of the AUX icon and label when disconnected. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|aux_loads:| Optional | `0` | Display additional loads on the AUX side (`0/1/2`) +|aux_load1_name: |Optional | | Set the display name for the AUX load 1 +|aux_load2_name: |Optional | | Set the display name for the AUX load 2 +|aux_load1_icon: | Optional | | Change the AUX load 1 image using any mdi icon e.g. `mdi:ev-station` +|aux_load2_icon: | Optional | | Change the AUX load 2 image using any mdi icon e.g. `mdi:ev-station` +|additional_loads: | Optional | `0` | Display additional loads on the essential side (`0/1/2`) +|load1_name: | Optional | | Set the display name for the essential load 1 +|load2_name: | Optional | | Set the display name for the essential load 2 +|load1_icon: | Optional | none | Change the essential load 1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | +|load2_icon: | Optional | none | Change the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven` | + +### Grid + +| Attribute | Requirement | Default | Description | +| --- | --- | --- | --- | +|colour:| Optional | `'#5490c2'`| Changes the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +|no_grid_colour:| Optional | `'#a40013'`|Changes the colour of the grid disconnected icon. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc)| +|show_daily_buy: | Optional | `false` | Toggles the daily buy total | +|show_daily_sell: | Optional | `false` | Toggles the daily sell total | +|show_nonessential: | Optional |`false` | Toggles the display of non-essential | +|nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| +|nonessential_name: | Optional | `Non Essential` |Set the display name for the non-essential load +|additional_loads: | Optional |`0`| Toggle the display of additional loads on the non-essential side (`0/1/2`) +|load1_name: | Optional | | Set the display name for the non-essential load 1 +|load2_name: | Optional | |Set the display name for the non-essential load 2 +|load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | +|load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` | +|invert_grid:| Optional | `false`| Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | +|animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | +|max_power: | Optional | `8000` | Maximum power draw to calculate animation speed | + +### Entities + +Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. It is important that your sensors read the expected modbus register value. If you have missing sensors for any attribute set it to none i.e. `day_pv_energy_108: none`. This will hide the sensor data from the card. To display a placeholder with a default value of 0 set it to `zero` or any other value i.e. `solarday_108: zero`. + +See the [WIKI](https://github.com/slipx06/sunsynk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor mappings if using other integration methods. + +| Attribute | Requirement | Default | Description | +| --- | --- | --- | --- | +|use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | +|priority_load_243: | Optional |`switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide| +|day_battery_discharge_71: | Optional |`ssensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | +|day_battery_charge_70: | Optional |`sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | +|day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | +|day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | +|day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | +|day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh) | +|day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) +|inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter voltage (V) | +|load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | +|inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter vurrent (A) | +|inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). Required if the essential_power attribute is set to `none` | +|grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | +|pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W)| +|pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | +|pv3_power_188: | Optional | `sensor.sunsynk_pv3_power` | PV string 3 power (W) | +|pv4_power_189: | Optional | `sensor.sunsynk_pv4_power` | PV string 4 power (W) | +|pv_total:| Optional | `none` | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-4 power (W) +|battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | +|battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | +|battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | +|battery_current_191: | **Required** |`sensor.sunsynk_battery_current` | Battery current (A) | +|essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant. (W) | +|essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W)| +|essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W)| +|nonessential_power| Optional | `none`| The card will automatically calculate this sensor based on the formula below if the attribute is set to `none`. You can overide this by supplying a sensor that measures non-essential power e.g. `Load power Non-Essential` in the case of Solar Assistant. (W) +|non_essential_load1: | Optional | |Sensor that contains the power of your non-essential load 1 (W)| +|non_essential_load2: | Optional | |Sensor that contains the power of your non-essential load 2 (W) +|grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT power (W)| +|pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | +|pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A)| +|pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V)| +|pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A)| +|pv3_voltage_113: | Optional | `sensor.sunsynk_pv3_voltage` | PV string 3 voltage (V) | +|pv3_current_114: | Optional | `sensor.sunsynk_pv3_current` | PV string 3 current (A)| +|pv4_voltage_115: | Optional | `sensor.sunsynk_pv4_voltage` | PV string 4 voltage (V)| +|pv4_current_116: | Optional | `sensor.sunsynk_pv4_current` | PV string 4 current (A)| +|grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status `on/off` or `1/0` | +|inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Inverter status `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault` | +|aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary power (W) | +|aux_load1:| Optional | | Sensor that contains the power of your AUX load 1 (W) | +|aux_load2:| Optional | | Sensor that contains the power of your AUX load 2 (W) | +|aux_connected_status: |Optional | None | AUX Connected Status `on/off` or `1/0` +|remaining_solar: | Optional | `sensor.solcast_forecast_remaining_today`| The remaining solar forecast for the day (kWh) | +|battery_temp_182:| Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (℃)| +|radiator_temp_91:| Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃)| +|dc_transformer_temp_90:| Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃)| +|prog1_time:| Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) +|prog1_capacity:| Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting +|prog1_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|prog2_time:| Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) +|prog2_capacity:| Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting +|prog2_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|prog3_time:| Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) +|prog3_capacity:| Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting +|prog3_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|prog4_time:| Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) +|prog4_capacity:| Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting +|prog4_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|prog5_time:| Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) +|prog5_capacity:| Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting +|prog5_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|prog6_time:| Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) +|prog6_capacity:| Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting +|prog6_charge:| Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) +|energy_cost:| Optional | | Sensor that provides current energy cost per kWh +|solar_sell_247:|Optional | `switch.sunsynk_toggle_solar_sell` | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) + +The card calculates the sensors below based on supplied attributes in the config so you dont need to define them in Home Assistant. NOTE if your essential and non-essential readings are innacurate replace sensor 169 with 167. Alternatively provide the card with sensors that calculate this data i.e essential_power: and nonessential_power: + + ``` + totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + nonessential = grid_ct_power_172 - grid_power_169 + essential = inverter_power_175 + grid_power_169 - aux_power_166 + ``` + +The modbus registers can be visualised on the `full` card below: + +![image](https://user-images.githubusercontent.com/7227275/235479493-b322d5b2-f2b1-431f-9048-f845fc2989b4.png) diff --git a/docs/contribute/bugs.rst b/docs/contribute/bugs.rst index d167966f..4554fc3c 100644 --- a/docs/contribute/bugs.rst +++ b/docs/contribute/bugs.rst @@ -3,16 +3,16 @@ Reporting Bugs ############## This section guides you through submitting a bug report for Atomic Calendar Revive. -Following these guidelines helps maintainers and the community understand your report -:pencil:, reproduce the behaviour :computer: :computer:, and find related reports -:mag_right:. +Following these guidelines helps maintainers and the community understand your report, +reproduce the behaviour, and find related reports. Before creating bug reports, please check the below information as you might find out that you don't need to create one. When you are creating a bug report, -please :ref:include as many details as possible:, the information it asks for helps +please include as many details as possible, the information it asks for helps us resolve issues faster. -.. note: +.. note:: + If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. @@ -22,10 +22,7 @@ us resolve issues faster. Before Submitting A Bug Report ****************************** -* **Check the :ref:`qucikstart`** You may have miss-configured the plugin and - this is resulting in the issue you see -* **Check the :ref:`FAQs`** for a list of common questions and problems. -* **Perform a `cursory search `_ ** +* **Perform a** `cursory search `_ to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. diff --git a/docs/toc.rst b/docs/toc.rst index 7820cad2..95a0c018 100644 --- a/docs/toc.rst +++ b/docs/toc.rst @@ -1,15 +1,8 @@ - -.. toctree:: - :caption: Overview - :titlesonly: - - overview/quickstart - .. toctree:: :caption: Configuration :titlesonly: - configuration/main + configuration .. toctree:: :caption: Examples From 8c3fa890f7dbd79d13d3bc0cd3d531d5d0918cd9 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Fri, 18 Aug 2023 14:30:24 +0200 Subject: [PATCH 39/40] fix: show_solar logic on lite card --- dist/sunsynk-power-flow-card.js | 2 +- src/index.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 8c795fef..ffa2d265 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -37,4 +37,4 @@ const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!0!==_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!0!==Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!0!==Js?"30":"143",Vs,1===en?"":"none",!0!==Js?"376":"373",!0!==Js?"30":"143",Vs,2===en?"":"none",!0!==Js?"413":"410",!0!==Js?"30":"143",Vs,2===en?"":"none",Fs,!0!==Js?"none":"",1===sn||2===sn?"":"st12",Fs,!0!==Js?"none":"",2===sn?"":"st12",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!0!==Js?"none":"",Vs,ut("common.essential"),!0!==Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?393:390,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?429:426,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!0!==Bs||!0!==Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!0!==Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!0!==Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!0!==Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!0!==Js?"":"none",1===en?"":"st12",Vs,!0!==Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!0!==Js?"st12":"",Fs,!0!==Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!0!==Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!0!==Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!0===Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!0!==Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!0!==Js||0===sn?"none":"",an,!0!==Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!0!==Bs||!0!==Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!0!==Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!0!==vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!0!==vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!0!==vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!0!==vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!0!==vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",Vs,2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!0===Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,2===en&&!0===Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!0!==Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!0===Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); + */}var ct,pt;null===(ct=window.HTMLSlotElement)||void 0===ct||ct.prototype.assignedElements;const vt=((t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new l(s,t,a)})(pt||(pt=e(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; alignment-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",load1_name:"",load2_name:"",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV3",essential:"Essential"},yt={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 30",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},gt={common:_t,errors:yt};const xt={en:Object.freeze({__proto__:null,common:_t,default:gt,errors:yt})};function ut(t,e="",s=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let i;try{i=t.split(".").reduce(((t,e)=>t[e]),xt[n])}catch(e){i=t.split(".").reduce(((t,e)=>t[e]),xt.en)}return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),xt.en)),""!==e&&""!==s&&(i=i.replace(e,s)),i}var ft={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,card_height:"396px",inverter:{modern:!0,colour:"grey",autarky:"power",model:"sunsynk"},battery:{energy:0,shutdown_soc:20,invert_power:!1,colour:"pink",show_daily:!1,animation_speed:6,max_power:4500,full_capacity:80,empty_capacity:30},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:ut("common.pv1_name"),pv2_name:ut("common.pv2_name"),pv3_name:ut("common.pv3_name"),pv4_name:ut("common.pv4_name")},load:{colour:"#5fb6ad",show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,animation_speed:4,max_power:8e3,aux_name:ut("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",load1_icon:"default",load2_icon:"default",load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name")},grid:{colour:"#5490c2",no_grid_colour:"#a40013",show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:ut("common.nonessential_name"),additional_loads:0,load1_name:ut("common.load1_name"),load2_name:ut("common.load2_name"),load1_icon:"default",load2_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3}};const mt=[0,1,2],wt={sunsynk:{standby:{states:["0","standby"],color:"blue",message:"Standby"},selftest:{states:["1","selftest"],color:"yellow",message:"Selftest"},normal:{states:["2","normal","ok"],color:"green",message:"Normal"},alarm:{states:["3","alarm"],color:"orange",message:"Alarm"},fault:{states:["4","fault"],color:"red",message:"Fault"}},lux:{standby:{states:["0"],color:"blue",message:"Standby"},selftest:{states:[],color:"yellow",message:"Selftest"},normal:{states:["4","12","16","20","40"],color:"green",message:"Normal"},alarm:{states:["7","64"],color:"orange",message:"Alarm"},fault:{states:[],color:"red",message:"Fault"}}};var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kt={exports:{}};!function(t,e){var s="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",o="[object Function]",l="[object GeneratorFunction]",r="[object Null]",h="[object Object]",d="[object Proxy]",c="[object Undefined]",p=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[o]=_["[object Map]"]=_["[object Number]"]=_[h]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var y="object"==typeof qt&&qt&&qt.Object===Object&&qt,g="object"==typeof self&&self&&self.Object===Object&&self,x=y||g||Function("return this")(),u=e&&!e.nodeType&&e,f=u&&t&&!t.nodeType&&t,m=f&&f.exports===u,w=m&&y.process,q=function(){try{var t=f&&f.require&&f.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),T=q&&q.isTypedArray;var k,M,b,A=Array.prototype,H=Function.prototype,Z=Object.prototype,L=x["__core-js_shared__"],E=H.toString,P=Z.hasOwnProperty,V=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",F=Z.toString,I=E.call(Object),B=RegExp("^"+E.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?x.Buffer:void 0,S=x.Symbol,N=x.Uint8Array,R=C?C.allocUnsafe:void 0,j=(M=Object.getPrototypeOf,b=Object,function(t){return M(b(t))}),D=Object.create,$=Z.propertyIsEnumerable,O=A.splice,z=S?S.toStringTag:void 0,U=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=C?C.isBuffer:void 0,W=Math.max,Q=Date.now,G=ut(x,"Map"),X=ut(Object,"create"),K=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var s=this.__data__,n=ot(s,t);return n<0?(++this.size,s.push([t,e])):s[n][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||tt),string:new J}},et.prototype.delete=function(t){var e=xt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return xt(this,t).get(t)},et.prototype.has=function(t){return xt(this,t).has(t)},et.prototype.set=function(t,e){var s=xt(this,t),n=s.size;return s.set(t,e),this.size+=s.size==n?0:1,this},st.prototype.clear=function(){this.__data__=new tt,this.size=0},st.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++s.size,this;s=this.__data__=new et(n)}return s.set(t,e),this.size=s.size,this};var rt,ht=function(t,e,s){for(var n=-1,i=Object(t),a=s(t),o=a.length;o--;){var l=a[rt?o:++n];if(!1===e(i[l],l,i))break}return t};function dt(t){return null==t?void 0===t?c:r:z&&z in Object(t)?function(t){var e=P.call(t,z),s=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);n&&(e?t[z]=s:delete t[z]);return i}(t):function(t){return F.call(t)}(t)}function ct(t){return Pt(t)&&dt(t)==i}function pt(t){return!(!Et(t)||function(t){return!!V&&V in t}(t))&&(Zt(t)?B:p).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function vt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=mt(t),s=[];for(var n in t)("constructor"!=n||!e&&P.call(t,n))&&s.push(n);return s}function _t(t,e,s,n,i){t!==e&&ht(e,(function(a,o){if(i||(i=new st),Et(a))!function(t,e,s,n,i,a,o){var l=wt(t,s),r=wt(e,s),d=o.get(r);if(d)return void it(t,s,d);var c=a?a(l,r,s+"",t,e,o):void 0,p=void 0===c;if(p){var v=bt(r),_=!v&&Ht(r),y=!v&&!_&&Vt(r);c=r,v||_||y?bt(l)?c=l:Pt(m=l)&&At(m)?c=function(t,e){var s=-1,n=t.length;e||(e=Array(n));for(;++s-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function kt(t,e){return t===e||t!=t&&e!=e}var Mt=ct(function(){return arguments}())?ct:function(t){return Pt(t)&&P.call(t,"callee")&&!$.call(t,"callee")},bt=Array.isArray;function At(t){return null!=t&&Lt(t.length)&&!Zt(t)}var Ht=Y||function(){return!1};function Zt(t){if(!Et(t))return!1;var e=dt(t);return e==o||e==l||e==a||e==d}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Vt=T?function(t){return function(e){return t(e)}}(T):function(t){return Pt(t)&&Lt(t.length)&&!!_[dt(t)]};function Ft(t){return At(t)?nt(t,!0):vt(t)}var It,Bt=(It=function(t,e,s){_t(t,e,s)},yt((function(t,e){var s=-1,n=e.length,i=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(n--,i):void 0,a&&function(t,e,s){if(!Et(s))return!1;var n=typeof e;return!!("number"==n?At(s)&&ft(e,s.length):"string"==n&&e in s)&&kt(s[e],t)}(e[0],e[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++s{const[s,n]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));ai[e]=new Date(ii.getTime()),ai[e].setHours(s),ai[e].setMinutes(n)}));const[oi,li,ri,hi,di,ci]=ai;function pi(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Vn.charge="none":Vn.charge="both",Vn.capacity=parseInt(t.capacity.state),Vn.entityID=e}ii>=ci||ii=oi&&ii=li&&ii=ri&&ii=hi&&ii=di&&ii0?Fn="off"===Xe.state||!1===Vn.show||parseInt($e.state)<=Vn.capacity?Ee.battery.shutdown_soc:Vn.capacity:fn<0&&("off"===Xe.state||!1===Vn.show||parseInt($e.state)>=Vn.capacity?Fn=100:parseInt($e.state)0?In=(parseInt($e.state)-Fn)/100*Ee.battery.energy/fn*60*60:fn<0&&(In=(Fn-parseInt($e.state))/100*Ee.battery.energy/fn*60*60*-1);const vi=new Date,_i=1e3*In,yi=new Date(vi.getTime()+_i),gi=yi.getHours(),xi=yi.getMinutes().toString().padStart(2,"0"),ui=gi.toString().padStart(2,"0");Bn="".concat(ui,":").concat(xi);const fi=Math.floor(In/86400),mi=Math.floor(In%86400/3600),wi=Math.floor(In%3600/60);fi>0&&(Cn+="".concat(fi," days, ")),(mi>0||fi>0)&&(Cn+="".concat(mi," hrs, ")),Cn+="".concat(wi," min")}let Sn=!!(-2<=parseInt(ps.state)&&parseInt(ps.state)<=2&&parseInt($e.state)>=99),Nn="",Rn="",jn="",Dn=!1;jn="sunsynk"!==Ee.inverter.model&&"lux"!==Ee.inverter.model?"sunsynk":Ee.inverter.model;let $n=wt[jn];for(const qi of Object.keys($n)){const Ti=$n[qi],{states:ki,color:Mi,message:bi}=Ti;if(ki.includes(Ke.state)){Nn=Mi,Rn=bi,Dn=!0;break}}Dn||("none"!==(null===(D=Ee.entities)||void 0===D?void 0:D.inverter_status_59)&&(null===($=Ee.entities)||void 0===$?void 0:$.inverter_status_59)?(Nn="transparent",Rn="Status"):(Nn="transparent",Rn=""));let On=(isNaN(parseFloat(Be.state))?0:parseFloat(Be.state))+(isNaN(parseFloat(Pe.state))?0:parseFloat(Pe.state)),zn=(isNaN(parseFloat(Fe.state))?0:parseFloat(Fe.state))+(isNaN(parseFloat(Ve.state))?0:parseFloat(Ve.state)),Un=0!=zn?Math.min(Math.round(100*On/zn),100):0,Yn=0!=On?Math.min(Math.round(100*zn/On),100):0,Wn=Tn+parseInt("".concat(fn>0?fn:0))+parseInt("".concat(Zs<0?-1*Zs:0)),Qn=Mn+bn+parseInt("".concat(Zs>0?Zs:0))+parseInt("".concat(fn<0?-1*fn:0)),Gn=0!=Qn?Math.min(Math.round(100*Wn/Qn),100):0,Xn=0!=Wn?Math.min(Math.round(100*Qn/Wn),100):0,Kn=null===(O=Ee.solar)||void 0===O?void 0:O.animation_speed;if(Ee&&Ee.solar&&Ee.solar.animation_speed){let Ai=Ee.solar.animation_speed-(Ee.solar.animation_speed-1)*(Tn/(Ee.solar.max_power||Tn));Kn=Ai>=1?Ai:1}let Jn=null===(z=Ee.battery)||void 0===z?void 0:z.animation_speed;if(Ee&&Ee.battery&&Ee.battery.animation_speed){let Hi=Ee.battery.animation_speed-(Ee.battery.animation_speed-1)*((fn<0?-1*fn:fn)/(Ee.battery.max_power||(fn<0?-1*fn:fn)));Jn=Hi>=1?Hi:1}let ti=null===(U=Ee.load)||void 0===U?void 0:U.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Zi=Ee.load.animation_speed-(Ee.load.animation_speed-1)*(Mn/(Ee.load.max_power||Mn));ti=Zi>=1?Zi:1}let ei=null===(Y=Ee.load)||void 0===Y?void 0:Y.animation_speed;if(Ee&&Ee.load&&Ee.load.animation_speed){let Li=Ee.load.animation_speed-(Ee.load.animation_speed-1)*((parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))/(Ee.load.max_power||(parseInt(es.state)<0?-1*parseInt(es.state):parseInt(es.state))));ei=Li>=1?Li:1}let si=null===(W=Ee.grid)||void 0===W?void 0:W.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Ei=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*((parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))/(Ee.grid.max_power||(parseInt(Ue.state)<0?-1*parseInt(Ue.state):parseInt(Ue.state))));si=Ei>=1?Ei:1}let ni=null===(Q=Ee.grid)||void 0===Q?void 0:Q.animation_speed;if(Ee&&Ee.grid&&Ee.grid.animation_speed){let Pi=Ee.grid.animation_speed-(Ee.grid.animation_speed-1)*(bn/(Ee.grid.max_power||bn));ni=Pi>=1?Pi:1}return"full"===Ee.cardstyle?R(Mt||(Mt=e(["\n \n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n Grid\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n Ratio\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Nonessential Load Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\n \n \n \n\n \x3c!-- Aux Icon --\x3e\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n ','\n ','\n \n \n\n \n \n \n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh\n \n\n ","\n ","\n ",'\n \n '," W\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n\n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n
\n
\n
\n "])),Vs,Vs,Fs,Fs,Is,Cs,Cs,!0!==_n?"".concat(mn):"100%",Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Cs,Fs,!0!==Js?"st12":"",Vs,yn,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Cs,!1===Ns?"st12":"",1===Us?"":"none",Cs,!1===Ns?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",2===Us?"":"none",Cs,!1===Ns||1===Us?"st12":"",!0!==Js?"30":"143",Vs,1===en?"":"none",!0!==Js?"376":"373",!0!==Js?"30":"143",Vs,2===en?"":"none",!0!==Js?"413":"410",!0!==Js?"30":"143",Vs,2===en?"":"none",Fs,!0!==Js?"none":"",1===sn||2===sn?"":"st12",Fs,!0!==Js?"none":"",2===sn?"":"st12",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,Cs,yn,Rn,1!==en&&2!==en||!0!==Js?"":"none",Vs,ut("common.essential"),0===en||!0!==Js?"none":"",Vs,ut("common.essential"),!0!==Js?70:181,1===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?393:390,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load1_name,!0!==Js?429:426,!0!==Js?59:172,2===en?"":"none",Vs,Ee.load.load2_name,2===sn?"238":"306",!0!==Bs||!0!==Js?"transparent":"".concat(Vs),ut("common.daily_load"),0===en?"377":"306",0===en?71:93,!0!==Bs||!0===Js?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),!1===Ns?"311":"347",!1===Ns?"368":"253",!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!1===Ns?"311":"347",!1===Ns?"337":"222",!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),Ee.load.aux_name,!1===Ns?"none":"",Cs,Ee.grid.nonessential_name,!1===Ns||0===Us||2===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load1_name,!1===Ns||0===Us||1===Us?"none":"",Cs,Ee.grid.load2_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,1===sn?53:14,!0!==Js||0===sn?"none":"",Fs,Ee.load.aux_load1_name,!0!==Js||0===sn||1===sn?"none":"",Fs,Ee.load.aux_load2_name,1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,ut("common.daily_aux"),Nn,!0===Js?"":"none",1===en||2===en?"":"st12",Vs,!0!==Js?"":"none",1===en?"":"st12",Vs,!0!==Js?"":"none",2===en?"":"st12",Vs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si/2,Es>0||0===Es?"transparent":"".concat(Cs),si/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni/2,Cs,!1===Ns?"st12":"",!1===Ns?"st12":"",bn<=0?"transparent":"".concat(Cs),ni,!0!==Js?"st12":"",Fs,!0!==Js||0===Zs?"st12":"",Zs<0?"transparent":"".concat(Fs),ei,!0!==Js||0===Zs?"st12":"",Zs>0?"transparent":"".concat(Fs),ei,!0!==Js?"st12":"",Fs,Cs,yn,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,yn,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?"1":"0",Qs,parseInt($e.state)<=qn?1:0,Qs,!1===Ee.show_solar?"st12":"",Xs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,"default"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"oven"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"boiler"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"pump"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,"aircon"===ln?"1":"0",!1===Ns||2===Us||1===Us?"none":"",Cs,!1===Ns||2===Us||1===Us?"none":"",ln,"default"===rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"===rn&&"default"!=hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"default"!=rn&&"default"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"boiler"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"pump"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"oven"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,"aircon"===hn?"1":"0",!1===Ns||0===Us||1===Us?"none":"",Cs,!1===Ns||0===Us||1===Us?"none":"",rn,!1===Ns||0===Us||1===Us?"none":"",hn,"default"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"boiler"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"pump"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"oven"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,"aircon"===rn?"1":"0",!1===Ns||0===Us||2===Us?"none":"",Cs,!1===Ns||0===Us||2===Us?"none":"",rn,1!==en&&2!==en||!0===Js?"none":"",Vs,1!==en&&2!==en||!0!==Js?"none":"",Vs,1===en||2===en?"none":"",Vs,(t=>this.handlePopup(t,Ee.entities.aux_connected_status)),"default"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"gen"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"inverter"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"oven"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"boiler"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"aircon"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),"pump"===nn?"":"st12",!0!==Js||1===sn||2===sn?"none":"","".concat("on"===js||"1"===js?Fs:Is),!0!==Js||1===sn||2===sn?"none":"",nn,"on"===js||"1"===js?"aux-icon":"aux-off-icon",!0!==Js||0===sn?"none":"",an,!0!==Js||1===sn||0===sn?"none":"",on,"boiler"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"boiler"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"boiler"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"boiler"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"aircon"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"aircon"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"aircon"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"aircon"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"pump"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"pump"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"pump"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,"pump"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===cn&&2===en?"1":"0",!0!==Js||0===en||1===en?"none":"",Vs,"oven"===dn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===cn&&2===en&&!0!==Js?"1":"0",0===en||1===en?"none":"",Vs,"oven"===dn&&1===en&&!0!==Js?"1":"0",0===en||2===en?"none":"",Vs,"oven"===dn&&1===en?"1":"0",!0!==Js||0===en||2===en?"none":"",Vs,0===en||1===en?"none":"",!0===Js?"350":"383",!0===Js?"140":"5",dn,0===en||1===en?"none":"",!0===Js?"446":"420",!0===Js?"140":"5",cn,0===en||2===en?"none":"","336",!0===Js?"140":"27",dn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"no"!=gn?"232":"249","on"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"232":"249","off"==ns.state&&"no"!==xn?"":"none",yn,"no"!=gn?"243":"260","on"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_on"),"no"!=gn?"243":"260","off"==ns.state&&"no"!==xn?"":"none",yn,ut("common.timer_off"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"none"!==Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"no"!=gn?"251":"268","off"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"251":"268","on"===ss.state&&"no"!==un?"":"none",yn,"no"!=gn?"262":"280","on"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_load"),"no"!=gn?"262":"280","off"===ss.state&&"no"!==un?"":"none",yn,ut("common.priority_batt"),!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,"no"!=gn?"232":"249",!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===sn?"238":"306",!0!==Bs||!0!==Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),0===en?"377":"306",0===en?"57":"80",!0!==Bs||!0===Js?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!1===Ns?"311":"347",!1===Ns?"354":"239",!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!1===Ns?"311":"347",!1===Ns?"323":"209",!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_aux_energy)),1===sn||2===sn?"238":"306",!0!==Js||!0!==tn?"none":"",Fs,parseFloat(As.state).toFixed(1),(null===(G=Ee.entities)||void 0===G?void 0:G.pv_total)?j(bt||(bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(At||(At=e([' '," W "])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(X=Ee.entities)||void 0===X?void 0:X.essential_power)?j(Ht||(Ht=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(Zt||(Zt=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(K=Ee.entities)||void 0===K?void 0:K.nonessential_power)?j(Lt||(Lt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.nonessential_power)),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0):j(Et||(Et=e([''," W "])),!1===Ns?"none":"",!0!==vn?"st14":"st4",Cs,bn||0),(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(null===(J=Ee.entities)||void 0===J?void 0:J.aux_power_166)?j(Pt||(Pt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_power_166)),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs):j(Vt||(Vt=e([''," W "])),!0!==vn?"st14":"st4",!0!==Js?"none":"",Fs,Zs<0?-1*Zs:Zs),(null===(tt=Ee.entities)||void 0===tt?void 0:tt.pv1_power_186)?j(Ft||(Ft=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(It||(It=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(et=Ee.entities)||void 0===et?void 0:et.pv2_power_187)?j(Bt||(Bt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(Ct||(Ct=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(st=Ee.entities)||void 0===st?void 0:st.pv3_power_188)?j(St||(St=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(Nt||(Nt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(nt=Ee.entities)||void 0===nt?void 0:nt.pv4_power_189)?j(Rt||(Rt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(jt||(jt=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(it=Ee.entities)||void 0===it?void 0:it.aux_load1)?j(Dt||(Dt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)):j($t||($t=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn?"none":"",Fs,isNaN(parseFloat(Ms.state))?"0":parseFloat(Ms.state).toFixed(0)),(null===(at=Ee.entities)||void 0===at?void 0:at.aux_load2)?j(Ot||(Ot=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.aux_load1)),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)):j(zt||(zt=e([''," W"])),!0!==vn?"st14":"st4",!0!==Js||0===sn||1===sn?"none":"",Fs,isNaN(parseFloat(bs.state))?"0":parseFloat(bs.state).toFixed(0)),(null===(ot=Ee.entities)||void 0===ot?void 0:ot.non_essential_load1)?j(Ut||(Ut=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Yt||(Yt=e([''," W"])),!1===Ns||0===Us||2===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(lt=Ee.entities)||void 0===lt?void 0:lt.non_essential_load1)?j(Wt||(Wt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load1)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)):j(Qt||(Qt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(xs.state))?"0":parseFloat(xs.state).toFixed(0)),(null===(rt=Ee.entities)||void 0===rt?void 0:rt.non_essential_load2)?j(Gt||(Gt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.non_essential_load2)),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)):j(Xt||(Xt=e([''," W"])),!1===Ns||0===Us||1===Us?"none":"",Cs,isNaN(parseFloat(us.state))?"0":parseFloat(us.state).toFixed(0)),(null===(ht=Ee.entities)||void 0===ht?void 0:ht.essential_load1)?j(Kt||(Kt=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(Jt||(Jt=e([''," W"])),!0!==Js?"47":"158",1===en?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(dt=Ee.entities)||void 0===dt?void 0:dt.essential_load1)?j(te||(te=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)):j(ee||(ee=e([''," W"])),!0!==Js?"394":"391",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(fs.state))?"0":parseFloat(fs.state).toFixed(0)),(null===(ct=Ee.entities)||void 0===ct?void 0:ct.essential_load2)?j(se||(se=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)):j(ne||(ne=e([''," W"])),!0!==Js?"430":"427",!0!==Js?"42":"154",2===en?"":"none",Vs,isNaN(parseFloat(qs.state))?"0":parseFloat(qs.state).toFixed(0)),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",!0!==vn?"st14":"st4",Cs,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",!0!==vn?"st14":"st4",Cs,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",!0!==vn?"st14":"st4",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.inverter_power_175)),"none"===Ee.entities.inverter_power_175?"none":"",!0!==vn?"st14":"st4",yn,Je.state,(t=>this.handlePopup(t,Ee.entities.grid_power_169)),"none"===Ee.entities.grid_power_169?"none":"",!0!==vn?"st14":"st4",Cs,ts.state,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(pt=Ee.entities)||void 0===pt?void 0:pt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),4===(null===(vt=Ee.solar)||void 0===vt?void 0:vt.mppts)?"137":"158",4===(null===(_t=Ee.solar)||void 0===_t?void 0:_t.mppts)?"222":"153",yn,(null===(yt=Ee.entities)||void 0===yt?void 0:yt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(gt=Ee.entities)||void 0===gt?void 0:gt.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(xt=Ee.entities)||void 0===xt?void 0:xt.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement):"lite"===Ee.cardstyle?R(ie||(ie=e(["\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n ','\n '," ","% @",'\n '," ","% "," @",'\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','\n ','%\n ','%\n ','%\n ','%\n Autarky\n ','\n ','\n ','\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n
\n \n
\n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ','\n ','\n \n \n \n \n ','\n ','\n \n \n \n \n \n \n \n \n \n \n \n ',' kWh\n \n \n ',' kWh\n \n \n '," kWh / ",' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' kWh\n \n \n ',' V\n \n \n ',' Hz\n \n \n ',' A\n \n \n ',' V\n \n \n ',' %\n \n \n | ',' %\n \n \n ',' W\n \n \n ',' A\n \n \n ',' W\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ',' V\n \n \n ',' A\n \n \n ','°\n \n \n AC: ','°\n \n \n DC: ','°\n \n \n '," ","\n \n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n
\n
\n
\n "])),Vs,!1===Ee.show_solar?145.33:-.5,!1===Ee.show_solar?270.67:406,"".concat(!1===_n?!1===Ee.show_solar?"246px":"".concat(mn):!1===Ee.show_solar?"75%":"100%"),Vs,Xs,!1===Ee.show_solar?"st12":"",Qs,Cs,Xs,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Vs,1===en&&!1!==Ee.show_solar?"":"none",Vs,2===en&&!1!==Ee.show_solar?"":"none",Vs,2===en&&!1!==Ee.show_solar?"":"none",!0!==vn?"st14":"st4",0===Ee.battery.energy||!0===Sn||0===fn?"transparent":"".concat(Qs),Cn,0===Ee.battery.energy||fn<=0||!0===Sn?"transparent":"".concat(Qs),ut("common.runtime_to"),Fn,Bn,0===Ee.battery.energy||fn>=0||!0===Sn?"transparent":"".concat(Qs),ut("common.to"),Fn,ut("common.charge"),Bn,0===Ee.battery.energy||!1===Sn?"transparent":"".concat(Qs),ut("common.battery_floating"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_charge"),!0!==Gs?"transparent":"".concat(Qs),ut("common.daily_discharge"),2===en?"365":"415",2===en?"182.2":"282.1",!1===Bs?"transparent":"".concat(Vs),ut("common.daily_load"),!0!==Ys?"transparent":"".concat(Cs),ut("common.daily_grid_buy"),!0!==Ws?"transparent":"".concat(Cs),ut("common.daily_grid_sell"),!0!==Ks||!1===Ee.show_solar||0!=pn?"transparent":"".concat(Xs),ut("common.daily_solar"),!0!==Ks||!1===Ee.show_solar||!1===pn?"transparent":"".concat(Xs),ut("common.daily_solar_left"),!1===Ee.show_solar?"none":"",Xs,Ee.solar.pv1_name,!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv2_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv3_name,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,Ee.solar.pv4_name,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Un,"no"===gn?"none":"","energy"===gn?"st4 st8 left-align":"st12",yn,Yn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Gn,"no"===gn?"none":"","power"===gn?"st4 st8 left-align":"st12",yn,Xn,"no"===gn?"none":"",yn,"no"===gn?"none":"",yn,ut("common.ratio"),1!==en&&2!==en||!1===Ee.show_solar?"none":"",Vs,(null===(ft=Ee.load)||void 0===ft?void 0:ft.load1_name)?"".concat(Ee.load.load1_name):"",2===en&&!1!==Ee.show_solar?"":"none",Vs,(null===(qt=Ee.load)||void 0===qt?void 0:qt.load2_name)?"".concat(Ee.load.load2_name):"",Nn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",parseInt(je.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts?"st12":"",parseInt(Re.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"st12":"",parseInt(rs.state)<=0?"transparent":"".concat(Xs),Kn,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",Xs,!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"st12":"",parseInt(hs.state)<=0?"transparent":"".concat(Xs),Kn,Qs,fn<0||0===fn?"transparent":"".concat(Qs),Jn,fn>0||0===fn?"transparent":"".concat(Qs),Jn,!1===Ee.show_solar?"st12":"",Xs,!1===Ee.show_solar?"st12":"",0===Tn?"transparent":"".concat(Xs),Kn,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Cs,Es<0||0===Es?"transparent":"".concat(Cs),si,Es>0||0===Es?"transparent":"".concat(Cs),si,Vs,0===Mn?"transparent":"".concat(Vs),ti,Vs,0===Mn?"transparent":"".concat(Vs),ti,1===en&&!1!==Ee.show_solar?"":"st12",Vs,2===en&&!1!==Ee.show_solar?"":"st12",Vs,2===en&&!1!==Ee.show_solar?"":"st12",Vs,"oven"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"oven"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"pump"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"aircon"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"!==dn||1!==en&&2!==en?"0":"1",0===en||!1===Ee.show_solar?"none":"",Vs,"boiler"===cn&&2===en?"1":"0",0===en||!1===Ee.show_solar?"none":"",Vs,0===en||!1===Ee.show_solar?"none":"",dn,0===en||1===en||!1===Ee.show_solar?"none":"",cn,!1===Ee.show_solar?"st12":"",Xs,parseInt($e.state)>=wn?1:0,Qs,parseInt($e.state)>=50&&parseInt($e.state)qn&&parseInt($e.state)<=49?1:0,Qs,parseInt($e.state)<=qn?1:0,Qs,(t=>this.handlePopup(t,Ee.entities.grid_connected_status_194)),"off"===Rs||"0"===Rs?"st12":"",Cs,"on"===Rs||"1"===Rs?"st12":"",Ss,Vs,yn,(t=>this.handlePopup(t,Ee.entities.use_timer_248)),"on"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,"off"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_off"),"on"==ns.state&&!1!==xn?"":"none",yn,ut("common.timer_on"),(t=>this.handlePopup(t,Ee.entities.priority_load_243)),"off"===ss.state&&!1!==un?"":"none",yn,"on"===ss.state&&!1!==un?"":"none",yn,"off"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_batt"),"on"===ss.state&&!1!==un?"":"none",yn,ut("common.priority_load"),(t=>this.handlePopup(t,Ee.entities.solar_sell_247)),Ee.entities.solar_sell_247&&"off"!==ws.state&&"0"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,Ee.entities.solar_sell_247&&"on"!==ws.state&&"1"!==ws.state&&!1!==Ee.show_solar?"":"none",Xs,!1===Ps?"":"st12",(t=>this.handlePopup(t,Vn.entityID)),!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"st12":"",yn,!1===Vn.show||"none"===Ee.entities.use_timer_248?"none":"","none"===Vn.charge?"":"st12",yn,(t=>this.handlePopup(t,Ee.entities.day_battery_charge_70)),!0!==Gs?"none":"",Qs,parseFloat(Ve.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||0!=pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_pv_energy_108)),!0!==Ks||!1===Ee.show_solar||!1===pn?"none":"",Xs,parseFloat(Be.state).toFixed(1),pn,(t=>this.handlePopup(t,Ee.entities.day_battery_discharge_71)),!0!==Gs?"none":"",Qs,parseFloat(Pe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_load_energy_84)),2===en?"365":"400.4",2===en?"168":"267.9",!1===Bs?"none":"",Vs,parseFloat(Fe.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_import_76)),!0!==Ys?"none":"",Cs,parseFloat(Ie.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.day_grid_export_77)),!0!==Ws?"none":"",Cs,parseFloat(ds.state).toFixed(1),(t=>this.handlePopup(t,Ee.entities.inverter_voltage_154)),"none"!==Ee.entities.inverter_voltage_154&&Ee.entities.inverter_voltage_154?"":"none",yn,$s,(t=>this.handlePopup(t,Ee.entities.load_frequency_192)),"none"!==Ee.entities.load_frequency_192&&Ee.entities.load_frequency_192?"":"none",yn,Ds,(t=>this.handlePopup(t,Ee.entities.inverter_current_164)),"none"!==Ee.entities.inverter_current_164&&Ee.entities.inverter_current_164?"":"none",yn,Os,(t=>this.handlePopup(t,Ee.entities.battery_voltage_183)),"none"!==Ee.entities.battery_voltage_183&&Ee.entities.battery_voltage_183?"":"none",Qs,!0!==vn?"st14":"st4",zs,(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),"none"===Ee.entities.battery_soc_184?"none":"",Qs,parseInt($e.state),(t=>this.handlePopup(t,Ee.entities.battery_soc_184)),Qs,!1===Vn.show||"none"===Ee.entities.battery_soc_184?"none":"",Vn.capacity||0,(t=>this.handlePopup(t,Ee.entities.battery_power_190)),"none"===Ee.entities.battery_power_190?"none":"",Qs,!0!==vn?"st14":"st4",fn<0?-1*fn:fn,(t=>this.handlePopup(t,Ee.entities.battery_current_191)),"none"===Ee.entities.battery_current_191?"none":"",Qs,!0!==vn?"st14":"st4",ps.state,(t=>this.handlePopup(t,Ee.entities.grid_ct_power_172)),"none"===Ee.entities.grid_ct_power_172?"none":"",!0!==vn?"st14":"st4",Cs,Es||0,(t=>this.handlePopup(t,Ee.entities.pv1_voltage_109)),!1!==Ee.show_solar&&Ee.entities.pv1_voltage_109&&"none"!==Ee.entities.pv1_voltage_109?"":"none",Xs,Ye.state,(t=>this.handlePopup(t,Ee.entities.pv1_current_110)),!1!==Ee.show_solar&&Ee.entities.pv1_current_110&&"none"!==Ee.entities.pv1_current_110?"":"none",Xs,We.state,(t=>this.handlePopup(t,Ee.entities.pv2_voltage_111)),!1!==Ee.show_solar&&Ee.entities.pv2_voltage_111&&"none"!==Ee.entities.pv2_voltage_111&&1!==Ee.solar.mppts?"":"none",Xs,Qe.state,(t=>this.handlePopup(t,Ee.entities.pv2_current_112)),!1!==Ee.show_solar&&Ee.entities.pv2_current_112&&"none"!==Ee.entities.pv2_current_112&&1!==Ee.solar.mppts?"":"none",Xs,Ge.state,(t=>this.handlePopup(t,Ee.entities.pv3_voltage_113)),!1!==Ee.show_solar&&Ee.entities.pv3_voltage_113&&"none"!==Ee.entities.pv3_voltage_113&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,is.state,(t=>this.handlePopup(t,Ee.entities.pv3_current_114)),!1!==Ee.show_solar&&Ee.entities.pv3_current_114&&"none"!==Ee.entities.pv3_current_114&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts?"":"none",Xs,as.state,(t=>this.handlePopup(t,Ee.entities.pv4_voltage_115)),!1!==Ee.show_solar&&Ee.entities.pv4_voltage_115&&"none"!==Ee.entities.pv4_voltage_115&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,os.state,(t=>this.handlePopup(t,Ee.entities.pv4_current_116)),!1!==Ee.show_solar&&Ee.entities.pv4_current_116&&"none"!==Ee.entities.pv4_current_116&&1!==Ee.solar.mppts&&2!==Ee.solar.mppts&&3!==Ee.solar.mppts?"":"none",Xs,ls.state,(t=>this.handlePopup(t,Ee.entities.battery_temp_182)),Qs,(null===(Tt=Ee.entities)||void 0===Tt?void 0:Tt.battery_temp_182)?"":"none",_s.state,(t=>this.handlePopup(t,Ee.entities.radiator_temp_91)),yn,(null===(kt=Ee.entities)||void 0===kt?void 0:kt.radiator_temp_91)?"":"none",gs.state,(t=>this.handlePopup(t,Ee.entities.dc_transformer_temp_90)),yn,(null===(we=Ee.entities)||void 0===we?void 0:we.dc_transformer_temp_90)?"":"none",ys.state,(t=>this.handlePopup(t,Ee.entities.energy_cost)),Cs,(null===(qe=Ee.entities)||void 0===qe?void 0:qe.energy_cost)?"":"none",parseFloat(ms.state).toFixed(2),ms.attributes.unit_of_measurement,(null===(Te=Ee.entities)||void 0===Te?void 0:Te.pv_total)?j(ae||(ae=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv_total)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0):j(oe||(oe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,kn||0),(null===(ke=Ee.entities)||void 0===ke?void 0:ke.pv1_power_186)?j(le||(le=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv1_power_186)),!0!==vn?"st14":"st4",!1===Ee.show_solar?"none":"",Xs,parseFloat(je.state).toFixed(0)):j(re||(re=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv1_power_186?"none":"",Xs,parseFloat(je.state).toFixed(0)),(null===(Me=Ee.entities)||void 0===Me?void 0:Me.pv2_power_187)?j(he||(he=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv2_power_187)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)):j(de||(de=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv2_power_187||1===Ee.solar.mppts?"none":"",Xs,parseFloat(Re.state).toFixed(0)),(null===(be=Ee.entities)||void 0===be?void 0:be.pv3_power_188)?j(ce||(ce=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv3_power_188)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)):j(pe||(pe=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv3_power_188||1===Ee.solar.mppts||2===Ee.solar.mppts?"none":"",Xs,parseFloat(rs.state).toFixed(0)),(null===(Ae=Ee.entities)||void 0===Ae?void 0:Ae.pv4_power_189)?j(ve||(ve=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.pv4_power_189)),!0!==vn?"st14":"st4",!1===Ee.show_solar||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)):j(_e||(_e=e([''," W"])),!0!==vn?"st14":"st4",!1===Ee.show_solar||"none"===Ee.entities.pv4_power_189||1===Ee.solar.mppts||2===Ee.solar.mppts||3===Ee.solar.mppts?"none":"",Xs,parseFloat(hs.state).toFixed(0)),(null===(He=Ee.entities)||void 0===He?void 0:He.essential_power)?j(ye||(ye=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_power)),!0!==vn?"st14":"st4",Vs,Mn||0):j(ge||(ge=e([''," W"])),!0!==vn?"st14":"st4",Vs,Mn||0),(null===(Ze=Ee.entities)||void 0===Ze?void 0:Ze.essential_load1)?j(xe||(xe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load1)),1!==en&&2!==en||!1===Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)):j(ue||(ue=e([''," W"])),1!==en&&2!==en||!1===Ee.show_solar?"none":"",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(fs.state))?0:parseFloat(fs.state).toFixed(0)),(null===(Le=Ee.entities)||void 0===Le?void 0:Le.essential_load2)?j(fe||(fe=e(['\n '," W\n "])),(t=>this.handlePopup(t,Ee.entities.essential_load2)),2===en&&!1!==Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0)):j(me||(me=e([''," W"])),2===en&&!1!==Ee.show_solar?"":"none",!0!==vn?"st14":"st4",Vs,isNaN(parseFloat(qs.state))?0:parseFloat(qs.state).toFixed(0))):void 0}setConfig(t){if(!t.battery)throw Error(ut("errors.battery.bat"));if(!t.battery.energy)throw new Error(ut("errors.battery.energy"));if(!t.battery.shutdown_soc)throw new Error(ut("errors.battery.shutdown_soc"));if(t.battery.full_capacity<80)throw new Error(ut("errors.battery.full_capacity"));if(t.battery.empty_capacity>30)throw new Error(ut("errors.battery.empty_capacity"));if(!(!0!==t.battery.show_daily||t.entities.day_battery_charge_70&&t.entities.day_battery_discharge_71))throw Error(ut("errors.battery.show_daily"));if(!0===t.show_solar&&!t.solar)throw Error(ut("errors.solar.sol"));if(!0===t.show_solar&&!t.solar.mppts)throw Error(ut("errors.solar.mppts"));if(t&&t.solar&&!0===t.show_solar&&!0===t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(ut("errors.solar.show_daily"));if(t&&t.grid&&!0===t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&!0===t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(ut("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(ut("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(ut("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const s of e)if("pv1_power_186"===s&&!0===t.show_solar&&!t.entities[s]&&!t.entities[s])throw new Error("".concat(ut("errors.missing_entity")," e.g: ").concat(s,": sensor.example"));const s=JSON.parse(JSON.stringify(t));this._config=we({},ft,s)}handlePopup(t,e){t.stopPropagation();const s=e;this._handleClick(this,{action:"more-info"},s)}_handleClick(t,e,s){let n;if("more-info"===e.action)n=new Event("hass-more-info",{composed:!0}),n.detail={entityId:s},t.dispatchEvent(n)}getCardSize(){return 2}},s([dt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),s([dt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),t.SunsynkPowerFlowCard=s([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard),window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!1,description:ut("common.description")})})); diff --git a/src/index.ts b/src/index.ts index 12239c3c..72b94e3c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1058,9 +1058,9 @@ export class SunsynkPowerFlowCard extends LitElement { - - - + + + ${duration} ${localize('common.runtime_to')} ${battery_capacity}% @${formattedResultTime} @@ -1083,8 +1083,8 @@ export class SunsynkPowerFlowCard extends LitElement { ${Ratiop}% Autarky ${localize('common.ratio')} - ${config.load?.load1_name ? `${config.load.load1_name}` : ''} - ${config.load?.load2_name ? `${config.load.load2_name}` : ''} + ${config.load?.load1_name ? `${config.load.load1_name}` : ''} + ${config.load?.load2_name ? `${config.load.load2_name}` : ''} @@ -1163,9 +1163,9 @@ export class SunsynkPowerFlowCard extends LitElement { - - - + + + @@ -1344,14 +1344,14 @@ export class SunsynkPowerFlowCard extends LitElement { : svg`${essential || 0} W`} ${config.entities?.essential_load1 ? svg` this.handlePopup(e, config.entities.essential_load1)}> - ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj42.state)) ? 0 : parseFloat(stateObj42.state).toFixed(0)} W`} ${config.entities?.essential_load2 ? svg` this.handlePopup(e, config.entities.essential_load2)}> - ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W + ${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W ` - : svg`${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W`} + : svg`${isNaN(parseFloat(stateObj45.state)) ? 0 : parseFloat(stateObj45.state).toFixed(0)} W`}
From af3edea6c50412f01f2e24e53187ce202c64748a Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Fri, 18 Aug 2023 12:50:25 +0000 Subject: [PATCH 40/40] chore: update/add docs workflow --- .github/workflows/update_docs.yml | 40 +++++++++++++++++++++++++++++++ docs/contribute/docs.rst | 2 +- package.json | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update_docs.yml diff --git a/.github/workflows/update_docs.yml b/.github/workflows/update_docs.yml new file mode 100644 index 00000000..2c3d638d --- /dev/null +++ b/.github/workflows/update_docs.yml @@ -0,0 +1,40 @@ +--- + +name: Generate and Deploy Documentation + +on: + push: + branches: + - master + +jobs: + build-and-deploy-docs: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Install dependencies + run: yarn install + + - name: Check for relevant changes + id: check-changes + run: | + changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E "^(readme\.md|docs\/)") + if [ -z "$changed_files" ]; then + echo "No relevant changes. Exiting..." + exit 0 + fi + echo "::set-output name=changed_files::$changed_files" + + - name: Deploy to GitHub Pages + if: steps.check-changes.outputs.changed_files != '' + uses: totaldebug/sphinx-publish-action@master + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/contribute/docs.rst b/docs/contribute/docs.rst index 29d168cd..4e57cd1f 100644 --- a/docs/contribute/docs.rst +++ b/docs/contribute/docs.rst @@ -23,4 +23,4 @@ Adding pages To add new pages, add a new file in the appropriate directory, and then add a reference to the ``toc.rst`` file under the correct heading. -You can test the pages added by running the command ``yarn run docs-test`` +You can test the pages added by running the command ``yarn run docs-build`` diff --git a/package.json b/package.json index 098795a0..db42ce75 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "rollup": "rollup -c", "build": "rollup -c --bundleConfigAsCjs", "watch": "rollup -c --watch --config rollup-dev.config.js", - "docs-test": "sphinx-autobuild docs docs/_build/html" + "docs-build": "sphinx-autobuild docs docs/_build/html" }, "repository": { "type": "git",