From 7ba232da6211deb76bc11f1db4055a2f0733b7d8 Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Wed, 1 Jan 2025 18:03:17 +0100 Subject: [PATCH] fix soc display in middle graph --- .../source/src/assets/js/processMessages.ts | 2 +- .../components/batteryList/processMessages.ts | 2 +- .../source/src/components/powerGraph/PgSoc.vue | 16 ++++++++-------- .../src/components/smartHome/processMessages.ts | 2 +- .../colors/web/assets/index-B_SRXrzq.js | 6 ------ .../colors/web/assets/index-DU7jlsFU.js | 6 ++++++ .../modules/web_themes/colors/web/index.html | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 packages/modules/web_themes/colors/web/assets/index-B_SRXrzq.js create mode 100644 packages/modules/web_themes/colors/web/assets/index-DU7jlsFU.js diff --git a/packages/modules/web_themes/colors/source/src/assets/js/processMessages.ts b/packages/modules/web_themes/colors/source/src/assets/js/processMessages.ts index 87c0e071db..2e8c7f9421 100755 --- a/packages/modules/web_themes/colors/source/src/assets/js/processMessages.ts +++ b/packages/modules/web_themes/colors/source/src/assets/js/processMessages.ts @@ -313,6 +313,6 @@ function getIndex(topic: string): number | undefined { return undefined } } catch (e) { - console.warn('Parser error in getIndex for topic ' + topic + ': '+ e) + console.warn('Parser error in getIndex for topic ' + topic + ': ' + e) } } diff --git a/packages/modules/web_themes/colors/source/src/components/batteryList/processMessages.ts b/packages/modules/web_themes/colors/source/src/components/batteryList/processMessages.ts index 4ccf026968..a43bfd83de 100755 --- a/packages/modules/web_themes/colors/source/src/components/batteryList/processMessages.ts +++ b/packages/modules/web_themes/colors/source/src/components/batteryList/processMessages.ts @@ -65,6 +65,6 @@ function getIndex(topic: string): number | undefined { return undefined } } catch (e) { - console.warn('Parser error in getIndex for topic ' + topic + ': '+ e) + console.warn('Parser error in getIndex for topic ' + topic + ': ' + e) } } diff --git a/packages/modules/web_themes/colors/source/src/components/powerGraph/PgSoc.vue b/packages/modules/web_themes/colors/source/src/components/powerGraph/PgSoc.vue index b442288e6b..da7fc6e327 100755 --- a/packages/modules/web_themes/colors/source/src/components/powerGraph/PgSoc.vue +++ b/packages/modules/web_themes/colors/source/src/components/powerGraph/PgSoc.vue @@ -85,16 +85,16 @@ const vName = computed(() => { case 2: return 'Speicher' case 1: - if (vehicles[topVehicles.value[1]]) { + if (vehicles[topVehicles.value[1]] != undefined) { return vehicles[topVehicles.value[1]].name } else { - return 'oops' + return '???' } default: - if (vehicles[topVehicles.value[0]]) { + if (vehicles[topVehicles.value[0]] != undefined) { return vehicles[topVehicles.value[0]].name } else { - return 'hhhm' + return '???' } } }) @@ -113,10 +113,10 @@ const cpColor = computed(() => { }) const nameX = computed(() => { switch (props.order) { - case 1: - return props.width - 3 case 0: return 3 + case 1: + return props.width - 3 case 2: return props.width / 2 default: @@ -151,9 +151,9 @@ const nameY = computed(() => { const textPosition = computed(() => { switch (props.order) { case 0: - return 'end' - case 1: return 'start' + case 1: + return 'end' case 2: return 'middle' default: diff --git a/packages/modules/web_themes/colors/source/src/components/smartHome/processMessages.ts b/packages/modules/web_themes/colors/source/src/components/smartHome/processMessages.ts index fc52cf22f4..f093fef30c 100755 --- a/packages/modules/web_themes/colors/source/src/components/smartHome/processMessages.ts +++ b/packages/modules/web_themes/colors/source/src/components/smartHome/processMessages.ts @@ -158,6 +158,6 @@ function getIndex(topic: string): number | undefined { return undefined } } catch (e) { - console.warn('Parser error in getIndex for topic ' + topic + ': '+ e) + console.warn('Parser error in getIndex for topic ' + topic + ': ' + e) } } diff --git a/packages/modules/web_themes/colors/web/assets/index-B_SRXrzq.js b/packages/modules/web_themes/colors/web/assets/index-B_SRXrzq.js deleted file mode 100644 index d74d51a6c1..0000000000 --- a/packages/modules/web_themes/colors/web/assets/index-B_SRXrzq.js +++ /dev/null @@ -1,6 +0,0 @@ -var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Be,u as Nt,t as tt,b as xt,s as ue,d as L,p as wa,f as ka,w as Ra,o as l,g as v,h as S,j as r,n as q,k as P,l as w,q as pe,v as _,x as N,y as i,z as y,F as U,A as te,B as xa,C as Re,D as vt,E as nt,G as ot,H as dt,I as ht,J as it,K as Ja,L as He,M as K,N as Ya,O as Ve,P as ft,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as er,Y as tr,Z as ar,_ as rr,$ as nr,a0 as or,a1 as sr,a2 as ir}from"./vendor-CyQtMzsz.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const h of s.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&n(h)}).observe(document,{childList:!0,subtree:!0});function t(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=t(o);fetch(o.href,s)}})();var fe=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(fe||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const lr=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class cr{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function qt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new cr(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const ur=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:ur};let Ce;const{host:dr,port:hr,endpoint:pr,...Ca}=Pa,ia=`${Ca.protocol}://${dr}:${hr}${pr}`;try{console.debug("connectURL",ia),Ce=Na.connect(ia,Ca),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function gr(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Ke(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},n=>{if(n){console.error("MQTT Subscription error: "+n);return}})}function st(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Ht(a,e){let n=Ce.connected,o=0;for(;!n&&o<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await mr(100),n=Ce.connected,o+=1;if(o<20)try{Ce.publish(a,e,{qos:0},s=>{s&&console.warn("MQTT publish error: ",s),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(s){console.warn("MQTT publish: caught error: "+s)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function Qt(){return Pa.clientId}function mr(a){return new Promise(e=>setTimeout(e,a))}class vr{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",fe.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class fr{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Rt=le({});function yr(a){if(!(a in O)){O[a]=new vr(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function br(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(s=>s.visible);let n=-1;switch(e.length){case 0:n=t[0]?t[0].id:-1;break;default:n=e[0].connectedVehicle}let o=-1;switch(e.length){case 0:case 1:o=t[0]?t[0].id:-1;break;default:o=e[1].connectedVehicle}return n==o&&(o=t[1]?t[1].id:-1),n!=-1&&a.push(n),o!=-1&&a.push(o),console.log(a),a}),_r={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let n=_r[a];if(!n){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":n=n.replace("%",O[t].chargeTemplate.toString());break;default:n=n.replace("%",String(t))}switch(typeof e){case"number":Ht(n,JSON.stringify(+e));break;default:Ht(n,JSON.stringify(e))}}function Zt(a){Ht("openWB/set/command/"+Qt()+"/todo",JSON.stringify(a))}const be=500,xe=500,G={top:15,right:20,bottom:10,left:25},Xt=["charging","house","batIn","devices"];class wr{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const f=le(new wr),Ia=ee(Ha),qe=m(()=>[0,be-G.left-2*G.right].map(a=>Ia.value.applyX(a)));let mt=!0,lt=!0;function la(){mt=!1}function ca(){mt=!0}function ua(){lt=!1}function da(){lt=!0}function kr(a){lt=a}function yt(a){f.data=a,f.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(f.data=[]),f.waitForData=!0,Ke(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],Pr(),ct.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),st(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Ke(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)st(this.refreshTopicPrefix+a)},subscribeUpdates(){Ke(this.updateTopic)},unsubscribeUpdates(){st(this.updateTopic)}}),ce=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(f.graphMode=="day"||f.graphMode=="today"){f.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getDailyLog",data:{day:e}})}},deactivate(){st(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");f.data=[],Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getMonthlyLog",data:{month:e}})},deactivate(){st(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Je=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getYearlyLog",data:{year:e}})},deactivate(){st(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function Mr(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const $r=["evuIn","pv","batOut","evuOut"],Qe=ee(!1);function Kt(a,e){Object.entries(a).length>0?(Qe.value=!1,Object.entries(a.counter).forEach(([t,n])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=n.energy_imported,T.items.evuOut.energy+=n.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,n])=>{t=="all"?(T.setEnergy("charging",n.energy_imported),n.energy_imported_pv!=null&&(T.setEnergyPv("charging",n.energy_imported_pv),T.setEnergyBat("charging",n.energy_imported_bat))):T.setEnergy(t,n.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,n])=>{T.setEnergy(t,n.energy_imported);const o=t.substring(2);ae.get(+o).countAsHouse||(T.items.devices.energy+=n.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{$r.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Xt.includes(t)&&(j[t].energy=T.items[t].energy,j[t].energyPv=T.items[t].energyPv,j[t].energyBat=T.items[t].energyBat,j[t].pvPercentage=T.items[t].pvPercentage))}),f.graphMode=="today"&&(Object.values(O).forEach(t=>{const n=T.items["cp"+t.id];n&&(t.energyPv=n.energyPv,t.energyBat=n.energyBat,t.pvPercentage=n.pvPercentage)}),ae.forEach(t=>{const n=T.items["sh"+t.id];n&&(t.energy=n.energy,t.energyPv=n.energyPv,t.energyBat=n.energyBat,t.pvPercentage=n.pvPercentage)}))):Qe.value=!0,ct.value=!0}const Ie=m(()=>{const a=Be(f.data,e=>new Date(e.date));return a[0]&&a[1]?Nt().domain(a).range([0,be-G.left-2*G.right]):tt().range([0,0])});function Pr(){T.keys().forEach(a=>{Xt.includes(a)&&(j[a].energy=T.items[a].energy,j[a].energyPv=0,j[a].energyBat=0,j[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Ye=m(()=>{const a=Be(f.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-G.left-2]):xt().range([0,0])});function Ct(){switch(f.graphMode){case"live":f.graphMode="today",g.showRightButton=!0,ve();break;case"today":f.graphMode="day",ce.deactivate(),ce.back(),ce.activate(),ve();break;case"day":ce.back(),ve();break;case"month":Ee.back();break;case"year":Je.back();break}}function ea(){const a=new Date;switch(f.graphMode){case"live":break;case"today":f.graphMode="live",g.showRightButton=!1,ve();break;case"day":ce.forward(),ce.date.getDate()==a.getDate()&&ce.date.getMonth()==a.getMonth()&&ce.date.getFullYear()==a.getFullYear()&&(f.graphMode="today"),ve();break;case"month":Ee.forward();break;case"year":Je.forward();break}}function ta(){switch(f.graphMode){case"live":Ct();break;case"day":case"today":f.graphMode="month",ve();break;case"month":f.graphMode="year",ve();break}}function aa(){switch(f.graphMode){case"year":f.graphMode="month",ve();break;case"month":f.graphMode="today",ve();break;case"today":case"day":f.graphMode="live",ve();break}}function ha(a){if(f.graphMode=="day"||f.graphMode=="today"){ce.setDate(a);const e=new Date;ce.date.getDate()==e.getDate()&&ce.date.getMonth()==e.getMonth()&&ce.date.getFullYear()==e.getFullYear()?f.graphMode="today":f.graphMode="day",ve()}}const Ne=ee(new Map);class Cr{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,Lr(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,pa(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,pa(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,ca(),da(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,ca(),da(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cr);function Ba(){Tr();const a=ue("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Ir=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Br(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Ir),ye={instant_charging:{mode:fe.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:fe.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:fe.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:fe.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:fe.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Vr{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Ar()}function Lr(a){const e=ue("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function Or(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function pa(a){const e=ue("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Ar(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;samesite=none"}function Tr(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(n=>{ae.get(n)==null&&qt(n),ae.get(n).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function ra(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),j=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Vr);ee("");const ct=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Jt=ee(new Date),we=ee(new Map),Er=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},zr=["origin"],Wr=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let n={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},o=Q;o["zz-empty"]=n;const s=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ue("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(o))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==s?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let n=Q.pv.power+Q.evuIn.power+Q.batOut.power;n>g.maxPower&&(g.maxPower=n)}),(n,o)=>(l(),v("g",{id:"pmSourceArc",origin:t.value},null,8,zr))}}),Dr=["origin"],Gr=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let n={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const o=[j.evuOut,j.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([j.batIn,j.house]).concat(n),s=o.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ue("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(o)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==s?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(n,o)=>(l(),v("g",{id:"pmUsageArc",origin:t.value},null,8,Dr))}});function Me(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ut(a,e=1,t=!1){let n;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:n=Math.round(a/1e3);break;case 1:n=Math.round(a/100)/10;break;case 2:n=Math.round(a/10)/100;break;case 3:n=Math.round(a)/1e3;break;default:n=Math.round(a/100)/10;break}return n.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function jr(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Ur(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Fr(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>Me(e.watt,g.decimalPlaces));return(n,o)=>S(t.value)}}),Nr={key:0,id:"pmLabel"},Hr=["x","y","fill","text-anchor"],Rr=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),n=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),o=m(()=>!e.data||e.data.power>0),s=m(()=>e.labeltext?"":"fas");return(h,d)=>o.value?(l(),v("g",Nr,[r("text",{x:h.x,y:h.y,fill:n.value,"text-anchor":h.anchor,"font-size":Rr,class:"pmLabel"},[r("tspan",{class:q(s.value)},S(t.value),3),r("tspan",null,[h.data!==void 0?(l(),P(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Hr)])):w("",!0)}}),Jr={class:"wb-widget p-0 m-0 shadow"},Yr={class:"d-flex justify-content-between"},qr={class:"m-4 me-0 mb-0"},Qr={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Zr={class:"px-4 pt-4 pb-2 wb-subwidget"},Xr={class:"row"},Kr={class:"col m-0 p-0"},en={class:"container-fluid m-0 p-0"},tn={key:0},an={class:"px-4 py-2 wb-subwidget"},rn={class:"row"},nn={class:"col"},on={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(n,o)=>(l(),v("div",{class:q(["p-2 m-0 d-flex",t.value])},[r("div",Jr,[r("div",Yr,[r("h3",qr,[pe(n.$slots,"title",{},()=>[o[0]||(o[0]=r("div",{class:"p-0"},"(title goes here)",-1))]),pe(n.$slots,"subtitle")]),r("div",Qr,[pe(n.$slots,"buttons")])]),r("div",Zr,[r("div",Xr,[r("div",Kr,[r("div",en,[pe(n.$slots,"default")])])])]),n.$slots.footer!=null?(l(),v("div",tn,[o[1]||(o[1]=r("hr",null,null,-1)),r("div",an,[r("div",rn,[r("div",nn,[r("div",on,[pe(n.$slots,"footer")])])])])])):w("",!0)])],2))}});class sn{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new sn),ln={id:"powermeter",class:"p-0 m-0"},cn=["viewBox"],un=["transform"],dn=["x"],Ue=500,Fe=20,ga=1,hn=L({__name:"PowerMeter",setup(a){const e=Ue,t=Math.PI/40,n=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],o=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],s=m(()=>Ue/2-Fe),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+Me(j.house.power+j.charging.power+j.devices.power+j.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?Me(g.maxPower,g.decimalPlaces):Me(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[j.evuOut,j.charging,j.devices,j.batIn,j.house].filter(B=>B.power>0)),k=m(()=>n[c.value.length-1]);function C(B){return o[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const W=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),P(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[N(" Aktuelle Leistung ")])),default:_(()=>[r("figure",ln,[(l(),v("svg",{viewBox:"0 0 "+Ue+" "+i(e)},[r("g",{transform:"translate("+Ue/2+","+i(e)/2+")"},[y(Wr,{radius:s.value,"corner-radius":ga,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),y(Gr,{"sh-device":i(ae),radius:s.value,"corner-radius":ga,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),y(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),y(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),y(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),P(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),v(U,null,te(c.value,(V,J)=>(l(),P(Ae,{key:J,x:C(J).x,y:C(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),P(Ae,{key:1,x:-Ue/2-Fe/4+10,y:-i(e)/2+Fe+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0].color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),P(Ae,{key:2,x:Ue/2+Fe/4-10,y:-i(e)/2+Fe+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),P(Ae,{key:3,x:-Ue/2-Fe/4+10,y:i(e)/2-Fe+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(j).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),P(Ae,{key:4,x:Ue/2+Fe/4-10,y:i(e)/2-Fe+15,value:W.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),y(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),v("text",{key:5,x:Ue/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dn)):w("",!0)],8,un)],8,cn))])]),_:1}))}}),pn=["origin","origin2","transform"],gn=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var n,o;const s=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ue("g#pgSourceGraph");if(f.data.length>0){f.graphMode=="month"||f.graphMode=="year"?J(M,Ye.value):V(M,Ie.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(W.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(f.data)),c=m(()=>Re().range([e.height-10,0]).domain(f.graphMode=="year"?[0,Math.ceil(C.value[1]*10)/10]:[0,Math.ceil(C.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const $=/pv\d+/;f.data.length>0&&(M=Object.keys(f.data[0]).reduce((x,F)=>(F.match($)&&x.push(F),x),[]))}switch(f.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach(($,x)=>{t[$]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),C=m(()=>{let M=Be(f.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(f.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>f.graphMode=="month"||f.graphMode=="year"?-e.width-e.margin.right-22:-e.width),W=m(()=>vt(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const $=nt().x((F,Le)=>E(f.data[Le].date)).y(c.value(0)).curve(ot),x=nt().x((F,Le)=>E(f.data[Le].date)).y0(F=>c.value(f.graphMode=="year"?F[0]/1e3:F[0])).y1(F=>c.value(f.graphMode=="year"?F[1]/1e3:F[1])).curve(ot);mt?(M.selectAll("*").remove(),n=M.selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(F,Le)=>t[k.value[Le]]).attr("d",F=>$(F)),n.transition().duration(s).delay(h).ease(dt).attr("d",F=>x(F)),la()):n.data(p.value).transition().duration(0).ease(dt).attr("d",F=>x(F))}function J(M,E){f.data.length>0&&(mt?(M.selectAll("*").remove(),o=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",($,x)=>t[k.value[x]]).selectAll("rect").data($=>$).enter().append("rect").attr("x",($,x)=>E(f.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),o.transition().duration(s).delay(h).ease(dt).attr("height",$=>f.graphMode=="year"?c.value($[0]/1e3)-c.value($[1]/1e3):c.value($[0])-c.value($[1])).attr("y",$=>f.graphMode=="year"?c.value($[1]/1e3):c.value($[1])),la()):(M.selectAll("*").remove(),o=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",($,x)=>t[k.value[x]]).selectAll("rect").data($=>$).enter().append("rect").attr("x",($,x)=>E(f.data[x].date)??0).attr("y",$=>f.graphMode=="year"?c.value($[1]/1e3):c.value($[1])).attr("width",E.bandwidth()).attr("height",$=>f.graphMode=="year"?c.value($[0]/1e3)-c.value($[1]/1e3):c.value($[0])-c.value($[1]))))}const I=m(()=>{const M=ue("g#pgSourceGraph");if(f.graphMode!="month"&&f.graphMode!="year"&&f.data.length>0){Ie.value.range(qe.value);const E=nt().x(($,x)=>Ie.value(f.data[x].date)).y0($=>c.value($[0])).y1($=>c.value($[1])).curve(ot);M.selectAll("path").attr("d",$=>$?E($):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",$=>Ie.value($.date)).attr("width",e.width/f.data.length)}return"zoomed"});return(M,E)=>(l(),v("g",{id:"pgSourceGraph",origin:d.value,origin2:I.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pn))}}),mn=["origin","origin2","transform"],vn=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]:[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]),n={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var o,s;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const I=ue("g#pgUsageGraph");f.graphMode=="month"||f.graphMode=="year"?V(I):A(I),I.selectAll(".axis").remove();const M=I.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((I,M)=>I[M]??0).keys(C.value)),c=m(()=>p.value(f.data)),k=m(()=>Re().range([e.height+10,2*e.height]).domain(f.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),C=m(()=>{if(f.graphMode!="today"&&f.graphMode!="day"&&f.graphMode!="live")return t.value[e.stackOrder];{const I=t.value[e.stackOrder].slice(),M=I.indexOf("charging");I.splice(M,1);const E=/cp\d+/;let $=[];return f.data.length>0&&($=Object.keys(f.data[0]).reduce((x,F)=>(F.match(E)&&x.push(F),x),[])),$.forEach((x,F)=>{var Le;I.splice(M+F,0,x),n[x]=((Le=O[+x.slice(2)])==null?void 0:Le.color)??"black"}),g.showInverters&&I.push("evuOut"),I}}),z=m(()=>{let I=Be(f.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return I[0]!=null&&I[1]!=null?(f.graphMode=="year"&&(I[0]=I[0]/1e3,I[1]=I[1]/1e3),I):[0,0]}),W=m(()=>f.graphMode=="month"||f.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>vt(k.value).tickSizeInner(W.value).ticks(4).tickFormat(I=>(I==0?"":Math.round(I*10)/10).toLocaleString(void 0)));function A(I){const M=nt().x(($,x)=>Ie.value(f.data[x].date)).y(k.value(0)).curve(ot),E=nt().x(($,x)=>Ie.value(f.data[x].date)).y0($=>k.value($[0])).y1($=>k.value($[1])).curve(ot);g.showAnimations?lt?(I.selectAll("*").remove(),o=I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>M($)).attr("fill",($,x)=>n[C.value[x]]),o.transition().duration(300).delay(100).ease(dt).attr("d",$=>E($)),ua()):(I.selectAll("*").remove(),I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>E($)).attr("fill",($,x)=>n[C.value[x]])):(I.selectAll("*").remove(),I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>E($)).attr("fill",($,x)=>n[C.value[x]]))}function V(I){lt?(I.selectAll("*").remove(),s=I.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>n[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Ye.value(f.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Ye.value.bandwidth()),s.transition().duration(h).delay(d).ease(dt).attr("y",M=>f.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>f.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ua()):(I.selectAll("*").remove(),s=I.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>n[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Ye.value(f.data[E].date)??0).attr("y",M=>f.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>f.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Ye.value.bandwidth()))}const J=m(()=>{const I=ue("g#pgUsageGraph");if(f.graphMode!="month"&&f.graphMode!="year"){Ie.value.range(qe.value);const M=nt().x((E,$)=>Ie.value(f.data[$].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(ot);I.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(I,M)=>(l(),v("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+I.margin.left+","+I.margin.top+")"},null,8,mn))}}),fn=["transform"],yn=["origin","origin2","transform"],bn=["origin","transform"],_n={key:0},wn=["width","height"],kn={key:1},xn=["y","width","height"],Bt=12,Sn=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Ie.value).ticks(6).tickSizeInner(h.value).tickFormat(it("%H:%M"))),n=m(()=>Ja(Ie.value).ticks(6).tickSizeInner(h.value+3).tickFormat(it(""))),o=m(()=>ht(Ye.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),s=m(()=>ht(Ye.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>f.graphMode!=="month"&&f.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ue("g#PGXAxis");return c.selectAll("*").remove(),f.graphMode=="month"||f.graphMode=="year"?c.call(o.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(k,C)=>C>=0||f.graphMode=="month"||f.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),c.append("text").attr("x",-e.margin.left).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(f.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ue("g#PGXAxis2");return c.selectAll("*").remove(),f.graphMode=="month"||f.graphMode=="year"?c.call(s.value):c.call(n.value),c.selectAll(".tick > text").attr("fill",(k,C)=>C>=0||f.graphMode=="month"||f.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(f.graphMode!="month"&&f.graphMode!="year"){const c=ue("g#PGXAxis"),k=ue("g#PGXAxis2");f.graphMode=="month"||f.graphMode=="year"?(Ye.value.range(qe.value),c.call(o.value),k.call(s.value)):(Ie.value.range(qe.value),c.call(t.value),k.call(n.value))}return"zoomed"});return(c,k)=>(l(),v("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[r("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,yn),r("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,bn),i(g).showGrid?(l(),v("g",_n,[r("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,wn)])):w("",!0),i(g).showGrid?(l(),v("g",kn,[r("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,xn)])):w("",!0)],8,fn))}}),Mn=["id",".origin","d"],$n=["id","d","stroke"],Pn=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let C=Be(f.data,z=>z.date);return C[0]&&C[1]?tt().domain(C).range([0,e.width]):tt().range([0,0])}),n=m(()=>Re().range([e.height-10,0]).domain([0,100])),o=m(()=>{let z=He().x(W=>t.value(W.date)).y(W=>n.value(e.order==2?W.batSoc:e.order==0?W["soc"+me.value[0]]:W["soc"+me.value[1]])??n.value(0))(f.data);return z||""}),s=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]?Y[me.value[1]].name:"oops";default:return Y[me.value[0]]?Y[me.value[0]].name:"hhhm"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 1:return e.width-3;case 0:return 3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(f.data.length>0){let C;switch(e.order){case 0:return C=f.data.length-1,n.value(f.data[C]["soc"+me.value[0]]+2);case 1:return C=0,n.value(f.data[C]["soc"+me.value[1]]+2);case 2:return C=Math.round(f.data.length/2),n.value(f.data[C].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"end";case 1:return"start";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(f.graphMode!="month"&&f.graphMode!="year"){const C=ue("path#soc-"+s.value),z=ue("path#socdashes-"+s.value);t.value.range(qe.value);const W=He().x(B=>t.value(B.date)).y(B=>n.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??n.value(0));C.attr("d",W(f.data)),z.attr("d",W(f.data))}return"zoomed"});return(C,z)=>(l(),v(U,null,[r("path",{id:"soc-"+s.value,".origin":k.value,class:"soc-baseline",d:o.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Mn),r("path",{id:"socdashes-"+s.value,class:"soc-dashes",d:o.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,$n),r("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Pn)],64))}}),Cn=["transform"],In=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>Re().range([e.height-10,0]).domain([0,100])),n=m(()=>Ya(t.value).ticks(5).tickFormat(s=>s.toString()+"%"));function o(){let s=ue("g#PGSocAxis");s.call(n.value),s.selectAll(".tick").attr("font-size",12),s.selectAll(".tick line").attr("stroke","var(--color-bg)"),s.select(".domain").attr("stroke","var(--color-bg)")}return Ve(()=>{o()}),(s,h)=>(l(),v("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(s.width-20)+",0)"},null,8,Cn))}}),Bn={class:"d-flex align-self-top justify-content-center align-items-center"},Vn={class:"input-group input-group-xs"},Ln={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},On={class:"dropdown-menu"},An={class:"table optiontable"},Tn=["onClick"],En={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zn={class:"dropdown-menu"},Wn={class:"table optiontable"},Dn=["onClick"],Gn={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jn={class:"dropdown-menu"},Un={class:"table optiontable"},Fn=["onClick"],Nn=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=new Date().getFullYear();let o=Array.from({length:10},(z,W)=>n-W);const s=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const W=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=W;for(let I=0;I(l(),v("span",Bn,[r("div",Vn,[t.mode=="day"||t.mode=="today"?(l(),v("button",Ln,S(u.value),1)):w("",!0),r("div",On,[r("table",An,[(l(!0),v(U,null,te(k.value,(B,A)=>(l(),v("tr",{key:A,class:""},[(l(!0),v(U,null,te(B,(V,J)=>(l(),v("td",{key:J},[V!=0?(l(),v("span",{key:0,type:"button",class:"btn optionbutton",onClick:I=>u.value=V},S(V),9,Tn)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),v("button",En,S(p.value+1),1)):w("",!0),r("div",zn,[r("table",Wn,[(l(),v(U,null,te(d,(B,A)=>r("tr",{key:A,class:""},[(l(!0),v(U,null,te(B,(V,J)=>(l(),v("td",{key:J,class:"p-0 m-0"},[r("span",{type:"button",class:"btn btn-sm optionbutton",onClick:I=>p.value=V},S(V+1),9,Dn)]))),128))])),64))])]),t.mode!="live"?(l(),v("button",Gn,S(c.value),1)):w("",!0),r("div",jn,[r("table",Un,[(l(!0),v(U,null,te(i(o),(B,A)=>(l(),v("tr",{key:A,class:""},[r("td",null,[r("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Fn)])]))),128))])]),t.mode!="live"?(l(),v("button",{key:3,class:"button-outline-secondary",type:"button",onClick:C},W[0]||(W[0]=[r("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[n,o]of e)t[n]=o;return t},Hn=R(Nn,[["__scopeId","data-v-98690e5d"]]),Rn={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Jn=["id","value"],Yn=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(d){n("update:modelValue",d)}});function s(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(o.value=u.value)}return(d,u)=>(l(),v("div",null,[r("div",Rn,[(l(!0),v(U,null,te(d.options,(p,c)=>(l(),v("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==o.value?"active":""]),value:p.value,style:K(s(c)),onClick:h},[r("span",{style:K(s(c))},[p.icon?(l(),v("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),N(" "+S(p.text),1)],4)],14,Jn))),128))])]))}}),Oa=R(Yn,[["__scopeId","data-v-82ab6829"]]),qn=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),n=m(()=>{if(f.waitForData)return"Lädt";switch(f.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ce.date.getDate()+"."+(ce.date.getMonth()+1)+".";case"month":return Ur(Ee.month-1,Ee.year);case"year":return Je.year.toString();default:return"???"}}),o=["live","today","day","month","year"],s=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return f.graphMode},set(J){switch(J){case"day":k();break;case"today":C();break;case"live":c();break;case"month":z();break;case"year":W()}}}),d=m(()=>{switch(f.graphMode){case"live":case"today":return ce.getDate();case"month":return Ee.getDate();default:return ce.getDate()}});function u(J){ha(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){f.graphMode!="live"&&(f.graphMode="live",ve())}function k(){f.graphMode!="day"&&f.graphMode!="today"&&(f.graphMode="day",ve())}function C(){f.graphMode!="today"&&(f.graphMode="today",ha(new Date),ve())}function z(){f.graphMode!="month"&&(f.graphMode="month",ve())}function W(){f.graphMode!="year"&&(f.graphMode="year",ve())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,I)=>(l(),v("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),P(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":I[0]||(I[0]=M=>h.value=M),class:"m-2",options:o.map((M,E)=>({text:s[E],value:M,color:"var(--color-menu)",active:M==i(f).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),v("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:I[1]||(I[1]=M=>J.$emit("shiftUp"))},I[6]||(I[6]=[r("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),r("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),v("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:I[2]||(I[2]=M=>J.$emit("shiftLeft"))},I[7]||(I[7]=[r("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),v("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(n.value),1)):w("",!0),t.value==2?(l(),P(Hn,{key:2,"model-value":d.value,mode:i(f).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),v("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:I[3]||(I[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),r("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),v("span",{key:0,type:"button",class:"p-1",onClick:p},I[8]||(I[8]=[r("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),v("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:I[4]||(I[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),v("span",{key:2,type:"button",class:"p-1",onClick:I[5]||(I[5]=M=>t.value=0)},I[9]||(I[9]=[r("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(qn,[["__scopeId","data-v-d75ec1a4"]]),Qn=["x","fill"],Zn=["x"],Pe=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,n)=>(l(),v(U,null,[t.power>0?(l(),v("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,Qn)):w("",!0),r("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),P(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,Zn)],64))}}),Xn=["transform"],Kn=["width","height"],eo={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},to=["x"],ao=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),n=m(()=>t.value*16),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Wechselr.",id:u}))),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),v("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[r("rect",{rx:"5",width:u.boxwidth,height:n.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,Kn),r("text",eo,[r("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(it)("%H:%M")(new Date(u.entry.date))),9,to),p[0]||(p[0]=r("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),y(Pe,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(o.value,c=>(l(),P(Pe,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(s.value,c=>(l(),P(Pe,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(h.value,c=>(l(),P(Pe,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,Xn))}}),ro=["origin","transform"],no=["x","height","width"],ma=140,oo=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const s=Be(e.data,h=>new Date(h.date));return s[0]&&s[1]?Nt().domain(s).range([0,e.width-e.margin.right]):tt().range([0,0])}),n=m(()=>{const s=Be(e.data,h=>new Date(h.date));return s[0]&&s[1]?Nt().domain(s).range([0,e.width-e.margin.right-ma]):tt().range([0,0])}),o=m(()=>((f.graphMode=="day"||f.graphMode=="today")&&(t.value.range(qe.value),ue("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(s,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(qe.value[1]-qe.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(s,h)=>(l(),v("g",{id:"pgToolTips",origin:o.value,transform:"translate("+s.margin.left+","+s.margin.top+")"},[(l(!0),v(U,null,te(s.data,d=>(l(),v("g",{key:d.date,class:"ttarea"},[r("rect",{x:t.value(d.date),y:"0",height:s.height,class:"ttrect",width:i(f).data.length>0?s.width/i(f).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,no),y(ao,{entry:d,boxwidth:ma,"x-scale":n.value},null,8,["entry","x-scale"])]))),128))],8,ro))}}),so={class:"d-flex justify-content-end"},io={id:"powergraph",class:"p-0 m-0"},lo=["viewBox"],co=["transform"],uo=["x","y"],ho=2,po="Leistung / Ladestand ",go=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>ho&&(h=0),g.usageStackOrder=h,kr(!0)}function t(h){const d=[[0,G.top],[be,xe-G.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,xe]]).extent(d).filter(o).on("zoom",n))}function n(h){Ia.value=h.transform}function o(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function s(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Ve(()=>{const h=ue("svg#powergraph");t(h)}),(h,d)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(po))]),buttons:_(()=>[r("div",so,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:s},d[0]||(d[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[ft(r("figure",io,[(l(),v("svg",{id:"powergraph",viewBox:"0 0 "+i(be)+" "+i(xe)},[y(gn,{width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G)},null,8,["width","height","margin"]),y(vn,{width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),y(Sn,{width:i(be)-i(G).left-2*i(G).right,height:i(xe)-i(G).top-i(G).bottom,margin:i(G),"graph-data":i(f)},null,8,["width","height","margin","graph-data"]),r("g",{transform:"translate("+i(G).left+","+i(G).top+")"},[(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),P(Vt,{key:0,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:0},null,8,["width","height","margin"])):w("",!0),(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),P(Vt,{key:1,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:1},null,8,["width","height","margin"])):w("",!0),(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&i(de).isBatteryConfigured?(l(),P(Vt,{key:2,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:2},null,8,["width","height","margin"])):w("",!0),i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live"?(l(),P(In,{key:3,width:i(be)-i(G).left-i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G)},null,8,["width","height","margin"])):w("",!0)],8,co),i(f).graphMode=="day"||i(f).graphMode=="today"?(l(),P(oo,{key:0,width:i(be)-i(G).left-i(G).right,height:i(xe)-i(G).top-i(G).bottom,margin:i(G),data:i(f).data},null,8,["width","height","margin","data"])):w("",!0),r("g",{id:"button",type:"button",onClick:e},[r("text",{x:i(be)-10,y:i(xe)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[r("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,uo)])],8,lo))],512),[[qa,i(f).data.length>0]])]),_:1}))}}),mo=R(go,[["__scopeId","data-v-62d106b6"]]),vo=["id"],fo=["x","width","height","fill"],yo=["x","width","height"],bo=["x","y","width","height"],_o=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),n=m(()=>{let s=0;return e.item.energyPv>0&&(s=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),s>t.value&&(s=t.value),s}),o=m(()=>{let s=0;return e.item.energyBat>0&&(s=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),s>t.value&&(s=t.value),s});return(s,h)=>(l(),v("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[r("rect",{class:"bar",x:e.xScale(s.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:s.item.color},null,8,fo),r("rect",{class:"bar",x:e.xScale(s.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:n.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,yo),r("rect",{class:"bar",x:e.xScale(s.item.name)+e.xScale.bandwidth()/6,y:n.value,width:e.xScale.bandwidth()*2/3,height:o.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,bo)],8,vo))}}),wo={id:"emBargraph"},ko=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="day"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="day"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="day"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="day"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",wo,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(_o,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":n(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),s[0]||(s[0]=r("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),xo=["origin"],So=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>vt(e.yScale).tickFormat(s=>o(s)).ticks(6).tickSizeInner(-e.width)),n=m(()=>{const s=ue("g#emYAxis");return s.attr("class","axis").call(t.value),s.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),s.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?s.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):s.selectAll(".tick line").attr("stroke","var(--color-bg)"),s.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function o(s){return s>0?f.graphMode=="year"?(s/1e6).toString():(s/1e3).toString():""}return(s,h)=>(l(),v("g",{id:"emYAxis",class:"axis",origin:n.value},null,8,xo))}}),Mo=["id"],$o=["x","y","font-size"],Po=["x","y","font-size","fill"],Co=["x","y","font-size","fill"],Io=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),n=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),o=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function s(u,p){return p.length>o.value?p.substring(0,o.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),v("g",{id:"barlabel-"+e.item.name},[r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":n.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ut)(u.item.energy,i(g).decimalPlaces,!1)),9,$o),r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":n.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Po),r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":n.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(s(u.item.name,u.item.icon)),11,Co)],8,Mo))}}),Bo={id:"emBarLabels"},Vo=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="today"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="today"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",Bo,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(Io,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":n(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Lo={class:"d-flex justify-content-end"},Oo={id:"energymeter",class:"p-0 m-0"},Ao={viewBox:"0 0 500 500"},To=["transform"],Eo=["x"],zo={key:0},va=500,Lt=500,fa=12,Wo="Energie",Do=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=s.value;const c=T.items;let k=[];switch(g.debug&&h(),ct.value==!0&&(ct.value=!1),f.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?Qe.value=!0:(Qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(C=>{c["cp"+C]&&k.push(c["cp"+C])}),k.push(c.devices),ae.forEach((C,z)=>{C.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(C=>C.energy&&C.energy>0)}),n=m(()=>xt().range([0,va-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),o=m(()=>Re().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),s=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=j;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([j.batIn,j.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",s.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(Wo))]),buttons:_(()=>[r("div",Lo,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[r("figure",Oo,[(l(),v("svg",Ao,[r("g",{transform:"translate("+e.left+","+e.top+")"},[y(ko,{plotdata:t.value,"x-scale":n.value,"y-scale":o.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),y(So,{"y-scale":o.value,width:va,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),r("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(f).graphMode=="year"?"MWh":"kWh"),9,Eo),y(Vo,{plotdata:t.value,"x-scale":n.value,"y-scale":o.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,To)]))]),i(Qe)?(l(),v("p",zo,"No data")):w("",!0)]),_:1}))}}),Go=R(Do,[["__scopeId","data-v-32c82102"]]),jo=["id"],Uo=["y","width","fill"],Fo=["y","width"],No=["y","x","width"],Ho=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),n=m(()=>{let s=0;return e.item.energyPv>0&&(s=e.xScale(e.item.energyPv)),s>t.value&&(s=t.value),s}),o=m(()=>{let s=0;return e.item.energyBat>0&&(s=e.xScale(e.item.energyBat)),s>t.value&&(s=t.value),s});return(s,h)=>(l(),v("g",{id:`bar-${e.item.name}`},[r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:s.item.color},null,8,Uo),r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:n.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Fo),r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:n.value,rx:"3",ry:"3",height:"7",width:o.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,No)],8,jo))}}),Ro={id:"emBargraph"},Jo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,n)=>(l(),v("g",Ro,[(l(!0),v(U,null,te(e.plotdata,(o,s)=>(l(),v("g",{key:s},[y(Ho,{id:s.toString(),item:o,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Yo=["id"],qo=["y","x","fill"],Qo=["y","x"],Zo=["y","x","font-size"],Ot=24,Xo=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function n(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}return(o,s)=>(l(),v("g",{id:"barlabel-"+e.id},[r("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(e.item.icon),11,qo),r("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ut)(o.item.energy,i(g).decimalPlaces,!1)),9,Qo),r("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(n()),9,Zo)],8,Yo))}}),Ko={id:"emBarLabels"},es=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="today"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="today"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",Ko,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(Xo,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":o.itemHeight,"aut-text":n(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class ts{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class as{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new as);const he=ee(new Map),Aa=a=>{he.value.set(a,new ts(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function rs(){he.value=new Map}const ns={class:"d-flex justify-content-end"},os={id:"energymeter",class:"p-0 m-0"},ss=["viewBox"],is=["transform"],ls=["x"],cs={key:0},ya=500,At=60,us=12,ds="Energie",hs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>n.value.length*At+e.top+e.bottom),n=m(()=>{let c=Object.values(Q),k=h.value;const C=T.items;let z=[];switch(g.debug&&u(),ct.value==!0&&(ct.value=!1),f.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(C).length==0?Qe.value=!0:(Qe.value=!1,z=[C.evuIn,C.pv,C.evuOut,C.batOut,C.charging],Object.values(O).length>1&&Object.keys(O).forEach(W=>{C["cp"+W]&&z.push(C["cp"+W])}),z.push(C.devices),ae.forEach((W,B)=>{W.showInGraph&&C["sh"+B]&&z.push(C["sh"+B])}),z=z.concat([C.batIn,C.house]))}return z.filter(W=>W.energy&&W.energy>0)}),o=m(()=>Re().range([0,ya-e.left-e.right]).domain([0,Sa(n.value,c=>c.energy)])),s=m(()=>xt().range([e.top,t.value-e.bottom]).domain(n.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let C=j;return[...[C.evuOut,C.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[C.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([j.batIn,j.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(C=>{c.splice(2+k++,0,{name:C.name,power:C.power,energy:C.energy,energyPv:0,energyBat:0,pvPercentage:0,color:C.color,icon:C.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(C=>{c.splice(3+k++,0,{name:C.name,power:C.power,energy:C.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:C.color,icon:C.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(ds))]),buttons:_(()=>[r("div",ns,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[r("figure",os,[(l(),v("svg",{viewBox:"0 0 500 "+t.value},[r("g",{transform:"translate("+e.left+","+e.top+")"},[y(Jo,{plotdata:n.value,xscale:o.value,yscale:s.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),r("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":us},S(i(f).graphMode=="year"?"MWh":"kWh"),9,ls),y(es,{plotdata:n.value,yscale:s.value,width:ya,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,is)],8,ss))]),i(Qe)?(l(),v("p",cs,"No data")):w("",!0)]),_:1}))}}),ps=R(hs,[["__scopeId","data-v-63a4748e"]]),gs={class:"d-flex flex-column align-items-center justify-content-start infoitem"},ms=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),n=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),o=m(()=>e.small?"mt-0":"mt-1");return(s,h)=>(l(),v("span",gs,[r("span",{class:q(["d-flex heading",o.value]),style:K(t.value)},S(e.heading),7),r("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(n.value)},[pe(s.$slots,"default",{},void 0,!0)],4)]))}}),X=R(ms,[["__scopeId","data-v-f6af00e8"]]),vs={class:"d-flex justify-content-between align-items-center titlerow"},fs={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ys={class:"contentrow grid-col-12"},bs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let o={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(o.color=e.titlecolor),e.small&&(o["font-size"]="var(--font-verysmall)"),o}),n=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(o,s)=>(l(),v("div",{class:q(["wb-subwidget px-3 pt-2 my-0",n.value])},[r("div",vs,[r("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(o.$slots,"title",{},void 0,!0)],4),r("div",fs,[pe(o.$slots,"buttons",{},void 0,!0)])]),r("div",ys,[pe(o.$slots,"default",{},void 0,!0)])],2))}}),at=R(bs,[["__scopeId","data-v-e989060d"]]),_s={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},ws={class:"titlecolumn m-0 p-0 d-flex align-items-center"},ks={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},xs={class:"justify-content-stretch d-flex"},Ss=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function n(){t.value=!t.value}const o=m(()=>{let s={color:"var(--color-charging)"};return t.value&&(s.color="var(--color-battery)"),s});return(s,h)=>(l(),P(at,{fullwidth:!!s.fullwidth},{default:_(()=>[r("div",_s,[r("div",ws,[r("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:n},[e.icon?(l(),v("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),N(" "+S(s.title),1)]),r("span",null,[e.infotext?(l(),v("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(o.value),onClick:n},null,4)):w("",!0)])]),t.value?(l(),v("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:n},[h[0]||(h[0]=r("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),N(" "+S(s.infotext),1)])):w("",!0),r("div",ks,[r("span",xs,[pe(s.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),H=R(Ss,[["__scopeId","data-v-b935eb33"]]),Ms={class:"d-flex flex-column"},$s={class:"d-flex flex-fill justify-content-between align-items-center"},Ps={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Cs={key:0,id:"rangeIndicator",class:"rangeIndicator"},Is={viewBox:"0 0 100 2"},Bs=["width"],Vs=["x","width"],Ls=["x","width"],Os=["id","min","max","step"],As={class:"d-flex justify-content-between align-items-center"},Ts={class:"minlabel ps-4"},Es={class:"valuelabel"},zs={class:"maxlabel pe-4"},Ws=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=t.decimals??0,o=e,s=m({get(){return Math.round(t.modelValue*Math.pow(10,n))/Math.pow(10,n)},set(k){o("update:modelValue",k)}});function h(){s.value>t.min&&(s.value=Math.round((s.value-t.step)*Math.pow(10,n))/Math.pow(10,n))}function d(){s.valueRe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,C)=>(l(),v("span",Ms,[r("span",$s,[r("span",{type:"button",class:"minusButton",onClick:h},C[1]||(C[1]=[r("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),r("div",Ps,[t.showSubrange?(l(),v("figure",Cs,[(l(),v("svg",Is,[r("g",null,[r("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,Bs),r("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Vs),r("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Ls)])]))])):w("",!0),ft(r("input",{id:k.id,"onUpdate:modelValue":C[0]||(C[0]=z=>s.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,Os),[[Za,s.value,void 0,{number:!0}]])]),r("span",{type:"button",class:"plusButton",onClick:d},C[2]||(C[2]=[r("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),r("span",As,[r("span",Ts,S(k.min),1),r("span",Es,S(s.value)+" "+S(k.unit),1),r("span",zs,S(k.max),1)])]))}}),Se=R(Ws,[["__scopeId","data-v-267ede95"]]),Ds=["id","value"],Gs=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(d){n("update:modelValue",d)}});function s(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(o.value=u.value)}return(d,u)=>(l(),v("div",null,[(l(!0),v(U,null,te(d.options,(p,c)=>(l(),v("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==o.value?"active":""]),value:p[1],style:K(s(c)),onClick:h},[r("span",{style:K(s(c))},[p[3]?(l(),v("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),N(" "+S(p[0]),1)],4)],14,Ds))),128))]))}}),We=R(Gs,[["__scopeId","data-v-df222cbe"]]),js={class:"mt-2"},Us={key:0},Fs=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),n=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],o=m({get(){return t.value.instantMaxEnergy/1e3},set(s){t.value.instantMaxEnergy=s*1e3}});return(s,h)=>(l(),v("div",js,[h[4]||(h[4]=r("p",{class:"heading ms-1"},"Sofortladen:",-1)),y(H,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[y(Se,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),v("hr",Us)):w("",!0),y(H,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[y(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:n.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),P(H,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),P(H,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxEnergy",modelValue:o.value,"onUpdate:modelValue":h[3]||(h[3]=d=>o.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ns=R(Fs,[["__scopeId","data-v-0303d179"]]),Hs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(h){n("update:modelValue",h)}}),s=m(()=>o.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),v("div",Hs,[ft(r("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(s.value)},null,4),[[Ma,o.value]])]))}}),Rs={class:"pt-2"},Js={key:3},Ys=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),n=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),o=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),s=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),v("div",Rs,[d[8]||(d[8]=r("p",{class:"heading ms-1"},"PV-Laden:",-1)),y(H,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[y(se,{id:"limitSoc",modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u)},null,8,["modelValue"])]),_:1}),s.value?(l(),P(H,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),y(H,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[y(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),y(H,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[y(se,{modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),o.value?(l(),P(H,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[N(S(i(Te).minsoc),1)]),default:_(()=>[y(Se,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),o.value?(l(),P(H,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[y(Se,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),n.value||o.value?(l(),v("hr",Js)):w("",!0),y(H,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[y(se,{modelValue:n.value,"onUpdate:modelValue":d[6]||(d[6]=u=>n.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),n.value?(l(),P(H,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[y(Se,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),qs=R(Ys,[["__scopeId","data-v-faa69015"]]),Qs={class:"table table-borderless"},Zs={class:"tablecell"},Xs={class:"tablecell"},Ks={class:"tablecell"},ei={class:"tablecell"},ti={class:"tablecell left"},ai=["href"],ri=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,n=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function o(d){return n.value[d].time}function s(d){return{color:n.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":n.value[d].active?"bold":"regular"}}return(d,u)=>(l(),v(U,null,[u[1]||(u[1]=r("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),r("table",Qs,[u[0]||(u[0]=r("thead",null,[r("tr",null,[r("th",{class:"tableheader"},"Ziel"),r("th",{class:"tableheader"},"Limit"),r("th",{class:"tableheader"},"Zeit"),r("th",{class:"tableheader"},"Wiederholung"),r("th",{class:"tableheader"})])],-1)),r("tbody",null,[(l(!0),v(U,null,te(n.value,(p,c)=>(l(),v("tr",{key:c,style:K(h(c))},[r("td",Zs,S(p.limit.soc_scheduled)+"%",1),r("td",Xs,S(p.limit.soc_limit)+"%",1),r("td",Ks,S(o(c)),1),r("td",ei,S(e[p.frequency.selected]),1),r("td",ti,[r("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[r("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(c)),type:"button"},null,6)],8,ai)])],4))),128))])])],64))}}),ni=R(ri,[["__scopeId","data-v-e8f5ad9d"]]),oi={class:"table table-borderless"},si={class:"tablecell"},ii={class:"tablecell"},li={class:"tablecell"},ci={class:"tablecell"},ui={class:"tablecell left"},di=["href"],hi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,n=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function o(h){return{color:n.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function s(h){return{"font-weight":n.value[h].active?"bold":"regular"}}return(h,d)=>(l(),v(U,null,[d[1]||(d[1]=r("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),r("table",oi,[d[0]||(d[0]=r("thead",null,[r("tr",null,[r("th",{class:"tableheader"},"Von"),r("th",{class:"tableheader"},"Bis"),r("th",{class:"tableheader"},"Ladestrom"),r("th",{class:"tableheader"},"Wiederholung"),r("th",{class:"tableheader right"})])],-1)),r("tbody",null,[(l(!0),v(U,null,te(n.value,(u,p)=>(l(),v("tr",{key:p,style:K(s(p))},[r("td",si,S(u.time[0]),1),r("td",ii,S(u.time[1]),1),r("td",li,S(u.current)+" A",1),r("td",ci,S(e[u.frequency.selected]),1),r("td",ui,[r("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[r("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(p)),type:"button"},null,6)],8,di)])],4))),128))])])],64))}}),pi=R(hi,[["__scopeId","data-v-192e287b"]]),gi={class:"settingsheader mt-2 ms-1"},mi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,n)=>(l(),v(U,null,[r("p",gi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),y(H,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":n[0]||(n[0]=o=>i(Y)[e.vehicleId].chargeTemplateId=o),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(o=>[i(_e)[+o].name,o])},null,8,["modelValue","options"])]),_:1}),y(H,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":n[1]||(n[1]=o=>i(Y)[e.vehicleId].evTemplateId=o),modelModifiers:{number:!0},options:Object.keys(i(Rt)).map(o=>[i(Rt)[+o].name,o])},null,8,["modelValue","options"])]),_:1})],64))}}),vi=R(mi,[["__scopeId","data-v-fcb57a44"]]),fi={class:"settingsheader mt-2 ms-1"},yi=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(n,o)=>(l(),v(U,null,[r("p",fi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),y(H,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":o[0]||(o[0]=s=>i(t).chargeMode=s),options:Object.keys(i(ye)).map(s=>[i(ye)[s].name,s,i(ye)[s].color,i(ye)[s].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),y(H,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":o[1]||(o[1]=s=>i(t).connectedVehicle=s),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(s=>s.visible).map(s=>[s.name,s.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),y(H,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":o[2]||(o[2]=s=>i(t).isLocked=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),y(H,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":o[3]||(o[3]=s=>i(t).hasPriority=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),y(H,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":o[4]||(o[4]=s=>i(t).timedCharging=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),P(H,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":o[5]||(o[5]=s=>i(de).pvBatteryPriority=s),options:i(lr)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),P(H,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).etActive,"onUpdate:modelValue":o[6]||(o[6]=s=>i(t).etActive=s)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),bi=R(yi,[["__scopeId","data-v-e348a34c"]]),_i={class:"providername ms-1"},wi={class:"container"},ki={id:"pricechart",class:"p-0 m-0"},xi={viewBox:"0 0 400 300"},Si=["id","origin","transform"],Mi={key:0,class:"p-3"},$i={key:1,class:"d-flex justify-content-end"},Pi=["disabled"],Xe=400,ba=250,_a=12,Ci=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const n=ee(!1),o=ee(e.chargepoint),s=m({get(){return t.value},set(D){t.value=D,n.value=!0}});function h(){o.value&&(O[o.value.id].etMaxPrice=s.value),n.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let D=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{D.push([Oe,Z])}),D}),c=m(()=>p.value.length>1?(Xe-u.left-u.right)/p.value.length-1:0),k=m(()=>n.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),C=m(()=>{let D=Be(p.value,Z=>Z[0]);return D[1]&&(D[1]=new Date(D[1]),D[1].setTime(D[1].getTime()+36e5)),tt().range([u.left,Xe-u.right]).domain(D)}),z=m(()=>{let D=[0,0];return p.value.length>0?(D=Be(p.value,Z=>Z[1]),D[0]=Math.floor(D[0]-1),D[1]=Math.floor(D[1]+1)):D=[0,0],D}),W=m(()=>Re().range([ba-u.bottom,0]).domain(z.value)),B=m(()=>{const D=He(),Z=[[u.left,W.value(s.value)],[Xe-u.right,W.value(s.value)]];return D(Z)}),A=m(()=>{const D=He(),Z=[[u.left,W.value(g.lowerPriceBound)],[Xe-u.right,W.value(g.lowerPriceBound)]];return D(Z)}),V=m(()=>{const D=He(),Z=[[u.left,W.value(g.upperPriceBound)],[Xe-u.right,W.value(g.upperPriceBound)]];return D(Z)}),J=m(()=>{const D=He(),Z=[[u.left,W.value(0)],[Xe-u.right,W.value(0)]];return D(Z)}),I=m(()=>ht(C.value).ticks(6).tickSize(5).tickFormat(it("%H:%M"))),M=m(()=>vt(W.value).ticks(6).tickSizeInner(-(Xe-u.right-u.left)).tickFormat(D=>D.toString())),E=m(()=>{d.value==!0;const D=ue("g#"+$.value);D.selectAll("*").remove(),D.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Ze=>C.value(Ze[0])).attr("y",Ze=>W.value(Ze[1])).attr("width",c.value).attr("height",Ze=>W.value(z.value[0])-W.value(Ze[1])).attr("fill",Ze=>Ze[1]<=s.value?"var(--color-charging)":"var(--color-axis)");const Oe=D.append("g").attr("class","axis").call(I.value);Oe.attr("transform","translate(0,"+(ba-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",_a).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=D.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",_a).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&D.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),D.append("path").attr("d",A.value).attr("stroke","green"),D.append("path").attr("d",V.value).attr("stroke","red"),D.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),$=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let D=[];return re.etPriceList.forEach(Z=>{D.push(Z)}),D.sort((Z,Oe)=>Z-Oe)});function F(){let D=x.value[0];for(let Z of x.value){if(Z>=s.value)break;D=Z}s.value=D}function Le(){let D=x.value[0];for(let Z of x.value)if(Z>s.value){D=Z;break}else D=Z;s.value=D}return Ve(()=>{d.value=!d.value}),(D,Z)=>(l(),v(U,null,[Z[3]||(Z[3]=r("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),r("p",_i,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=r("hr",null,null,-1)),r("div",wi,[r("figure",ki,[(l(),v("svg",xi,[r("g",{id:$.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Si)]))])]),D.chargepoint!=null?(l(),v("div",Mi,[D.chargepoint.etActive?(l(),P(Se,{key:0,id:"pricechart_local",modelValue:s.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>s.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),r("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[r("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:F},Z[1]||(Z[1]=[r("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),r("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:Le},Z[2]||(Z[2]=[r("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),D.chargepoint!=null?(l(),v("div",$i,[r("span",{class:"me-3 pt-0",onClick:h},[r("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!n.value}," Bestätigen ",12,Pi)])])):w("",!0)],64))}}),Ta=R(Ci,[["__scopeId","data-v-8ec7a31d"]]),Ii={class:"status-string"},Bi={style:{color:"red"}},Vi={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Li={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},Oi=["data-bs-target"],Ai=["data-bs-target"],Ti=["data-bs-target"],Ei=["data-bs-target"],zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},ji=["id"],Ui=["id"],Fi=["id"],Ni=["id"],Hi=["id"],Ri=["id"],Ji=["id"],Yi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,n=m(()=>_e[t.chargeTemplate]),o=m(()=>t.id);return Ve(()=>{}),(s,h)=>(l(),v(U,null,[y(H,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[r("span",Ii,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),P(H,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[r("span",Bi,S(i(t).faultStr),1)]),_:1})):w("",!0),r("div",Vi,[r("nav",Li,[r("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+o.value},h[0]||(h[0]=[r("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,Oi),s.chargepoint.chargeMode=="instant_charging"?(l(),v("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+o.value},h[1]||(h[1]=[r("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Ai)):w("",!0),s.chargepoint.chargeMode=="pv_charging"?(l(),v("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+o.value},h[2]||(h[2]=[r("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Ti)):w("",!0),s.chargepoint.chargeMode=="scheduled_charging"?(l(),v("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+o.value},h[3]||(h[3]=[r("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Ei)):w("",!0),s.chargepoint.timedCharging?(l(),v("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+o.value},h[4]||(h[4]=[r("i",{class:"fa-solid fa-clock"},null,-1)]),8,zi)):w("",!0),r("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+o.value},h[5]||(h[5]=[r("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Wi),i(re).active&&i(t).etActive?(l(),v("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+o.value},h[6]||(h[6]=[r("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Di)):w("",!0)]),r("div",Gi,[r("div",{id:"chargeSettings"+o.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[y(bi,{chargepoint:s.chargepoint},null,8,["chargepoint"])],8,ji),r("div",{id:"instantSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[y(Ns,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ui),r("div",{id:"pvSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[y(qs,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Fi),r("div",{id:"scheduledSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[n.value!=null?(l(),P(ni,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Ni),r("div",{id:"timeSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[n.value!=null?(l(),P(pi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Hi),r("div",{id:"carSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),P(vi,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Ri),r("div",{id:"priceChart"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),P(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Ji)])])],64))}}),Yt=R(Yi,[["__scopeId","data-v-1164316d"]]),qi={class:"d-flex justify-content-center align-items-center"},Qi=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),n=m(()=>({color:e.color??"var(--color-menu)"}));return(o,s)=>(l(),v("span",qi,[r("i",{class:q(["fa me-1",t.value]),style:K(n.value)},null,6),N(" "+S(Math.round(o.soc)+"%"),1)]))}}),It=R(Qi,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ut(e.wattH,g.decimalPlaces));return(n,o)=>(l(),v("span",null,S(t.value),1))}}),Zi={class:"wb-widget p-0 m-0 shadow widgetWidth"},Xi={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},Ki={class:"d-flex align-items-center widgetname p-0 m-0"},el={class:"buttonrea d-flex float-right justify-content-end align-items-center"},tl={class:"grid12 pb-3"},al=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(n,o)=>(l(),v("div",{class:q(["p-2 m-0",t.value])},[r("div",Zi,[r("div",Xi,[r("div",Ki,[pe(n.$slots,"title",{},()=>[o[0]||(o[0]=r("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(n.$slots,"subtitle",{},void 0,!0)]),r("div",el,[pe(n.$slots,"buttons",{},void 0,!0)])]),r("div",tl,[pe(n.$slots,"default",{},void 0,!0)])])],2))}}),je=R(al,[["__scopeId","data-v-1d5bc1d9"]]),rl=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(n,o)=>(l(),v("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(n.$slots,"default",{},void 0,!0)],4))}}),$e=R(rl,[["__scopeId","data-v-36112fa3"]]),nl={class:"d-flex justify-content-center align-items-center"},ol={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},sl={key:0},il={key:1,class:"row m-0 mt-0 p-0"},ll={class:"col m-0 p-0"},cl={key:0},ul={class:"row"},dl={class:"col"},hl={class:"carTitleLine d-flex justify-content-between align-items-center"},pl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},gl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},ml={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},vl={class:"grid12"},fl={style:{color:"var(--color-charging)"}},yl={style:{color:"var(--color-charging)"}},bl={style:{color:"var(--color-charging)"}},_l={class:"targetCurrent"},wl={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},kl={class:"d-flex justify-content-stretch align-items-center"},xl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Sl=["id"],Ml=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),n=m({get(){return e.chargepoint.chargeMode},set($){O[e.chargepoint.id].chargeMode=$}}),o=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),s=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const $=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,F=e.chargepoint.dailyYield;return x>0?Math.round($/x*F).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let $="";return e.chargepoint.isLocked?$="fa-lock":e.chargepoint.isCharging?$=" fa-bolt":e.chargepoint.isPluggedIn&&($="fa-plug"),"fa "+$}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),C=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),W=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",I.value,e.chargepoint.connectedVehicle),A.value=!1}const I=m({get(){return e.chargepoint.soc},set($){O[e.chargepoint.id].soc=$}}),M=m(()=>{const[$]=re.etPriceList.values();return(Math.round($*10)/10).toFixed(1)}),E=ee(!1);return($,x)=>(l(),v(U,null,[B.value?w("",!0):(l(),P(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[r("span",nl,[r("span",{style:K(C.value),onClick:x[0]||(x[0]=F=>B.value=!B.value)},[x[12]||(x[12]=r("span",{class:"fa-solid fa-charging-station"}," ",-1)),N(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),v("span",ol,"Fehler")):w("",!0)])]),buttons:_(()=>[r("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=F=>B.value=!B.value)},x[13]||(x[13]=[r("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),v("div",cl,[r("div",ul,[r("div",dl,[r("div",hl,[r("h3",{onClick:x[3]||(x[3]=F=>B.value=!B.value)},[x[14]||(x[14]=r("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),N(" "+S($.chargepoint.vehicleName)+" ",1),$.chargepoint.hasPriority?(l(),v("span",pl)):w("",!0),$.chargepoint.etActive?(l(),v("span",gl)):w("",!0),$.chargepoint.timedCharging?(l(),v("span",ml)):w("",!0)]),$.chargepoint.isSocConfigured?(l(),P($e,{key:0,bgcolor:W.value},{default:_(()=>[y(It,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),$.chargepoint.isSocManual?(l(),v("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=F=>A.value=!A.value)})):w("",!0),$.chargepoint.isSocManual?w("",!0):(l(),v("i",{key:1,type:"button",class:q(["fa-solid fa-sm",$.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),r("div",vl,[y(Oa,{id:"chargemode-"+$.chargepoint.name,modelValue:n.value,"onUpdate:modelValue":x[5]||(x[5]=F=>n.value=F),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(F=>({text:i(ye)[F].name,value:F,color:i(ye)[F].color,icon:i(ye)[F].icon,active:i(ye)[F].mode==$.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),P(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[r("span",fl,[y(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[r("span",yl,S(s.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[r("span",bl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[r("span",_l,S(o.value),1)]),_:1})):w("",!0),y(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":Math.max($.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),y(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[N(S(h.value),1)]),_:1}),$.chargepoint.isSocConfigured?(l(),P(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[N(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),v("div",wl,[x[15]||(x[15]=r("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),r("span",kl,[r("span",null,[y(Se,{id:"manualSoc",modelValue:I.value,"onUpdate:modelValue":x[6]||(x[6]=F=>I.value=F),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),r("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=r("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),P(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[y(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=F=>t.value.etActive=F)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),P(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[r("span",{type:"button",onClick:x[8]||(x[8]=F=>E.value=!E.value)},[N(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),v("i",xl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),P(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[r("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),v("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),P(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),r("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=F=>E.value=!1)},x[16]||(x[16]=[r("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Sl)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),v("div",sl,[r("div",{class:"grid12",onClick:x[2]||(x[2]=F=>B.value=!B.value)},[y(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[r("span",{style:K({color:u.value})},[r("i",{class:q(p.value)},null,2),N(" "+S(d.value),1)],4)]),_:1}),y(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":$.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),v("div",il,[r("div",ll,[$.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:$.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),P(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[r("span",{style:K(C.value),onClick:x[10]||(x[10]=F=>B.value=!B.value)},[x[18]||(x[18]=r("span",{class:"fas fa-gear"}," ",-1)),N(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=F=>B.value=!B.value)},x[19]||(x[19]=[r("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[$.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:$.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),$l=R(Ml,[["__scopeId","data-v-3a733de3"]]),Pl=["id"],Cl={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Il={class:"modal-content"},Bl={class:"modal-header"},Vl={class:"modal-title"},Ll={class:"modal-body",style:{"background-color":"var(--color-bg)"}},Ol=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Ve(()=>{}),(t,n)=>(l(),v("div",{id:e.modalId,class:"modal fade"},[r("div",Cl,[r("div",Il,[r("div",Bl,[r("h3",Vl,[pe(t.$slots,"title",{},void 0,!0)]),n[0]||(n[0]=r("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[r("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),r("div",Ll,[pe(t.$slots,"default",{},void 0,!0),n[1]||(n[1]=r("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Pl))}}),Ea=R(Ol,[["__scopeId","data-v-eaefae30"]]),Al={class:"d-flex align-items-center"},Tl={class:"cpname"},El={class:"d-flex float-right justify-content-end align-items-center"},zl=["data-bs-target"],Wl=["data-bs-target"],Dl={class:"subgrid"},Gl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},jl={class:"d-flex flex-column align-items-center px-0"},Ul={class:"d-flex justify-content-center flex-wrap"},Fl={class:"d-flex align-items-center"},Nl={class:"badge phasesInUse rounded-pill"},Hl={class:"d-flex flex-wrap justify-content-center chargeinfo"},Rl={class:"me-1"},Jl={key:0,class:"subgrid socEditRow m-0 p-0"},Yl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},ql={class:"d-flex justify-content-stretch align-items-center"},Ql=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),n=m(()=>ye[e.chargepoint.chargeMode].icon),o=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),s=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>Me(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ut(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),C=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function W(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),v(U,null,[y(at,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[r("div",Al,[r("span",Tl,S(V.chargepoint.name),1),r("span",{class:"badge rounded-pill statusbadge mx-2",style:K(s.value)},[r("i",{class:q([o.value,"me-1"])},null,2),N(" "+S(A.value),1)],4)])]),buttons:_(()=>[r("div",El,[r("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[r("i",{class:q(["fa me-1",n.value])},null,2),N(" "+S(C.value),1)],12,zl),r("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Wl)])]),default:_(()=>[r("div",Dl,[y(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),v("span",Gl,[V.chargepoint.soc?(l(),P(It,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),v("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=I=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),v("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),y(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[r("div",jl,[r("span",Ul,[r("span",null,S(d.value),1),r("span",Fl,[r("span",Nl,S(p.value),1),r("span",null,S(u.value),1)])])])]),_:1}),y(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[r("div",Hl,[r("span",Rl,S(c.value),1),r("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),v("div",Jl,[r("div",Yl,[J[2]||(J[2]=r("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),r("span",ql,[r("span",null,[y(Se,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=I=>B.value=I),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),r("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:W})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),P(Xa,{to:"body"},[(l(),P(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[N(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),Zl=R(Ql,[["__scopeId","data-v-25e4aa5d"]]),Xl=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,n)=>(l(),P(je,{"variable-width":!0},{title:_(()=>n[0]||(n[0]=[r("span",{class:"fa-solid fa-charging-station"}," ",-1),N(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),P($e,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[N("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),v(U,null,te(e.value,(o,s)=>(l(),v("div",{key:s,class:"subgrid pb-2"},[y(Zl,{chargepoint:o},null,8,["chargepoint"])]))),128))]),_:1}))}}),Kl=R(Xl,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const n=a,o=m(()=>{let p=Object.values(O);return u(),p}),s=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+n.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Ve(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),v(U,null,[n.compact?w("",!0):(l(),v("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",s.value])},[(l(!0),v(U,null,te(o.value,k=>(l(),v("swiper-slide",{key:k.id},[r("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[y($l,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),n.compact?(l(),P(Kl,{key:1})):w("",!0)],64))}}),ec={class:"container-fluid p-0 m-0"},tc={class:"row p-0 m-0"},ac={class:"d-grid gap-2"},rc=["onClick"],nc={class:"col-md-4 p-1"},oc={class:"d-grid gap-2"},sc={key:0},ic={class:"row justify-content-center m-1 p-0"},lc={class:"col-lg-4 p-1 m-0"},cc={class:"d-grid gap-2"},uc={class:"col-lg-4 p-1 m-0"},dc={class:"d-grid gap-2"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],n=m(()=>O[e.cpId]);function o(p){return p==n.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function s(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){n.value.chargeMode=p}function d(p){n.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),v("div",ec,[r("div",tc,[(l(),v(U,null,te(t,(k,C)=>r("div",{key:C,class:"col-md-4 p-1"},[r("div",ac,[r("button",{type:"button",class:q(o(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,rc)])])),64)),r("div",nc,[r("div",oc,[n.value.isLocked?(l(),v("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),n.value.isLocked?w("",!0):(l(),v("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),v("div",sc,[c[8]||(c[8]=r("hr",null,null,-1)),c[9]||(c[9]=r("div",{class:"row"},[r("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),r("div",ic,[r("div",lc,[r("div",cc,[r("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[N(" EV "),r("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),r("div",uc,[r("div",dc,[r("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[N(" Speicher "),r("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),r("div",hc,[r("div",pc,[r("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[N(" MinSoc "),r("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),mc={class:"col-lg-4 p-0 m-0 mt-1"},vc={class:"d-grid gap-2"},fc=["data-bs-target"],yc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},bc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},_c={key:0,class:"ms-2"},wc={class:"m-0 p-0"},kc={key:0,class:"ps-1"},xc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,n=m(()=>ye[e.chargepoint.chargeMode].name),o=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),s=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case fe.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case fe.standby:case fe.stop:c.background="darkgrey",c.color="black";break;case fe.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),v("div",mc,[r("div",vc,[r("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(o.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[r("div",yc,[r("span",bc,[r("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),v("span",_c,S(i(Me)(c.chargepoint.power)),1)):w("",!0)]),r("span",wc,S(c.chargepoint.name),1),r("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(s.value)},[r("i",{class:q(["fa me-1",h.value])},null,2),N(" "+S(n.value)+" ",1),c.chargepoint.chargeMode==i(fe).pv_charging&&i(de).isBatteryConfigured?(l(),v("span",kc,[k[0]||(k[0]=N(" ( ")),r("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=N(") "))])):w("",!0)],4)])],12,fc)]),y(Ea,{"modal-id":t},{title:_(()=>[N(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[y(gc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Sc=R(xc,[["__scopeId","data-v-31df6764"]]),Mc={class:"row p-0 mt-0 mb-1 m-0"},$c={class:"col p-0 m-0"},Pc={class:"container-fluid p-0 m-0"},Cc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Ic={key:0,class:"col time-display"},Bc=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),v("div",Mc,[r("div",$c,[r("div",Pc,[r("div",Cc,[i(g).showClock=="buttonbar"?(l(),v("span",Ic,S(i(La)(i(Jt))),1)):w("",!0),(l(!0),v(U,null,te(i(O),(n,o)=>(l(),P(Sc,{key:o,chargepoint:n,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Vc=R(Bc,[["__scopeId","data-v-791e4be0"]]),Lc={class:"battery-title"},Oc={class:"subgrid pt-1"},Ac=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${Me(-e.bat.power)})`:e.bat.power>0?`Lädt (${Me(e.bat.power)})`:"Bereit"),n=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",Lc,S(o.bat.name),1)]),buttons:_(()=>[y($e,{bgcolor:n.value},{default:_(()=>[N(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[r("div",Oc,[y(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[y(It,{soc:e.bat.soc},null,8,["soc"])]),_:1}),y(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),y(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Tc=R(Ac,[["__scopeId","data-v-f7f825f7"]]),Ec={class:"px-3 subgrid grid-12"},zc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${Me(Q.batOut.power)})`:j.batIn.power>0?`Lädt (${Me(j.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":j.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),n=m(()=>{let o=0;return he.value.forEach(s=>{o+=s.dailyYieldImport}),o});return(o,s)=>i(de).isBatteryConfigured?(l(),P(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>s[0]||(s[0]=[r("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),r("span",null,"Speicher",-1)])),buttons:_(()=>[y($e,{bgcolor:t.value},{default:_(()=>[N(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[r("div",Ec,[y(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[y(It,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),y(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[r("span",null,S(i(ut)(n.value)),1)]),_:1}),y(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[r("span",null,S(i(ut)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),v(U,null,te(i(he),([h,d])=>(l(),P(Tc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(zc,[["__scopeId","data-v-cc4da23c"]]),Wc={class:"devicename"},Dc={class:"subgrid"},Gc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),n=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function o(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function s(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),P(at,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[r("span",Wc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),v(U,null,te(d.device.temp,(p,c)=>(l(),v("span",{key:c},[p<300?(l(),P($e,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[r("span",null,S(i(Fr)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),v("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(n.value),onClick:o},null,6)):w("",!0),e.device.canSwitch?(l(),P($e,{key:1,type:"button",onClick:s},{default:_(()=>[N(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",Dc,[y(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[y(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),y(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),y(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[N(S(i(jr)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),jc=R(Gc,[["__scopeId","data-v-20651ac6"]]),Uc={class:"sh-title py-4"},Fc=["id","onUpdate:modelValue","value"],Nc=["for"],Hc=3,Rc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=Hc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function n(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function o(){s.value=!s.value}const s=ee(!1);return(h,d)=>(l(),v(U,null,[(l(!0),v(U,null,te(e.value,(u,p)=>(l(),P(je,{key:p,"variable-width":!0},{title:_(()=>[r("span",{onClick:o},[d[0]||(d[0]=r("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),r("span",Uc,S(n(p)),1)])]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",onClick:o},d[1]||(d[1]=[r("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),v(U,null,te(u,c=>(l(),P(jc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),s.value?(l(),P(je,{key:0},{title:_(()=>[r("span",{class:"smarthome",onClick:o},d[2]||(d[2]=[r("span",{class:"fas fa-gear"}," ",-1),N(" Einstellungen")]))]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",onClick:o},d[3]||(d[3]=[r("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[y(H,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),v(U,null,te(t.value,(u,p)=>(l(),v("div",{key:p},[ft(r("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Fc),[[Ma,u.showInGraph]]),r("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Nc)]))),128))]),_:1}),r("div",{class:"row p-0 m-0",onClick:o},d[4]||(d[4]=[r("div",{class:"col-12 mb-3 pe-3 mt-0"},[r("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Rc,[["__scopeId","data-v-5b5cf6b3"]]),Jc={class:"countername"},Yc={class:"subgrid pt-1"},qc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),n=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",Jc,S(o.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),P($e,{key:0,bgcolor:n.value},{default:_(()=>[N(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),y($e,{color:"var(--color-bg)"},{default:_(()=>[N(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[r("div",Yc,[y(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[y(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),y(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),y(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Qc=R(qc,[["__scopeId","data-v-01dd8c4d"]]);class Zc{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function Xc(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new Zc(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const Kc=L({__name:"CounterList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),r("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),v(U,null,te(i(ke),(n,o)=>(l(),v("div",{key:o,class:"subgrid pb-2"},[y(Qc,{counter:n},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(Kc,[["__scopeId","data-v-5f059284"]]),eu={class:"vehiclename"},tu={class:"subgrid"},au=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let o="Unterwegs",s=e.vehicle.chargepoint;return s!=null&&(s.isCharging?o="Lädt ("+s.name+")":s.isPluggedIn&&(o="Bereit ("+s.name+")")),o}),n=m(()=>{let o=e.vehicle.chargepoint;return o!=null?o.isLocked?"var(--color-evu)":o.isCharging?"var(--color-charging)":o.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",eu,S(e.vehicle.name),1)]),default:_(()=>[r("div",tu,[y(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[r("span",{style:K({color:n.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),y(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[N(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),y(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[N(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),ru=R(au,[["__scopeId","data-v-9e2cb63e"]]),nu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),r("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),v(U,null,te(Object.values(i(Y)).filter(n=>n.visible),(n,o)=>(l(),v("div",{key:o,class:"subgrid"},[y(ru,{vehicle:n},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(nu,[["__scopeId","data-v-23b437ea"]]),ou={class:"grapharea"},su={id:"pricechart",class:"p-1 m-0 pricefigure"},iu={viewBox:"0 0 400 280"},lu=["id","origin","transform"],rt=380,Gt=250,jt=12,cu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),n={top:0,bottom:15,left:20,right:0},o=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),s=m(()=>o.value.length>1?(rt-n.left-n.right)/o.value.length:0),h=m(()=>{let A=Be(o.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),tt().range([n.left,rt-n.right]).domain(A)}),d=m(()=>{let A=Be(o.value,V=>V[1]);return A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1,A}),u=m(()=>Re().range([Gt-n.bottom,0]).domain(d.value)),p=m(()=>{const A=He(),V=[[n.left,u.value(g.lowerPriceBound)],[rt-n.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=He(),V=[[n.left,u.value(g.upperPriceBound)],[rt-n.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=He(),V=[[n.left,u.value(0)],[rt-n.right,u.value(0)]];return A(V)}),C=m(()=>ht(h.value).ticks(o.value.length).tickSize(5).tickSizeInner(-Gt).tickFormat(A=>A.getHours()%6==0?it("%H:%M")(A):"")),z=m(()=>vt(u.value).ticks(15).tickSize(0).tickSizeInner(-(rt-n.right-n.left)).tickFormat(A=>A.toString())),W=m(()=>{t.value==!0;const A=ue("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(o.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",s.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(C.value);J.attr("transform","translate(0,"+(Gt-n.bottom)+")"),J.selectAll(".tick").attr("font-size",jt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const I=A.append("g").attr("class","axis").call(z.value);I.attr("transform","translate("+n.left+",0)"),I.selectAll(".tick").attr("font-size",jt).attr("color","var(--color-bg)"),I.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),I.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(o.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",s.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+s.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const $=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",jt).attr("fill","var(--color-bg)");return $.append("tspan").attr("x",30).attr("dy","0em").text(x=>it("%H:%M")(x[0])),$.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Ve(()=>{t.value=!t.value}),(A,V)=>(l(),P(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[r("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),r("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),P($e,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[N(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),P($e,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[N(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",ou,[r("figure",su,[(l(),v("svg",iu,[r("g",{id:B.value,origin:W.value,transform:"translate("+n.top+","+n.left+") "},null,8,lu)]))])])]),_:1}))}}),Ut=R(cu,[["__scopeId","data-v-2b0afbac"]]),uu={class:"subgrid pt-1"},du=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(n,o)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",{class:"invertername",style:K(t.value)},S(n.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),P($e,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[N(S(i(Me)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",uu,[y(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),y(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),y(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),hu=R(du,[["__scopeId","data-v-258d8f17"]]),pu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),r("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),P($e,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[N(S(i(Me)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),v(U,null,te(i(we),([n,o])=>(l(),v("div",{key:n,class:"subgrid pb-2"},[y(hu,{inverter:o},null,8,["inverter"])]))),128))]),_:1}))}}),Ft=R(pu,[["__scopeId","data-v-b7a71f81"]]),gu={class:"row py-0 px-0 m-0"},mu=["breakpoints"],vu=L({__name:"CarouselFix",setup(a){let e,t;const n=ee(!1),o=m(()=>n.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,s=>{if(e){let h=s?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Ve(()=>{let s=document.querySelector(".swiper-carousel");s&&(t=s,e=t.swiper)}),(s,h)=>(l(),v("div",gu,[r("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:o.value},[r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item1",{},void 0,!0)],2)]),r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item2",{},void 0,!0)],2)]),r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item3",{},void 0,!0)],2)])],8,mu)]))}}),fu=R(vu,[["__scopeId","data-v-17424929"]]);function yu(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?bu(a,e):a=="openWB/graph/lastlivevaluesJson"?_u(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function bu(a,e){if(!ge.initialized){let t=[];const n=e.toString().split(` -`);n.length>1?t=n.map(h=>JSON.parse(h)):t=[];const o=a.match(/(\d+)$/g),s=o?o[0]:"";s!=""&&typeof ge.rawDataPacks[+s-1]>"u"&&(ge.rawDataPacks[+s-1]=t,ge.initCounter++)}if(ge.initCounter==16){const t=[];ge.unsubscribeRefresh(),ge.initialized=!0,ge.rawDataPacks.forEach(n=>{n.forEach(o=>{const s=za(o);t.push(s)})}),yt(t),ge.subscribeUpdates()}}function _u(a,e){const t=JSON.parse(e),n=za(t);ge.graphRefreshCounter++,yt(f.data.concat(n)),ge.graphRefreshCounter>60&&ge.activate()}function za(a){const e=Object.values(O).length>0?Object.values(O)[0].connectedVehicle:0,t=Object.values(O).length>1?Object.values(O)[1].connectedVehicle:1,n="ev"+e+"-soc",o="ev"+t+"-soc",s={};s.date=+a.timestamp*1e3,+a.grid>0?(s.evuIn=+a.grid,s.evuOut=0):+a.grid<=0?(s.evuIn=0,s.evuOut=-a.grid):(s.evuIn=0,s.evuOut=0),+a["pv-all"]>=0?(s.pv=+a["pv-all"],s.inverter=0):(s.pv=0,s.inverter=-a["pv-all"]),s.house=+a["house-power"],+a["bat-all-power"]>0?(s.batOut=0,s.batIn=+a["bat-all-power"]):+a["bat-all-power"]<0?(s.batOut=-a["bat-all-power"],s.batIn=0):(s.batOut=0,s.batIn=0),a["bat-all-soc"]?s.batSoc=+a["bat-all-soc"]:s.batSoc=0,a[n]&&(s["soc"+e]=+a[n]),a[o]&&(s["soc"+t]=+a[o]),s.charging=+a["charging-all"];for(let h=0;h<10;h++){const d="cp"+h;s[d]=+(a[d+"-power"]??0)}return s.selfUsage=s.pv-s.evuOut,s.selfUsage<0&&(s.selfUsage=0),s.devices=0,s}const wu=["evuIn","pv","batOut","evuOut","charging","house"];let $t=[];function ku(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),$t=[],Xt.forEach(h=>{T.setEnergyPv(h,0),T.setEnergyBat(h,0)});const s=xu(t);yt(s),Kt(o,$t),g.debug&&Mu(t,o,s),f.graphMode=="today"&&setTimeout(()=>ce.activate(),3e5)}function xu(a){const e=[];let t={};return a.forEach(n=>{t=Su(n);const o=t;e.push(o)}),e}function Su(a){const e={};e.date=a.timestamp*1e3,e.evuOut=0,e.evuIn=0,Object.entries(a.counter).forEach(([o,s])=>{s.grid&&(e.evuOut+=s.power_exported,e.evuIn+=s.power_imported,$t.includes(o)||$t.push(o))}),e.evuOut==0&&e.evuIn==0&&Object.entries(a.counter).forEach(o=>{e.evuOut+=o[1].power_exported,e.evuIn+=o[1].power_imported}),Object.entries(a.pv).forEach(([o,s])=>{o!="all"?e[o]=s.power_exported:e.pv=s.power_exported}),Object.entries(a.bat).length>0?(e.batIn=a.bat.all.power_imported,e.batOut=a.bat.all.power_exported,e.batSoc=a.bat.all.soc??0):(e.batIn=0,e.batOut=0,e.batSoc=0),Object.entries(a.cp).forEach(([o,s])=>{o!="all"?(e[o]=s.power_imported,T.keys().includes(o)||T.addItem(o)):e.charging=s.power_imported}),Object.entries(a.ev).forEach(([o,s])=>{o!="all"&&(e["soc"+o.substring(2)]=s.soc)}),e.devices=0;let t=0;return Object.entries(a.sh).forEach(([o,s])=>{var h;o!="all"&&(e[o]=s.power_imported??0,T.keys().includes(o)||(T.addItem(o),T.items[o].showInGraph=ae.get(+o.slice(2)).showInGraph),(h=ae.get(+o.slice(2)))!=null&&h.countAsHouse?t+=e[o]:e.devices+=s.power_imported??0)}),e.selfUsage=Math.max(0,e.pv-e.evuOut),a.hc&&a.hc.all?e.house=a.hc.all.power_imported-t:e.house=e.evuIn+e.batOut+e.pv-e.evuOut-e.charging-e.devices-e.batOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(o=>!wu.includes(o)&&o!="charging").forEach(o=>{Sr(o,e)}):Object.keys(e).forEach(o=>{e[o+"Pv"]=0,e[o+"Bat"]=0}),e}function Mu(a,e,t){console.debug("---------------------------------------- Graph Data -"),console.debug(["--- Incoming graph data:",a]),console.debug(["--- Incoming energy data:",e]),console.debug(["--- Data to be displayed:",t]),console.debug("-----------------------------------------------------")}let kt={};const oa=["charging","house","batIn","devices"],$u=["evuIn","pv","batOut","batIn","evuOut","devices","sh1","sh2","sh3","sh4","sh5","sh6","sh7","sh8","sh9"];let et=[];function Pu(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),et=[],oa.forEach(s=>{T.items[s].energyPv=0,T.items[s].energyBat=0}),t.length>0&&yt(Wa(t)),Kt(o,et)}function Cu(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),et=[],oa.forEach(s=>{T.items[s].energyPv=0,T.items[s].energyBat=0}),t.length>0&&yt(Wa(t)),Kt(o,et)}function Wa(a){const e=[];let t={};return kt={},a.forEach(n=>{t=Iu(n),e.push(t),Object.keys(t).forEach(o=>{o!="date"&&(t[o]<0&&(console.warn(`Negative energy value for ${o} in row ${t.date}. Ignoring the value.`),t[o]=0),kt[o]?kt[o]+=t[o]:kt[o]=t[o])})}),e}function Iu(a){const e={},t=er("%Y%m%d")(a.date);t&&(e.date=f.graphMode=="month"?t.getDate():t.getMonth()+1),e.evuOut=0,e.evuIn=0;let n=0,o=0;return Object.entries(a.counter).forEach(([h,d])=>{n+=d.energy_exported,o+=d.energy_imported,d.grid&&(e.evuOut+=d.energy_exported,e.evuIn+=d.energy_imported,et.includes(h)||et.push(h))}),et.length==0&&(e.evuOut=n,e.evuIn=o),e.pv=a.pv.all.energy_exported,Object.entries(a.bat).length>0?(a.bat.all.energy_imported>=0?e.batIn=a.bat.all.energy_imported:(console.warn("ignoring negative value for batIn on day "+e.date),e.batIn=0),a.bat.all.energy_exported>=0?e.batOut=a.bat.all.energy_exported:(console.warn("ignoring negative value for batOut on day "+e.date),e.batOut=0)):(e.batIn=0,e.batOut=0),Object.entries(a.cp).forEach(([h,d])=>{h!="all"?(T.keys().includes(h)||T.addItem(h),e[h]=d.energy_imported):e.charging=d.energy_imported}),Object.entries(a.ev).forEach(([h,d])=>{h!="all"&&(e["soc-"+h]=d.soc)}),e.devices=Object.entries(a.sh).reduce((h,d)=>(T.keys().includes(d[0])||T.addItem(d[0]),d[1].energy_imported>=0?h+=d[1].energy_imported:console.warn(`Negative energy value for device ${d[0]} in row ${e.date}. Ignoring this value`),h),0),a.hc&&a.hc.all?e.house=a.hc.all.energy_imported:e.house=e.pv+e.evuIn+e.batOut-e.evuOut-e.batIn-e.charging,e.selfUsage=e.pv-e.evuOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(h=>!$u.includes(h)).forEach(h=>{Mr(h,e)}):oa.map(h=>{e[h+"Pv"]=0,e[h+"Bat"]=0}),e}function Bu(a,e){const t=Vu(a);if(t&&!he.value.has(t)){console.warn("Invalid battery index: ",t);return}a=="openWB/bat/config/configured"?de.isBatteryConfigured=e=="true":a=="openWB/bat/get/power"?+e>0?(j.batIn.power=+e,Q.batOut.power=0):(j.batIn.power=0,Q.batOut.power=-e):a=="openWB/bat/get/soc"?de.batterySoc=+e:a=="openWB/bat/get/daily_exported"?Q.batOut.energy=+e:a=="openWB/bat/get/daily_imported"?j.batIn.energy=+e:t&&he.value.has(t)&&(a.match(/^openwb\/bat\/[0-9]+\/get\/daily_exported$/i)?he.value.get(t).dailyYieldExport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/daily_imported$/i)?he.value.get(t).dailyYieldImport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/exported$/i)?he.value.get(t).exported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_state$/i)?he.value.get(t).faultState=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_str$/i)?he.value.get(t).faultStr=e:a.match(/^openwb\/bat\/[0-9]+\/get\/imported$/i)?he.value.get(t).imported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/power$/i)?he.value.get(t).power=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/soc$/i)&&(he.value.get(t).soc=+e))}function Vu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function Lu(a,e){if(a=="openWB/optional/et/provider")JSON.parse(e).type==null?re.active=!1:(re.active=!0,re.etProvider=JSON.parse(e).name);else if(a=="openWB/optional/et/get/prices"){const t=JSON.parse(e);re.etPriceList=new Map,Object.keys(t).forEach(n=>{re.etPriceList.set(new Date(+n*1e3),t[n]*1e5)})}}function Ou(a,e){const t=Da(a);if(t&&!(t in O)){console.warn("Invalid chargepoint id received: "+t);return}if(a=="openWB/chargepoint/get/power"?j.charging.power=+e:a=="openWB/chargepoint/get/daily_imported"&&(j.charging.energy=+e),a=="openWB/chargepoint/get/daily_exported")de.cpDailyExported=+e;else if(t){if(a.match(/^openwb\/chargepoint\/[0-9]+\/config$/i))if(O[t]){const n=JSON.parse(e);O[t].name=n.name,O[t].icon=n.name,ie["cp"+t]?(ie["cp"+t].name=n.name,ie["cp"+t].icon=n.name):ie["cp"+t]={name:n.name,icon:n.name,color:"var(--color-charging)"}}else console.warn("invalid chargepoint index: "+t);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/state_str$/i))O[t].stateStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_str$/i))O[t].faultStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_state$/i))O[t].faultState=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/power$/i))O[t].power=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/daily_imported$/i))O[t].dailyYield=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/plug_state$/i))O[t].isPluggedIn=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/charge_state$/i))O[t].isCharging=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/manual_lock$/i))O[t].updateIsLocked(e=="true");else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/enabled$/i))O[t].isEnabled=e=="1";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/phases_in_use/i))O[t].phasesInUse=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/current/i))O[t].current=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/currents/i))O[t].currents=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/log/i)){const n=JSON.parse(e);O[t].chargedSincePlugged=n.imported_since_plugged}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/soc$/i)){const n=JSON.parse(e);O[t].soc=n.soc,O[t].waitingForSoc=!1,O[t].rangeCharged=n.range_charged,O[t].rangeUnit=n.range_unit}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/info$/i)){const n=JSON.parse(e);O[t].vehicleName=String(n.name),O[t].updateConnectedVehicle(+n.id)}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/config$/i)){const n=JSON.parse(e);switch(n.chargemode){case"instant_charging":O[t].updateChargeMode(fe.instant_charging);break;case"pv_charging":O[t].updateChargeMode(fe.pv_charging);break;case"scheduled_charging":O[t].updateChargeMode(fe.scheduled_charging);break;case"standby":O[t].updateChargeMode(fe.standby);break;case"stop":O[t].updateChargeMode(fe.stop);break}O[t].chargeTemplate=n.charge_template,O[t].averageConsumption=n.average_consumption}}}function Au(a,e){const t=Da(a);if(t!=null){if(!(t in Y)){const n=new fr(t);Y[t]=n}if(a.match(/^openwb\/vehicle\/[0-9]+\/name$/i))Object.values(O).forEach(n=>{n.connectedVehicle==t&&(n.vehicleName=JSON.parse(e))}),Y[t].name=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/soc$/i))Y[t].soc=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/range$/i))isNaN(+e)?Y[t].range=0:Y[t].range=+e;else if(a.match(/^openwb\/vehicle\/[0-9]+\/charge_template$/i))Y[t].updateChargeTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/ev_template$/i))Y[t].updateEvTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/soc_module\/config$/i)){const n=JSON.parse(e);Object.values(O).forEach(o=>{o.connectedVehicle==t&&(o.isSocConfigured=n.type!==null,o.isSocManual=n.type=="manual")})}}}function Tu(a,e){if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const n=+t[0],o=JSON.parse(e);_e[n]=o,Eu(n,o)}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/time_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),n=a.match(/[0-9]+$/i);if(t&&n){const o=+t[0].replace(/[^0-9]+/g,""),s=+n[0],h=JSON.parse(e);o in gt||(gt[o]=[]),gt[o][s]=h}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/chargemode\/scheduled_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),n=a.match(/[0-9]+$/i);if(t&&n){const o=+t[0].replace(/[^0-9]+/g,""),s=+n[0],h=JSON.parse(e);o in pt||(pt[o]=[]),pt[o][s]=h}}else if(a.match(/^openwb\/vehicle\/template\/ev_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const n=+t[0],o=JSON.parse(e);Rt[n]=o}}}function Eu(a,e){Object.values(O).forEach(t=>{t.chargeTemplate==a&&(t.updateCpPriority(e.prio),t.updateInstantChargeLimitMode(e.chargemode.instant_charging.limit.selected),t.updateInstantTargetCurrent(e.chargemode.instant_charging.current),t.updateInstantTargetSoc(e.chargemode.instant_charging.limit.soc),t.updateInstantMaxEnergy(e.chargemode.instant_charging.limit.amount),t.updatePvFeedInLimit(e.chargemode.pv_charging.feed_in_limit),t.updatePvMinCurrent(e.chargemode.pv_charging.min_current),t.updatePvMaxSoc(e.chargemode.pv_charging.max_soc),t.updatePvMinSoc(e.chargemode.pv_charging.min_soc),t.updatePvMinSocCurrent(e.chargemode.pv_charging.min_soc_current))})}function Da(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function zu(a,e){a.match(/^openWB\/LegacySmarthome\/config\//i)?Wu(a,e):a.match(/^openWB\/LegacySmarthome\/Devices\//i)&&Du(a,e)}function Wu(a,e){const t=Ga(a);if(t==null)return;ae.has(t)||qt(t);const n=ae.get(t);a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_configured$/i)?n.configured=e!="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_name$/i)?(n.name=e.toString(),n.icon=e.toString(),ie["sh"+t].name=e.toString(),ie["sh"+t].icon=e.toString()):a.match(/^openWB\/LegacySmarthome\/config\/set\/Devices\/[0-9]+\/mode$/i)?n.isAutomatic=e=="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_canSwitch$/i)?n.canSwitch=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_homeConsumtion$/i)?n.countAsHouse=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_temperatur_configured$/i)&&(n.tempConfigured=+e)}function Du(a,e){const t=Ga(a);if(t==null){console.warn("Smarthome: Missing index in "+a);return}ae.has(t)||qt(t);const n=ae.get(t);if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Watt$/i))n.power=+e,Gu("power");else if(!a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Wh$/i)){if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/RunningTimeToday$/i))n.runningTime=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor0$/i))n.temp[0]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor1$/i))n.temp[1]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor2$/i))n.temp[2]=+e;else if(a.match(/^openWB\/LegacySmartHome\/Devices\/[0-9]+\/Status$/i))switch(+e){case 10:n.status="off";break;case 11:n.status="on";break;case 20:n.status="detection";break;case 30:n.status="timeout";break;default:n.status="off"}}}function Gu(a){switch(a){case"power":j.devices.power=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.power,0);break;case"energy":j.devices.energy=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.energy,0);break;default:console.error("Unknown category")}}function Ga(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Pt=le([]);class sa{constructor(e,t,n,o){b(this,"name");b(this,"children");b(this,"count");b(this,"lastValue");this.name=e,this.children=t,this.count=n,this.lastValue=o}insert(e,t){if(e.length){const n=e.splice(1);if(e[0]==this.name)if(n.length){let o=!1;if(this.children.forEach(s=>{s.name==n[0]&&(s.insert(n,t),o=!0)}),!o){const s=new sa(n[0],[],0,"");s.insert(n,t),this.children.push(s)}}else this.count=this.count+1,this.lastValue=t}}}function ju(a,e){const t=a.split("/");if(t.length){let n=!1;if(Pt.forEach(o=>{o.name==t[0]&&(o.insert(t,e),n=!0)}),!n){const o=new sa(t[0],[],0,"");Pt.push(o),o.insert(t,e)}}}const Uu=["openWB/counter/#","openWB/bat/#","openWB/pv/#","openWB/chargepoint/#","openWB/vehicle/#","openWB/general/chargemode_config/pv_charging/#","openWB/optional/et/#","openWB/system/#","openWB/LegacySmartHome/#","openWB/command/"+Qt()+"/#"];function Fu(){gr(Nu),Uu.forEach(a=>{Ke(a)}),ve()}function Nu(a,e){ju(a,e.toString());const t=e.toString();a.match(/^openwb\/counter\/[0-9]+\//i)?Hu(a,t):a.match(/^openwb\/counter\//i)?Ru(a,t):a.match(/^openwb\/bat\//i)?Bu(a,t):a.match(/^openwb\/pv\//i)?Ju(a,t):a.match(/^openwb\/chargepoint\//i)?Ou(a,t):a.match(/^openwb\/vehicle\/template\//i)?Tu(a,t):a.match(/^openwb\/vehicle\//i)?Au(a,t):a.match(/^openwb\/general\/chargemode_config\/pv_charging\//i)?Yu(a,t):a.match(/^openwb\/graph\//i)?yu(a,t):a.match(/^openwb\/log\/daily\//i)?ku(a,t):a.match(/^openwb\/log\/monthly\//i)?Pu(a,t):a.match(/^openwb\/log\/yearly\//i)?Cu(a,t):a.match(/^openwb\/optional\/et\//i)?Lu(a,t):a.match(/^openwb\/system\//i)?Qu(a,t):a.match(/^openwb\/LegacySmartHome\//i)?zu(a,t):a.match(/^openwb\/command\//i)&&Zu(a,t)}function Hu(a,e){const t=a.split("/"),n=+t[2];if(n==de.evuId?qu(a,e):t[3]=="config",t[3]=="get"&&n in ke)switch(t[4]){case"power":ke[n].power=+e;break;case"config":break;case"fault_str":break;case"fault_state":break;case"power_factors":break;case"imported":break;case"exported":break;case"frequency":break;case"daily_imported":ke[n].energy_imported=+e;break;case"daily_exported":ke[n].energy_exported=+e;break}}function Ru(a,e){if(a.match(/^openwb\/counter\/get\/hierarchy$/i)){const t=JSON.parse(e);if(t.length){br(),rs();for(const n of t)n.type=="counter"&&(de.evuId=n.id);ja(t[0])}}else a.match(/^openwb\/counter\/set\/home_consumption$/i)?j.house.power=+e:a.match(/^openwb\/counter\/set\/daily_yield_home_consumption$/i)&&(j.house.energy=+e)}function ja(a){switch(a.type){case"counter":Xc(a.id,a.type);break;case"cp":yr(a.id);break;case"bat":Aa(a.id);break}a.children.forEach(e=>ja(e))}function Ju(a,e){const t=Xu(a);t&&!we.value.has(t)&&Er(t),a=="openWB/pv/get/power"?Q.pv.power=-e:a=="openWB/pv/get/daily_exported"?Q.pv.energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/power$/i)?we.value.get(t).power=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/daily_exported$/i)?we.value.get(t).energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/monthly_exported$/i)?we.value.get(t).energy_month=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/yearly_exported$/i)?we.value.get(t).energy_year=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/exported$/i)&&(we.value.get(t).energy_total=+e)}function Yu(a,e){const t=a.split("/");if(t.length>0)switch(t[4]){case"bat_mode":de.updatePvBatteryPriority(JSON.parse(e));break}}function qu(a,e){switch(a.split("/")[4]){case"power":+e>0?(Q.evuIn.power=+e,j.evuOut.power=0):(Q.evuIn.power=0,j.evuOut.power=-e);break;case"daily_imported":Q.evuIn.energy=+e;break;case"daily_exported":j.evuOut.energy=+e;break}}function Qu(a,e){if(a.match(/^openWB\/system\/device\/[0-9]+\/component\/[0-9]+\/config$/i)){const t=JSON.parse(e);switch(t.type){case"counter":case"consumption_counter":ke[t.id]&&(ke[t.id].name=t.name);break;case"inverter":case"inverter_secondary":we.value.has(t.id)||we.value.set(t.id,new $a(t.id)),we.value.get(t.id).name=t.name;break;case"bat":he.value.has(t.id)||Aa(t.id),he.value.get(t.id).name=t.name}}}function Zu(a,e){const t=a.split("/");if(a.match(/^openWB\/command\/[a-z]+\/error$/i)&&t[2]==Qt()){const n=JSON.parse(e);console.error(`Error message from openWB: -Command: ${n.command} -Data: JSON.stringify(err.data) -Error: - ${n.error}`)}}function Xu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Ku={key:0,class:"fas fa-caret-down"},ed={key:1,class:"fas fa-caret-right"},td={key:0,class:"content p-2 m-2"},ad={key:1,class:"sublist col-md-9 m-0 p-0 ps-2"},rd=L({__name:"MqttNode",props:{node:{},level:{},hide:{type:Boolean},expandAll:{type:Boolean}},setup(a){const e=a;let t=ee(!e.hide),n=ee(!1);const o=m(()=>e.node.name),s=m(()=>[...e.node.children].sort((c,k)=>c.namee.node.count>0?"("+e.node.count+")":""),d=m(()=>e.node.children.length),u=m(()=>e.node.lastValue!=""?{"font-style":"italic","grid-column-start":e.level,"grid-column-end":-1}:{"grid-column-start":e.level,"grid-column-end":-1});function p(){d.value>0&&(t.value=!t.value),e.node.lastValue!=""&&(n.value=!n.value)}return(c,k)=>{const C=tr("MqttNode",!0);return l(),v(U,null,[r("div",{class:"name py-2 px-2 m-0",style:K(u.value),onClick:p},[(i(t)||e.expandAll)&&d.value>0||i(n)?(l(),v("span",Ku)):(l(),v("span",ed)),N(" "+S(o.value)+S(h.value),1)],4),i(n)?(l(),v("div",td,[r("code",null,S(e.node.lastValue),1)])):w("",!0),(i(t)||e.expandAll)&&d.value>0?(l(),v("div",ad,[(l(!0),v(U,null,te(s.value,(z,W)=>(l(),P(C,{key:W,level:e.level+1,node:z,hide:!0,"expand-all":e.expandAll},null,8,["level","node","expand-all"]))),128))])):w("",!0)],64)}}}),nd=R(rd,[["__scopeId","data-v-df7e578a"]]),od={class:"mqviewer"},sd={class:"row pt-2"},id={class:"col"},ld={key:0,class:"topiclist"},cd=L({__name:"MQTTViewer",setup(a){Ve(()=>{});const e=ee(!1);function t(){e.value=!e.value}const n=m(()=>e.value?"active":"");return(o,s)=>(l(),v("div",od,[r("div",sd,[r("div",id,[s[0]||(s[0]=r("h3",{class:"mqtitle ps-2"},"MQTT Message Viewer",-1)),s[1]||(s[1]=r("hr",null,null,-1)),r("button",{class:q(["btn btn-small btn-outline-primary ms-2",n.value]),onClick:t}," Expand All ",2),s[2]||(s[2]=r("hr",null,null,-1))])]),i(Pt)[0]?(l(),v("div",ld,[(l(!0),v(U,null,te(i(Pt)[0].children.sort((h,d)=>h.name(l(),P(nd,{key:d,node:h,level:1,hide:!0,"expand-all":e.value},null,8,["node","expand-all"]))),128))])):w("",!0)]))}}),ud=R(cd,[["__scopeId","data-v-a349646d"]]),dd=["value"],hd=L({__name:"SelectInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(s){n("update:modelValue",s)}});return(s,h)=>ft((l(),v("select",{id:"selectme","onUpdate:modelValue":h[0]||(h[0]=d=>o.value=d),class:"form-select"},[(l(!0),v(U,null,te(s.options,(d,u)=>(l(),v("option",{key:u,value:d[1]},S(d[0]),9,dd))),128))],512)),[[ar,o.value]])}}),pd=R(hd,[["__scopeId","data-v-5e33ce1f"]]),gd={class:"subgrid m-0 p-0"},md={class:"settingscolumn"},vd={class:"settingscolumn"},fd={class:"settingscolumn"},yd=L({__name:"ThemeSettings",emits:["reset-arcs"],setup(a,{emit:e}){const t=e,n=[["Dunkel","dark"],["Hell","light"],["Blau","blue"]],o=[["3 kW","0"],["3,1 kW","1"],["3,14 kW","2"],["3,141 kW","3"],["3141 W","4"]],s=[["Orange","normal"],["Grün/Violett","standard"],["Bunt","advanced"]],h=[["Aus","off"],["Menü","navbar"],["Buttonleiste","buttonbar"]],d=[["Aus","no"],['"Alles"-Reiter',"infoview"],["Immer","always"]];return(u,p)=>(l(),P(je,{"full-width":!0},{title:_(()=>p[22]||(p[22]=[N(" Look & Feel ")])),buttons:_(()=>p[23]||(p[23]=[r("span",{type:"button",class:"float-end mt-0 ms-1","data-bs-toggle":"collapse","data-bs-target":"#themesettings"},[r("span",null,[r("i",{class:"fa-solid fa-circle-check"})])],-1)])),default:_(()=>[r("div",gd,[r("div",md,[y(H,{fullwidth:!0,title:"Farbschema",icon:"fa-adjust",infotext:"Hintergrundfarbe"},{default:_(()=>[y(We,{modelValue:i(g).displayMode,"onUpdate:modelValue":p[0]||(p[0]=c=>i(g).displayMode=c),options:n},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Farbschema Smart-Home-Geräte",icon:"fa-palette",infotext:"Für die Smart-Home-Geräte stehen mehrere Schemata zur Verfügung."},{default:_(()=>[y(We,{modelValue:i(g).smartHomeColors,"onUpdate:modelValue":p[1]||(p[1]=c=>i(g).smartHomeColors=c),options:s},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Grafik: Raster",icon:"fa-th",infotext:"Verwende ein Hintergrundraster in den Grafiken"},{default:_(()=>[y(se,{modelValue:i(g).showGrid,"onUpdate:modelValue":p[2]||(p[2]=c=>i(g).showGrid=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Variable Bogenlänge",icon:"fa-chart-area",infotext:"Im Graph 'Aktuelle Leistung' können die Bögen immer die volle Länge haben, oder entsprechend des aktuellen Gesamtleistung verkürzt dargestellt werden."},{default:_(()=>[y(se,{modelValue:i(g).showRelativeArcs,"onUpdate:modelValue":p[3]||(p[3]=c=>i(g).showRelativeArcs=c)},null,8,["modelValue"])]),_:1}),i(g).showRelativeArcs?(l(),P(H,{key:0,fullwidth:!0,title:"Bögen zurücksetzen",icon:"fa-undo",infotext:"Durch Click auf den Button wird die Maximallänge der Bögen auf den aktuellen Wert gesetzt."},{default:_(()=>[i(g).showRelativeArcs?(l(),v("button",{key:0,class:"btn btn-secondary",onClick:p[4]||(p[4]=c=>t("reset-arcs"))}," Reset ")):w("",!0)]),_:1})):w("",!0),y(H,{fullwidth:!0,title:"Anzahl Dezimalstellen",icon:"fa-sliders-h",infotext:"Alle kW- und kWh-Werte werden mit der gewählten Anzahl an Stellen angezeigt."},{default:_(()=>[y(pd,{modelValue:i(g).decimalPlaces,"onUpdate:modelValue":p[5]||(p[5]=c=>i(g).decimalPlaces=c),options:o},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Uhrzeit anzeigen",icon:"fa-clock",infotext:"Zeige die aktuelle Uhrzeit an. In der Menüleiste oder neben den Lade-Buttons."},{default:_(()=>[y(We,{modelValue:i(g).showClock,"onUpdate:modelValue":p[6]||(p[6]=c=>i(g).showClock=c),options:h},null,8,["modelValue"])]),_:1})]),r("div",vd,[y(H,{fullwidth:!0,title:"Kompakte Ladepunktliste",icon:"fa-list",infotext:"Zeige eine einzelne Ladepunktliste statt separater Element pro Ladepunkt."},{default:_(()=>[y(We,{modelValue:i(g).shortCpList,"onUpdate:modelValue":p[7]||(p[7]=c=>i(g).shortCpList=c),options:d},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Buttonleiste für Ladepunkte",icon:"fa-window-maximize",infotext:"Informationen zu Ladepunkten über den Diagrammen anzeigen."},{default:_(()=>[y(se,{modelValue:i(g).showButtonBar,"onUpdate:modelValue":p[8]||(p[8]=c=>i(g).showButtonBar=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Filter-Buttons",icon:"fa-filter",infotext:"Hauptseite mit Buttons zur Auswahl der Kategorie."},{default:_(()=>[y(se,{modelValue:i(g).showQuickAccess,"onUpdate:modelValue":p[9]||(p[9]=c=>i(g).showQuickAccess=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Breite Widgets",icon:"fa-desktop",infotext:"Widgets immer breit machen"},{default:_(()=>[y(se,{modelValue:i(g).preferWideBoxes,"onUpdate:modelValue":p[10]||(p[10]=c=>i(g).preferWideBoxes=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Stufenlose Displaybreite",icon:"fa-maximize",infotext:"Die Breite des Displays wird immer voll ausgenutzt. Dies kann in einigen Fällen zu inkorrekter Darstellung führen."},{default:_(()=>[y(se,{modelValue:i(g).fluidDisplay,"onUpdate:modelValue":p[11]||(p[11]=c=>i(g).fluidDisplay=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Animationen",icon:"fa-film",infotext:"Animationen anzeigen"},{default:_(()=>[y(se,{modelValue:i(g).showAnimations,"onUpdate:modelValue":p[12]||(p[12]=c=>i(g).showAnimations=c)},null,8,["modelValue"])]),_:1})]),r("div",fd,[y(H,{fullwidth:!0,title:"Zähler anzeigen",icon:"fa-chart-bar",infotext:"Zeige die Werte zusätzlich angelegter Zähler"},{default:_(()=>[y(se,{modelValue:i(g).showCounters,"onUpdate:modelValue":p[13]||(p[13]=c=>i(g).showCounters=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Fahrzeuge anzeigen",icon:"fa-car",infotext:"Zeige alle Fahrzeuge mit Ladestand und Reichweite"},{default:_(()=>[y(se,{modelValue:i(g).showVehicles,"onUpdate:modelValue":p[14]||(p[14]=c=>i(g).showVehicles=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Standardfahrzeug anzeigen",icon:"fa-car",infotext:"Zeige das Standard-Fahrzeug in der Fahzeugliste"},{default:_(()=>[y(se,{modelValue:i(g).showStandardVehicle,"onUpdate:modelValue":p[15]||(p[15]=c=>i(g).showStandardVehicle=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Preistabelle anzeigen",icon:"fa-car",infotext:"Zeige die Strompreistabelle in einer separaten Box an"},{default:_(()=>[y(se,{modelValue:i(g).showPrices,"onUpdate:modelValue":p[16]||(p[16]=c=>i(g).showPrices=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Untere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der unteren Markierung festlegen"},{default:_(()=>[y(Se,{id:"lowerPriceBound",modelValue:i(g).lowerPriceBound,"onUpdate:modelValue":p[17]||(p[17]=c=>i(g).lowerPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Obere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der oberen Markierung festlegen"},{default:_(()=>[y(Se,{id:"upperPriceBound",modelValue:i(g).upperPriceBound,"onUpdate:modelValue":p[18]||(p[18]=c=>i(g).upperPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Wechselrichter-Details anzeigen",icon:"fa-solar-panel",infotext:"Zeige Details zu den einzelnen Wechselrichtern"},{default:_(()=>[y(se,{modelValue:i(g).showInverters,"onUpdate:modelValue":p[19]||(p[19]=c=>i(g).showInverters=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Alternatives Energie-Widget",icon:"fa-chart-area",infotext:"Horizontale Darstellung der Energie-Werte"},{default:_(()=>[y(se,{modelValue:i(g).alternativeEnergy,"onUpdate:modelValue":p[20]||(p[20]=c=>i(g).alternativeEnergy=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Debug-Modus",icon:"fa-bug-slash",infotext:"Kontrollausgaben in der Console sowie Anzeige von Bildschirmbreite und MQ-Viewer"},{default:_(()=>[y(se,{modelValue:i(g).debug,"onUpdate:modelValue":p[21]||(p[21]=c=>i(g).debug=c)},null,8,["modelValue"])]),_:1})]),p[24]||(p[24]=r("div",{class:"grid-col-12 mb-3 me-3"},[r("button",{class:"btn btn-sm btn-secondary float-end","data-bs-toggle":"collapse","data-bs-target":"#themesettings"}," Schließen ")],-1))])]),_:1}))}}),bd=R(yd,[["__scopeId","data-v-c277ed25"]]),_d={class:"container-fluid px-2 m-0 theme-colors"},wd={id:"themesettings",class:"collapse"},kd={key:2,class:"row py-0 px-0 m-0"},xd={key:3,class:"row py-0 m-0 d-flex justify-content-center"},Sd={key:4,class:"nav nav-tabs nav-justified mx-1 mt-2",role:"tablist"},Md={key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pricecharttabbed"},$d={key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#vehiclelist"},Pd={key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#batterylist"},Cd={key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#smarthomelist"},Id={key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#counterlist"},Bd={key:5,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#inverterlist"},Vd={key:5,id:"cpContent",class:"tab-content mx-0 pt-1"},Ld={id:"showAll",class:"tab-pane active",role:"tabpanel","aria-labelledby":"showall-tab"},Od={class:"row py-0 m-0 d-flex justify-content-center"},Ad={id:"chargepointlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"chargepoint-tab"},Td={class:"row py-0 m-0 d-flex justify-content-center"},Ed={id:"vehiclelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"vehicle-tab"},zd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Wd={id:"batterylist",class:"tab-pane",role:"tabpanel","aria-labelledby":"battery-tab"},Dd={class:"row py-0 m-0 d-flex justify-content-center"},Gd={id:"smarthomelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"smarthome-tab"},jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Ud={id:"counterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"counter-tab"},Fd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Nd={id:"inverterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"inverter-tab"},Hd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Rd={id:"pricecharttabbed",class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},Jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Yd={key:0,class:"row p-2 mt-5"},qd={class:"col p-2"},Qd={class:"d-flex justify-content-between"},Zd={class:"mx-4"},Xd={key:0},Kd=L({__name:"ColorsTheme",setup(a){const e=ee(!1),t=m(()=>[...ae.values()].filter(h=>h.configured).length>0);function n(){Ba()}function o(){e.value=!e.value}Ve(()=>{n(),window.addEventListener("resize",Br),window.addEventListener("focus",s),Fu()});function s(){document.hasFocus()&&ve(!0)}return(h,d)=>(l(),v(U,null,[r("div",_d,[r("div",wd,[y(bd,{onResetArcs:i(Or)},null,8,["onResetArcs"])]),i(g).showButtonBar?(l(),P(Vc,{key:0})):w("",!0),w("",!0),(l(),v("div",kd,[y(fu,null,rr({item1:_(()=>[y(hn)]),item2:_(()=>[y(mo)]),_:2},[i(g).alternativeEnergy?{name:"item3",fn:_(()=>[y(ps)]),key:"0"}:{name:"item3",fn:_(()=>[y(Go)]),key:"1"}]),1024)])),i(g).showQuickAccess?w("",!0):(l(),v("div",xd,[y(Tt,{id:"1",compact:i(g).shortCpList=="always"},null,8,["compact"]),i(g).showPrices?(l(),P(Ut,{key:0,id:"NoTabs"})):w("",!0),i(g).showVehicles?(l(),P(Dt,{key:1})):w("",!0),y(Et),t.value?(l(),P(zt,{key:2})):w("",!0),i(g).showCounters?(l(),P(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),P(Ft,{key:4})):w("",!0)])),i(g).showQuickAccess?(l(),v("nav",Sd,[d[6]||(d[6]=nr('AllesLadepunkte',2)),i(g).showPrices?(l(),v("a",Md,d[0]||(d[0]=[r("i",{class:"fa-solid fa-lg fa-coins"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Strompreis",-1)]))):w("",!0),i(g).showVehicles?(l(),v("a",$d,d[1]||(d[1]=[r("i",{class:"fa-solid fa-lg fa-car"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Fahrzeuge",-1)]))):w("",!0),i(de).isBatteryConfigured?(l(),v("a",Pd,d[2]||(d[2]=[r("i",{class:"fa-solid fa-lg fa-car-battery"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Speicher",-1)]))):w("",!0),t.value?(l(),v("a",Cd,d[3]||(d[3]=[r("i",{class:"fa-solid fa-lg fa-plug"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Smart Home",-1)]))):w("",!0),i(g).showCounters?(l(),v("a",Id,d[4]||(d[4]=[r("i",{class:"fa-solid fa-lg fa-bolt"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Zähler",-1)]))):w("",!0),i(g).showInverters?(l(),v("a",Bd,d[5]||(d[5]=[r("i",{class:"fa-solid fa-lg fa-solar-panel"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Wechselrichter",-1)]))):w("",!0)])):w("",!0),i(g).showQuickAccess?(l(),v("div",Vd,[r("div",Ld,[r("div",Od,[y(Tt,{id:"2",compact:i(g).shortCpList!="no"},null,8,["compact"]),i(g).showPrices?(l(),P(Ut,{key:0,id:"Overview"})):w("",!0),i(g).showVehicles?(l(),P(Dt,{key:1})):w("",!0),y(Et),t.value?(l(),P(zt,{key:2})):w("",!0),i(g).showCounters?(l(),P(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),P(Ft,{key:4})):w("",!0)])]),r("div",Ad,[r("div",Td,[y(Tt,{id:"3",compact:i(g).shortCpList=="always"},null,8,["compact"])])]),r("div",Ed,[i(g).showVehicles?(l(),v("div",zd,[y(Dt)])):w("",!0)]),r("div",Wd,[r("div",Dd,[y(Et)])]),r("div",Gd,[t.value?(l(),v("div",jd,[y(zt)])):w("",!0)]),r("div",Ud,[i(g).showCounters?(l(),v("div",Fd,[y(Wt)])):w("",!0)]),r("div",Nd,[i(g).showInverters?(l(),v("div",Hd,[y(Ft)])):w("",!0)]),r("div",Rd,[i(g).showPrices?(l(),v("div",Jd,[y(Ut,{id:"Tabbed"})])):w("",!0)])])):w("",!0)]),i(g).debug?(l(),v("div",Yd,[r("div",qd,[d[7]||(d[7]=r("hr",null,null,-1)),r("div",Qd,[r("p",Zd,"Screen Width: "+S(i(Mt).x),1),r("button",{class:"btn btn-sm btn-secondary mx-4",onClick:o}," MQ Viewer ")]),e.value?(l(),v("hr",Xd)):w("",!0),e.value?(l(),P(ud,{key:1})):w("",!0)])])):w("",!0)],64))}}),eh=R(Kd,[["__scopeId","data-v-668af4f2"]]),th={class:"navbar navbar-expand-lg px-0 mb-0"},ah={key:0,class:"position-absolute-50 navbar-text ms-4 navbar-time",style:{color:"var(--color-menu)"}},rh=L({__name:"NavigationBar",setup(a){let e;const t=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return Ve(()=>{e=setInterval(()=>{Jt.value=new Date},1e3)}),or(()=>{clearInterval(e)}),(n,o)=>(l(),v(U,null,[r("nav",th,[r("div",{class:q(t.value)},[o[0]||(o[0]=r("a",{href:"/",class:"navbar-brand"},[r("span",null,"openWB")],-1)),i(g).showClock=="navbar"?(l(),v("span",ah,S(i(La)(i(Jt))),1)):w("",!0),o[1]||(o[1]=r("button",{class:"navbar-toggler togglebutton ps-5",type:"button","data-bs-toggle":"collapse","data-bs-target":"#mainNavbar","aria-controls":"mainNavbar","aria-expanded":"false","aria-label":"Toggle navigation"},[r("span",{class:"fa-solid fa-ellipsis-vertical"})],-1)),o[2]||(o[2]=r("div",{id:"mainNavbar",class:"collapse navbar-collapse justify-content-end"},[r("div",{class:"nav navbar-nav"},[r("a",{id:"navStatus",class:"nav-link",href:"../../settings/#/Status"},"Status"),r("div",{class:"nav-item dropdown"},[r("a",{id:"loggingDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[N("Auswertungen "),r("i",{class:"fa-solid fa-caret-down"})]),r("div",{class:"dropdown-menu","aria-labelledby":"loggingDropdown"},[r("a",{href:"../../settings/#/Logging/ChargeLog",class:"dropdown-item"},"Ladeprotokoll"),r("a",{href:"../../settings/#/Logging/Chart",class:"dropdown-item"},"Diagramme")])]),r("div",{class:"nav-item dropdown"},[r("a",{id:"settingsDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[N("Einstellungen "),r("span",{class:"fa-solid fa-caret-down"})]),r("div",{class:"dropdown-menu","aria-labelledby":"settingsDropdown"},[r("a",{id:"navSettings",class:"nav-link",href:"../../settings/index.html"},"openWB"),r("a",{class:"nav-link","data-bs-toggle":"collapse","data-bs-target":"#themesettings","aria-expanded":"false","aria-controls":"themeSettings"},[r("span",null,[N("Look&Feel"),r("span",{class:"fa-solid fa-caret-down"})])])])])])],-1))],2)]),r("div",{class:q(t.value)},o[3]||(o[3]=[r("hr",{class:"m-0 p-0 mb-2"},null,-1)]),2)],64))}}),nh=R(rh,[["__scopeId","data-v-ed619966"]]),oh={id:"app",class:"m-0 p-0"},sh={class:"row p-0 m-0"},ih={class:"col-12 p-0 m-0"},lh=L({__name:"App",setup(a){const e=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return(t,n)=>(l(),v("div",oh,[y(nh),r("div",{class:q(["p-0",e.value])},[r("div",sh,[r("div",ih,[y(eh)])])],2)]))}}),ch=sr(lh);ir();ch.mount("#app"); diff --git a/packages/modules/web_themes/colors/web/assets/index-DU7jlsFU.js b/packages/modules/web_themes/colors/web/assets/index-DU7jlsFU.js new file mode 100644 index 0000000000..9fd2479884 --- /dev/null +++ b/packages/modules/web_themes/colors/web/assets/index-DU7jlsFU.js @@ -0,0 +1,6 @@ +var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Be,u as Nt,t as tt,b as xt,s as ue,d as L,p as wa,f as ka,w as Ra,o as l,g as v,h as S,j as r,n as q,k as P,l as w,q as pe,v as _,x as N,y as i,z as y,F as U,A as te,B as xa,C as Re,D as vt,E as nt,G as ot,H as dt,I as ht,J as it,K as Ja,L as He,M as K,N as Ya,O as Ve,P as ft,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as er,Y as tr,Z as ar,_ as rr,$ as nr,a0 as or,a1 as sr,a2 as ir}from"./vendor-CyQtMzsz.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const h of s.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&n(h)}).observe(document,{childList:!0,subtree:!0});function t(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=t(o);fetch(o.href,s)}})();var fe=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(fe||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const lr=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class cr{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function qt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new cr(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const ur=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:ur};let Ce;const{host:dr,port:hr,endpoint:pr,...Ca}=Pa,ia=`${Ca.protocol}://${dr}:${hr}${pr}`;try{console.debug("connectURL",ia),Ce=Na.connect(ia,Ca),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function gr(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Ke(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},n=>{if(n){console.error("MQTT Subscription error: "+n);return}})}function st(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Ht(a,e){let n=Ce.connected,o=0;for(;!n&&o<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await mr(100),n=Ce.connected,o+=1;if(o<20)try{Ce.publish(a,e,{qos:0},s=>{s&&console.warn("MQTT publish error: ",s),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(s){console.warn("MQTT publish: caught error: "+s)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function Qt(){return Pa.clientId}function mr(a){return new Promise(e=>setTimeout(e,a))}class vr{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",fe.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class fr{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Rt=le({});function yr(a){if(!(a in O)){O[a]=new vr(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function br(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(s=>s.visible);let n=-1;switch(e.length){case 0:n=t[0]?t[0].id:-1;break;default:n=e[0].connectedVehicle}let o=-1;switch(e.length){case 0:case 1:o=t[0]?t[0].id:-1;break;default:o=e[1].connectedVehicle}return n==o&&(o=t[1]?t[1].id:-1),n!=-1&&a.push(n),o!=-1&&a.push(o),console.log(a),a}),_r={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let n=_r[a];if(!n){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":n=n.replace("%",O[t].chargeTemplate.toString());break;default:n=n.replace("%",String(t))}switch(typeof e){case"number":Ht(n,JSON.stringify(+e));break;default:Ht(n,JSON.stringify(e))}}function Zt(a){Ht("openWB/set/command/"+Qt()+"/todo",JSON.stringify(a))}const be=500,xe=500,G={top:15,right:20,bottom:10,left:25},Xt=["charging","house","batIn","devices"];class wr{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const f=le(new wr),Ia=ee(Ha),qe=m(()=>[0,be-G.left-2*G.right].map(a=>Ia.value.applyX(a)));let mt=!0,lt=!0;function la(){mt=!1}function ca(){mt=!0}function ua(){lt=!1}function da(){lt=!0}function kr(a){lt=a}function yt(a){f.data=a,f.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(f.data=[]),f.waitForData=!0,Ke(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],Pr(),ct.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),st(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Ke(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)st(this.refreshTopicPrefix+a)},subscribeUpdates(){Ke(this.updateTopic)},unsubscribeUpdates(){st(this.updateTopic)}}),ce=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(f.graphMode=="day"||f.graphMode=="today"){f.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getDailyLog",data:{day:e}})}},deactivate(){st(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");f.data=[],Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getMonthlyLog",data:{month:e}})},deactivate(){st(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Je=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Ke(this.topic),a&&(f.data=[]),f.waitForData=!0,Zt({command:"getYearlyLog",data:{year:e}})},deactivate(){st(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function Mr(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const $r=["evuIn","pv","batOut","evuOut"],Qe=ee(!1);function Kt(a,e){Object.entries(a).length>0?(Qe.value=!1,Object.entries(a.counter).forEach(([t,n])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=n.energy_imported,T.items.evuOut.energy+=n.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,n])=>{t=="all"?(T.setEnergy("charging",n.energy_imported),n.energy_imported_pv!=null&&(T.setEnergyPv("charging",n.energy_imported_pv),T.setEnergyBat("charging",n.energy_imported_bat))):T.setEnergy(t,n.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,n])=>{T.setEnergy(t,n.energy_imported);const o=t.substring(2);ae.get(+o).countAsHouse||(T.items.devices.energy+=n.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{$r.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Xt.includes(t)&&(j[t].energy=T.items[t].energy,j[t].energyPv=T.items[t].energyPv,j[t].energyBat=T.items[t].energyBat,j[t].pvPercentage=T.items[t].pvPercentage))}),f.graphMode=="today"&&(Object.values(O).forEach(t=>{const n=T.items["cp"+t.id];n&&(t.energyPv=n.energyPv,t.energyBat=n.energyBat,t.pvPercentage=n.pvPercentage)}),ae.forEach(t=>{const n=T.items["sh"+t.id];n&&(t.energy=n.energy,t.energyPv=n.energyPv,t.energyBat=n.energyBat,t.pvPercentage=n.pvPercentage)}))):Qe.value=!0,ct.value=!0}const Ie=m(()=>{const a=Be(f.data,e=>new Date(e.date));return a[0]&&a[1]?Nt().domain(a).range([0,be-G.left-2*G.right]):tt().range([0,0])});function Pr(){T.keys().forEach(a=>{Xt.includes(a)&&(j[a].energy=T.items[a].energy,j[a].energyPv=0,j[a].energyBat=0,j[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Ye=m(()=>{const a=Be(f.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-G.left-2]):xt().range([0,0])});function Ct(){switch(f.graphMode){case"live":f.graphMode="today",g.showRightButton=!0,ve();break;case"today":f.graphMode="day",ce.deactivate(),ce.back(),ce.activate(),ve();break;case"day":ce.back(),ve();break;case"month":Ee.back();break;case"year":Je.back();break}}function ea(){const a=new Date;switch(f.graphMode){case"live":break;case"today":f.graphMode="live",g.showRightButton=!1,ve();break;case"day":ce.forward(),ce.date.getDate()==a.getDate()&&ce.date.getMonth()==a.getMonth()&&ce.date.getFullYear()==a.getFullYear()&&(f.graphMode="today"),ve();break;case"month":Ee.forward();break;case"year":Je.forward();break}}function ta(){switch(f.graphMode){case"live":Ct();break;case"day":case"today":f.graphMode="month",ve();break;case"month":f.graphMode="year",ve();break}}function aa(){switch(f.graphMode){case"year":f.graphMode="month",ve();break;case"month":f.graphMode="today",ve();break;case"today":case"day":f.graphMode="live",ve();break}}function ha(a){if(f.graphMode=="day"||f.graphMode=="today"){ce.setDate(a);const e=new Date;ce.date.getDate()==e.getDate()&&ce.date.getMonth()==e.getMonth()&&ce.date.getFullYear()==e.getFullYear()?f.graphMode="today":f.graphMode="day",ve()}}const Ne=ee(new Map);class Cr{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,Lr(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,pa(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,pa(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,ca(),da(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,ca(),da(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cr);function Ba(){Tr();const a=ue("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Ir=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Br(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Ir),ye={instant_charging:{mode:fe.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:fe.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:fe.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:fe.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:fe.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Vr{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Ar()}function Lr(a){const e=ue("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function Or(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function pa(a){const e=ue("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Ar(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;samesite=none"}function Tr(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(n=>{ae.get(n)==null&&qt(n),ae.get(n).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function ra(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),j=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Vr);ee("");const ct=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Jt=ee(new Date),we=ee(new Map),Er=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},zr=["origin"],Wr=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let n={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},o=Q;o["zz-empty"]=n;const s=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ue("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(o))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==s?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let n=Q.pv.power+Q.evuIn.power+Q.batOut.power;n>g.maxPower&&(g.maxPower=n)}),(n,o)=>(l(),v("g",{id:"pmSourceArc",origin:t.value},null,8,zr))}}),Dr=["origin"],Gr=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let n={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const o=[j.evuOut,j.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([j.batIn,j.house]).concat(n),s=o.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ue("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(o)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==s?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(n,o)=>(l(),v("g",{id:"pmUsageArc",origin:t.value},null,8,Dr))}});function Me(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ut(a,e=1,t=!1){let n;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:n=Math.round(a/1e3);break;case 1:n=Math.round(a/100)/10;break;case 2:n=Math.round(a/10)/100;break;case 3:n=Math.round(a)/1e3;break;default:n=Math.round(a/100)/10;break}return n.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function jr(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Ur(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Fr(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>Me(e.watt,g.decimalPlaces));return(n,o)=>S(t.value)}}),Nr={key:0,id:"pmLabel"},Hr=["x","y","fill","text-anchor"],Rr=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),n=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),o=m(()=>!e.data||e.data.power>0),s=m(()=>e.labeltext?"":"fas");return(h,d)=>o.value?(l(),v("g",Nr,[r("text",{x:h.x,y:h.y,fill:n.value,"text-anchor":h.anchor,"font-size":Rr,class:"pmLabel"},[r("tspan",{class:q(s.value)},S(t.value),3),r("tspan",null,[h.data!==void 0?(l(),P(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Hr)])):w("",!0)}}),Jr={class:"wb-widget p-0 m-0 shadow"},Yr={class:"d-flex justify-content-between"},qr={class:"m-4 me-0 mb-0"},Qr={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Zr={class:"px-4 pt-4 pb-2 wb-subwidget"},Xr={class:"row"},Kr={class:"col m-0 p-0"},en={class:"container-fluid m-0 p-0"},tn={key:0},an={class:"px-4 py-2 wb-subwidget"},rn={class:"row"},nn={class:"col"},on={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(n,o)=>(l(),v("div",{class:q(["p-2 m-0 d-flex",t.value])},[r("div",Jr,[r("div",Yr,[r("h3",qr,[pe(n.$slots,"title",{},()=>[o[0]||(o[0]=r("div",{class:"p-0"},"(title goes here)",-1))]),pe(n.$slots,"subtitle")]),r("div",Qr,[pe(n.$slots,"buttons")])]),r("div",Zr,[r("div",Xr,[r("div",Kr,[r("div",en,[pe(n.$slots,"default")])])])]),n.$slots.footer!=null?(l(),v("div",tn,[o[1]||(o[1]=r("hr",null,null,-1)),r("div",an,[r("div",rn,[r("div",nn,[r("div",on,[pe(n.$slots,"footer")])])])])])):w("",!0)])],2))}});class sn{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new sn),ln={id:"powermeter",class:"p-0 m-0"},cn=["viewBox"],un=["transform"],dn=["x"],Ue=500,Fe=20,ga=1,hn=L({__name:"PowerMeter",setup(a){const e=Ue,t=Math.PI/40,n=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],o=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],s=m(()=>Ue/2-Fe),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+Me(j.house.power+j.charging.power+j.devices.power+j.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?Me(g.maxPower,g.decimalPlaces):Me(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[j.evuOut,j.charging,j.devices,j.batIn,j.house].filter(B=>B.power>0)),k=m(()=>n[c.value.length-1]);function C(B){return o[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const W=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),P(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[N(" Aktuelle Leistung ")])),default:_(()=>[r("figure",ln,[(l(),v("svg",{viewBox:"0 0 "+Ue+" "+i(e)},[r("g",{transform:"translate("+Ue/2+","+i(e)/2+")"},[y(Wr,{radius:s.value,"corner-radius":ga,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),y(Gr,{"sh-device":i(ae),radius:s.value,"corner-radius":ga,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),y(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),y(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),y(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),P(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),v(U,null,te(c.value,(V,J)=>(l(),P(Ae,{key:J,x:C(J).x,y:C(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),P(Ae,{key:1,x:-Ue/2-Fe/4+10,y:-i(e)/2+Fe+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0].color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),P(Ae,{key:2,x:Ue/2+Fe/4-10,y:-i(e)/2+Fe+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),P(Ae,{key:3,x:-Ue/2-Fe/4+10,y:i(e)/2-Fe+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(j).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),P(Ae,{key:4,x:Ue/2+Fe/4-10,y:i(e)/2-Fe+15,value:W.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),y(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),v("text",{key:5,x:Ue/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dn)):w("",!0)],8,un)],8,cn))])]),_:1}))}}),pn=["origin","origin2","transform"],gn=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var n,o;const s=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ue("g#pgSourceGraph");if(f.data.length>0){f.graphMode=="month"||f.graphMode=="year"?J(M,Ye.value):V(M,Ie.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(W.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(f.data)),c=m(()=>Re().range([e.height-10,0]).domain(f.graphMode=="year"?[0,Math.ceil(C.value[1]*10)/10]:[0,Math.ceil(C.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const $=/pv\d+/;f.data.length>0&&(M=Object.keys(f.data[0]).reduce((x,F)=>(F.match($)&&x.push(F),x),[]))}switch(f.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach(($,x)=>{t[$]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),C=m(()=>{let M=Be(f.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(f.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>f.graphMode=="month"||f.graphMode=="year"?-e.width-e.margin.right-22:-e.width),W=m(()=>vt(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const $=nt().x((F,Le)=>E(f.data[Le].date)).y(c.value(0)).curve(ot),x=nt().x((F,Le)=>E(f.data[Le].date)).y0(F=>c.value(f.graphMode=="year"?F[0]/1e3:F[0])).y1(F=>c.value(f.graphMode=="year"?F[1]/1e3:F[1])).curve(ot);mt?(M.selectAll("*").remove(),n=M.selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(F,Le)=>t[k.value[Le]]).attr("d",F=>$(F)),n.transition().duration(s).delay(h).ease(dt).attr("d",F=>x(F)),la()):n.data(p.value).transition().duration(0).ease(dt).attr("d",F=>x(F))}function J(M,E){f.data.length>0&&(mt?(M.selectAll("*").remove(),o=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",($,x)=>t[k.value[x]]).selectAll("rect").data($=>$).enter().append("rect").attr("x",($,x)=>E(f.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),o.transition().duration(s).delay(h).ease(dt).attr("height",$=>f.graphMode=="year"?c.value($[0]/1e3)-c.value($[1]/1e3):c.value($[0])-c.value($[1])).attr("y",$=>f.graphMode=="year"?c.value($[1]/1e3):c.value($[1])),la()):(M.selectAll("*").remove(),o=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",($,x)=>t[k.value[x]]).selectAll("rect").data($=>$).enter().append("rect").attr("x",($,x)=>E(f.data[x].date)??0).attr("y",$=>f.graphMode=="year"?c.value($[1]/1e3):c.value($[1])).attr("width",E.bandwidth()).attr("height",$=>f.graphMode=="year"?c.value($[0]/1e3)-c.value($[1]/1e3):c.value($[0])-c.value($[1]))))}const I=m(()=>{const M=ue("g#pgSourceGraph");if(f.graphMode!="month"&&f.graphMode!="year"&&f.data.length>0){Ie.value.range(qe.value);const E=nt().x(($,x)=>Ie.value(f.data[x].date)).y0($=>c.value($[0])).y1($=>c.value($[1])).curve(ot);M.selectAll("path").attr("d",$=>$?E($):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",$=>Ie.value($.date)).attr("width",e.width/f.data.length)}return"zoomed"});return(M,E)=>(l(),v("g",{id:"pgSourceGraph",origin:d.value,origin2:I.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pn))}}),mn=["origin","origin2","transform"],vn=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]:[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]),n={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var o,s;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const I=ue("g#pgUsageGraph");f.graphMode=="month"||f.graphMode=="year"?V(I):A(I),I.selectAll(".axis").remove();const M=I.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((I,M)=>I[M]??0).keys(C.value)),c=m(()=>p.value(f.data)),k=m(()=>Re().range([e.height+10,2*e.height]).domain(f.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),C=m(()=>{if(f.graphMode!="today"&&f.graphMode!="day"&&f.graphMode!="live")return t.value[e.stackOrder];{const I=t.value[e.stackOrder].slice(),M=I.indexOf("charging");I.splice(M,1);const E=/cp\d+/;let $=[];return f.data.length>0&&($=Object.keys(f.data[0]).reduce((x,F)=>(F.match(E)&&x.push(F),x),[])),$.forEach((x,F)=>{var Le;I.splice(M+F,0,x),n[x]=((Le=O[+x.slice(2)])==null?void 0:Le.color)??"black"}),g.showInverters&&I.push("evuOut"),I}}),z=m(()=>{let I=Be(f.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return I[0]!=null&&I[1]!=null?(f.graphMode=="year"&&(I[0]=I[0]/1e3,I[1]=I[1]/1e3),I):[0,0]}),W=m(()=>f.graphMode=="month"||f.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>vt(k.value).tickSizeInner(W.value).ticks(4).tickFormat(I=>(I==0?"":Math.round(I*10)/10).toLocaleString(void 0)));function A(I){const M=nt().x(($,x)=>Ie.value(f.data[x].date)).y(k.value(0)).curve(ot),E=nt().x(($,x)=>Ie.value(f.data[x].date)).y0($=>k.value($[0])).y1($=>k.value($[1])).curve(ot);g.showAnimations?lt?(I.selectAll("*").remove(),o=I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>M($)).attr("fill",($,x)=>n[C.value[x]]),o.transition().duration(300).delay(100).ease(dt).attr("d",$=>E($)),ua()):(I.selectAll("*").remove(),I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>E($)).attr("fill",($,x)=>n[C.value[x]])):(I.selectAll("*").remove(),I.selectAll(".usageareas").data(c.value).enter().append("path").attr("d",$=>E($)).attr("fill",($,x)=>n[C.value[x]]))}function V(I){lt?(I.selectAll("*").remove(),s=I.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>n[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Ye.value(f.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Ye.value.bandwidth()),s.transition().duration(h).delay(d).ease(dt).attr("y",M=>f.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>f.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ua()):(I.selectAll("*").remove(),s=I.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>n[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Ye.value(f.data[E].date)??0).attr("y",M=>f.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>f.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Ye.value.bandwidth()))}const J=m(()=>{const I=ue("g#pgUsageGraph");if(f.graphMode!="month"&&f.graphMode!="year"){Ie.value.range(qe.value);const M=nt().x((E,$)=>Ie.value(f.data[$].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(ot);I.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(I,M)=>(l(),v("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+I.margin.left+","+I.margin.top+")"},null,8,mn))}}),fn=["transform"],yn=["origin","origin2","transform"],bn=["origin","transform"],_n={key:0},wn=["width","height"],kn={key:1},xn=["y","width","height"],Bt=12,Sn=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Ie.value).ticks(6).tickSizeInner(h.value).tickFormat(it("%H:%M"))),n=m(()=>Ja(Ie.value).ticks(6).tickSizeInner(h.value+3).tickFormat(it(""))),o=m(()=>ht(Ye.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),s=m(()=>ht(Ye.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>f.graphMode!=="month"&&f.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ue("g#PGXAxis");return c.selectAll("*").remove(),f.graphMode=="month"||f.graphMode=="year"?c.call(o.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(k,C)=>C>=0||f.graphMode=="month"||f.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),c.append("text").attr("x",-e.margin.left).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(f.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ue("g#PGXAxis2");return c.selectAll("*").remove(),f.graphMode=="month"||f.graphMode=="year"?c.call(s.value):c.call(n.value),c.selectAll(".tick > text").attr("fill",(k,C)=>C>=0||f.graphMode=="month"||f.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(f.graphMode!="month"&&f.graphMode!="year"){const c=ue("g#PGXAxis"),k=ue("g#PGXAxis2");f.graphMode=="month"||f.graphMode=="year"?(Ye.value.range(qe.value),c.call(o.value),k.call(s.value)):(Ie.value.range(qe.value),c.call(t.value),k.call(n.value))}return"zoomed"});return(c,k)=>(l(),v("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[r("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,yn),r("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,bn),i(g).showGrid?(l(),v("g",_n,[r("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,wn)])):w("",!0),i(g).showGrid?(l(),v("g",kn,[r("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,xn)])):w("",!0)],8,fn))}}),Mn=["id",".origin","d"],$n=["id","d","stroke"],Pn=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let C=Be(f.data,z=>z.date);return C[0]&&C[1]?tt().domain(C).range([0,e.width]):tt().range([0,0])}),n=m(()=>Re().range([e.height-10,0]).domain([0,100])),o=m(()=>{let z=He().x(W=>t.value(W.date)).y(W=>n.value(e.order==2?W.batSoc:e.order==0?W["soc"+me.value[0]]:W["soc"+me.value[1]])??n.value(0))(f.data);return z||""}),s=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]!=null?Y[me.value[1]].name:"???";default:return Y[me.value[0]]!=null?Y[me.value[0]].name:"???"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 0:return 3;case 1:return e.width-3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(f.data.length>0){let C;switch(e.order){case 0:return C=f.data.length-1,n.value(f.data[C]["soc"+me.value[0]]+2);case 1:return C=0,n.value(f.data[C]["soc"+me.value[1]]+2);case 2:return C=Math.round(f.data.length/2),n.value(f.data[C].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"start";case 1:return"end";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(f.graphMode!="month"&&f.graphMode!="year"){const C=ue("path#soc-"+s.value),z=ue("path#socdashes-"+s.value);t.value.range(qe.value);const W=He().x(B=>t.value(B.date)).y(B=>n.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??n.value(0));C.attr("d",W(f.data)),z.attr("d",W(f.data))}return"zoomed"});return(C,z)=>(l(),v(U,null,[r("path",{id:"soc-"+s.value,".origin":k.value,class:"soc-baseline",d:o.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Mn),r("path",{id:"socdashes-"+s.value,class:"soc-dashes",d:o.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,$n),r("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Pn)],64))}}),Cn=["transform"],In=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>Re().range([e.height-10,0]).domain([0,100])),n=m(()=>Ya(t.value).ticks(5).tickFormat(s=>s.toString()+"%"));function o(){let s=ue("g#PGSocAxis");s.call(n.value),s.selectAll(".tick").attr("font-size",12),s.selectAll(".tick line").attr("stroke","var(--color-bg)"),s.select(".domain").attr("stroke","var(--color-bg)")}return Ve(()=>{o()}),(s,h)=>(l(),v("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(s.width-20)+",0)"},null,8,Cn))}}),Bn={class:"d-flex align-self-top justify-content-center align-items-center"},Vn={class:"input-group input-group-xs"},Ln={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},On={class:"dropdown-menu"},An={class:"table optiontable"},Tn=["onClick"],En={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zn={class:"dropdown-menu"},Wn={class:"table optiontable"},Dn=["onClick"],Gn={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jn={class:"dropdown-menu"},Un={class:"table optiontable"},Fn=["onClick"],Nn=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=new Date().getFullYear();let o=Array.from({length:10},(z,W)=>n-W);const s=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const W=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=W;for(let I=0;I(l(),v("span",Bn,[r("div",Vn,[t.mode=="day"||t.mode=="today"?(l(),v("button",Ln,S(u.value),1)):w("",!0),r("div",On,[r("table",An,[(l(!0),v(U,null,te(k.value,(B,A)=>(l(),v("tr",{key:A,class:""},[(l(!0),v(U,null,te(B,(V,J)=>(l(),v("td",{key:J},[V!=0?(l(),v("span",{key:0,type:"button",class:"btn optionbutton",onClick:I=>u.value=V},S(V),9,Tn)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),v("button",En,S(p.value+1),1)):w("",!0),r("div",zn,[r("table",Wn,[(l(),v(U,null,te(d,(B,A)=>r("tr",{key:A,class:""},[(l(!0),v(U,null,te(B,(V,J)=>(l(),v("td",{key:J,class:"p-0 m-0"},[r("span",{type:"button",class:"btn btn-sm optionbutton",onClick:I=>p.value=V},S(V+1),9,Dn)]))),128))])),64))])]),t.mode!="live"?(l(),v("button",Gn,S(c.value),1)):w("",!0),r("div",jn,[r("table",Un,[(l(!0),v(U,null,te(i(o),(B,A)=>(l(),v("tr",{key:A,class:""},[r("td",null,[r("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Fn)])]))),128))])]),t.mode!="live"?(l(),v("button",{key:3,class:"button-outline-secondary",type:"button",onClick:C},W[0]||(W[0]=[r("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[n,o]of e)t[n]=o;return t},Hn=R(Nn,[["__scopeId","data-v-98690e5d"]]),Rn={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Jn=["id","value"],Yn=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(d){n("update:modelValue",d)}});function s(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(o.value=u.value)}return(d,u)=>(l(),v("div",null,[r("div",Rn,[(l(!0),v(U,null,te(d.options,(p,c)=>(l(),v("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==o.value?"active":""]),value:p.value,style:K(s(c)),onClick:h},[r("span",{style:K(s(c))},[p.icon?(l(),v("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),N(" "+S(p.text),1)],4)],14,Jn))),128))])]))}}),Oa=R(Yn,[["__scopeId","data-v-82ab6829"]]),qn=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),n=m(()=>{if(f.waitForData)return"Lädt";switch(f.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ce.date.getDate()+"."+(ce.date.getMonth()+1)+".";case"month":return Ur(Ee.month-1,Ee.year);case"year":return Je.year.toString();default:return"???"}}),o=["live","today","day","month","year"],s=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return f.graphMode},set(J){switch(J){case"day":k();break;case"today":C();break;case"live":c();break;case"month":z();break;case"year":W()}}}),d=m(()=>{switch(f.graphMode){case"live":case"today":return ce.getDate();case"month":return Ee.getDate();default:return ce.getDate()}});function u(J){ha(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){f.graphMode!="live"&&(f.graphMode="live",ve())}function k(){f.graphMode!="day"&&f.graphMode!="today"&&(f.graphMode="day",ve())}function C(){f.graphMode!="today"&&(f.graphMode="today",ha(new Date),ve())}function z(){f.graphMode!="month"&&(f.graphMode="month",ve())}function W(){f.graphMode!="year"&&(f.graphMode="year",ve())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,I)=>(l(),v("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),P(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":I[0]||(I[0]=M=>h.value=M),class:"m-2",options:o.map((M,E)=>({text:s[E],value:M,color:"var(--color-menu)",active:M==i(f).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),v("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:I[1]||(I[1]=M=>J.$emit("shiftUp"))},I[6]||(I[6]=[r("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),r("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),v("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:I[2]||(I[2]=M=>J.$emit("shiftLeft"))},I[7]||(I[7]=[r("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),v("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(n.value),1)):w("",!0),t.value==2?(l(),P(Hn,{key:2,"model-value":d.value,mode:i(f).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),v("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:I[3]||(I[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),r("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),v("span",{key:0,type:"button",class:"p-1",onClick:p},I[8]||(I[8]=[r("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),v("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:I[4]||(I[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),v("span",{key:2,type:"button",class:"p-1",onClick:I[5]||(I[5]=M=>t.value=0)},I[9]||(I[9]=[r("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(qn,[["__scopeId","data-v-d75ec1a4"]]),Qn=["x","fill"],Zn=["x"],Pe=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,n)=>(l(),v(U,null,[t.power>0?(l(),v("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,Qn)):w("",!0),r("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),P(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,Zn)],64))}}),Xn=["transform"],Kn=["width","height"],eo={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},to=["x"],ao=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),n=m(()=>t.value*16),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Wechselr.",id:u}))),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Ne.value.get(u)?d(Ne.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),v("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[r("rect",{rx:"5",width:u.boxwidth,height:n.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,Kn),r("text",eo,[r("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(it)("%H:%M")(new Date(u.entry.date))),9,to),p[0]||(p[0]=r("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),y(Pe,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(o.value,c=>(l(),P(Pe,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(s.value,c=>(l(),P(Pe,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),v(U,null,te(h.value,c=>(l(),P(Pe,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),y(Pe,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),y(Pe,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,Xn))}}),ro=["origin","transform"],no=["x","height","width"],ma=140,oo=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const s=Be(e.data,h=>new Date(h.date));return s[0]&&s[1]?Nt().domain(s).range([0,e.width-e.margin.right]):tt().range([0,0])}),n=m(()=>{const s=Be(e.data,h=>new Date(h.date));return s[0]&&s[1]?Nt().domain(s).range([0,e.width-e.margin.right-ma]):tt().range([0,0])}),o=m(()=>((f.graphMode=="day"||f.graphMode=="today")&&(t.value.range(qe.value),ue("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(s,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(qe.value[1]-qe.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(s,h)=>(l(),v("g",{id:"pgToolTips",origin:o.value,transform:"translate("+s.margin.left+","+s.margin.top+")"},[(l(!0),v(U,null,te(s.data,d=>(l(),v("g",{key:d.date,class:"ttarea"},[r("rect",{x:t.value(d.date),y:"0",height:s.height,class:"ttrect",width:i(f).data.length>0?s.width/i(f).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,no),y(ao,{entry:d,boxwidth:ma,"x-scale":n.value},null,8,["entry","x-scale"])]))),128))],8,ro))}}),so={class:"d-flex justify-content-end"},io={id:"powergraph",class:"p-0 m-0"},lo=["viewBox"],co=["transform"],uo=["x","y"],ho=2,po="Leistung / Ladestand ",go=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>ho&&(h=0),g.usageStackOrder=h,kr(!0)}function t(h){const d=[[0,G.top],[be,xe-G.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,xe]]).extent(d).filter(o).on("zoom",n))}function n(h){Ia.value=h.transform}function o(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function s(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Ve(()=>{const h=ue("svg#powergraph");t(h)}),(h,d)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(po))]),buttons:_(()=>[r("div",so,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:s},d[0]||(d[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[ft(r("figure",io,[(l(),v("svg",{id:"powergraph",viewBox:"0 0 "+i(be)+" "+i(xe)},[y(gn,{width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G)},null,8,["width","height","margin"]),y(vn,{width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),y(Sn,{width:i(be)-i(G).left-2*i(G).right,height:i(xe)-i(G).top-i(G).bottom,margin:i(G),"graph-data":i(f)},null,8,["width","height","margin","graph-data"]),r("g",{transform:"translate("+i(G).left+","+i(G).top+")"},[(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),P(Vt,{key:0,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:0},null,8,["width","height","margin"])):w("",!0),(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),P(Vt,{key:1,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:1},null,8,["width","height","margin"])):w("",!0),(i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live")&&i(de).isBatteryConfigured?(l(),P(Vt,{key:2,width:i(be)-i(G).left-2*i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G),order:2},null,8,["width","height","margin"])):w("",!0),i(f).graphMode=="day"||i(f).graphMode=="today"||i(f).graphMode=="live"?(l(),P(In,{key:3,width:i(be)-i(G).left-i(G).right,height:(i(xe)-i(G).top-i(G).bottom)/2,margin:i(G)},null,8,["width","height","margin"])):w("",!0)],8,co),i(f).graphMode=="day"||i(f).graphMode=="today"?(l(),P(oo,{key:0,width:i(be)-i(G).left-i(G).right,height:i(xe)-i(G).top-i(G).bottom,margin:i(G),data:i(f).data},null,8,["width","height","margin","data"])):w("",!0),r("g",{id:"button",type:"button",onClick:e},[r("text",{x:i(be)-10,y:i(xe)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[r("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,uo)])],8,lo))],512),[[qa,i(f).data.length>0]])]),_:1}))}}),mo=R(go,[["__scopeId","data-v-62d106b6"]]),vo=["id"],fo=["x","width","height","fill"],yo=["x","width","height"],bo=["x","y","width","height"],_o=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),n=m(()=>{let s=0;return e.item.energyPv>0&&(s=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),s>t.value&&(s=t.value),s}),o=m(()=>{let s=0;return e.item.energyBat>0&&(s=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),s>t.value&&(s=t.value),s});return(s,h)=>(l(),v("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[r("rect",{class:"bar",x:e.xScale(s.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:s.item.color},null,8,fo),r("rect",{class:"bar",x:e.xScale(s.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:n.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,yo),r("rect",{class:"bar",x:e.xScale(s.item.name)+e.xScale.bandwidth()/6,y:n.value,width:e.xScale.bandwidth()*2/3,height:o.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,bo)],8,vo))}}),wo={id:"emBargraph"},ko=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="day"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="day"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="day"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="day"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",wo,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(_o,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":n(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),s[0]||(s[0]=r("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),xo=["origin"],So=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>vt(e.yScale).tickFormat(s=>o(s)).ticks(6).tickSizeInner(-e.width)),n=m(()=>{const s=ue("g#emYAxis");return s.attr("class","axis").call(t.value),s.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),s.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?s.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):s.selectAll(".tick line").attr("stroke","var(--color-bg)"),s.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function o(s){return s>0?f.graphMode=="year"?(s/1e6).toString():(s/1e3).toString():""}return(s,h)=>(l(),v("g",{id:"emYAxis",class:"axis",origin:n.value},null,8,xo))}}),Mo=["id"],$o=["x","y","font-size"],Po=["x","y","font-size","fill"],Co=["x","y","font-size","fill"],Io=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),n=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),o=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function s(u,p){return p.length>o.value?p.substring(0,o.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),v("g",{id:"barlabel-"+e.item.name},[r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":n.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ut)(u.item.energy,i(g).decimalPlaces,!1)),9,$o),r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":n.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Po),r("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":n.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(s(u.item.name,u.item.icon)),11,Co)],8,Mo))}}),Bo={id:"emBarLabels"},Vo=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="today"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="today"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",Bo,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(Io,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":n(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Lo={class:"d-flex justify-content-end"},Oo={id:"energymeter",class:"p-0 m-0"},Ao={viewBox:"0 0 500 500"},To=["transform"],Eo=["x"],zo={key:0},va=500,Lt=500,fa=12,Wo="Energie",Do=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=s.value;const c=T.items;let k=[];switch(g.debug&&h(),ct.value==!0&&(ct.value=!1),f.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?Qe.value=!0:(Qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(C=>{c["cp"+C]&&k.push(c["cp"+C])}),k.push(c.devices),ae.forEach((C,z)=>{C.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(C=>C.energy&&C.energy>0)}),n=m(()=>xt().range([0,va-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),o=m(()=>Re().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),s=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=j;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([j.batIn,j.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",s.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(Wo))]),buttons:_(()=>[r("div",Lo,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[r("figure",Oo,[(l(),v("svg",Ao,[r("g",{transform:"translate("+e.left+","+e.top+")"},[y(ko,{plotdata:t.value,"x-scale":n.value,"y-scale":o.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),y(So,{"y-scale":o.value,width:va,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),r("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(f).graphMode=="year"?"MWh":"kWh"),9,Eo),y(Vo,{plotdata:t.value,"x-scale":n.value,"y-scale":o.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,To)]))]),i(Qe)?(l(),v("p",zo,"No data")):w("",!0)]),_:1}))}}),Go=R(Do,[["__scopeId","data-v-32c82102"]]),jo=["id"],Uo=["y","width","fill"],Fo=["y","width"],No=["y","x","width"],Ho=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),n=m(()=>{let s=0;return e.item.energyPv>0&&(s=e.xScale(e.item.energyPv)),s>t.value&&(s=t.value),s}),o=m(()=>{let s=0;return e.item.energyBat>0&&(s=e.xScale(e.item.energyBat)),s>t.value&&(s=t.value),s});return(s,h)=>(l(),v("g",{id:`bar-${e.item.name}`},[r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:s.item.color},null,8,Uo),r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:n.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Fo),r("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:n.value,rx:"3",ry:"3",height:"7",width:o.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,No)],8,jo))}}),Ro={id:"emBargraph"},Jo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,n)=>(l(),v("g",Ro,[(l(!0),v(U,null,te(e.plotdata,(o,s)=>(l(),v("g",{key:s},[y(Ho,{id:s.toString(),item:o,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Yo=["id"],qo=["y","x","fill"],Qo=["y","x"],Zo=["y","x","font-size"],Ot=24,Xo=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function n(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}return(o,s)=>(l(),v("g",{id:"barlabel-"+e.id},[r("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(e.item.icon),11,qo),r("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ut)(o.item.energy,i(g).decimalPlaces,!1)),9,Qo),r("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(n()),9,Zo)],8,Yo))}}),Ko={id:"emBarLabels"},es=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(o){if(o.name=="PV"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,d=(f.graphMode=="live"||f.graphMode=="today"?j:T.items).evuOut.energy,u=s.pv.energy;return Math.round((u-d)/u*100)}else if(o.name=="Netz"){const s=f.graphMode=="live"||f.graphMode=="today"?Q:T.items,h=f.graphMode=="live"||f.graphMode=="today"?j:T.items,d=h.evuOut.energy,u=s.evuIn.energy,p=s.pv.energy,c=s.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return o.pvPercentage}function n(o){return o.name=="PV"?"Eigen":"Aut"}return(o,s)=>(l(),v("g",Ko,[(l(!0),v(U,null,te(e.plotdata,(h,d)=>(l(),v("g",{key:d},[y(Xo,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":o.itemHeight,"aut-text":n(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class ts{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class as{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new as);const he=ee(new Map),Aa=a=>{he.value.set(a,new ts(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function rs(){he.value=new Map}const ns={class:"d-flex justify-content-end"},os={id:"energymeter",class:"p-0 m-0"},ss=["viewBox"],is=["transform"],ls=["x"],cs={key:0},ya=500,At=60,us=12,ds="Energie",hs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>n.value.length*At+e.top+e.bottom),n=m(()=>{let c=Object.values(Q),k=h.value;const C=T.items;let z=[];switch(g.debug&&u(),ct.value==!0&&(ct.value=!1),f.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(C).length==0?Qe.value=!0:(Qe.value=!1,z=[C.evuIn,C.pv,C.evuOut,C.batOut,C.charging],Object.values(O).length>1&&Object.keys(O).forEach(W=>{C["cp"+W]&&z.push(C["cp"+W])}),z.push(C.devices),ae.forEach((W,B)=>{W.showInGraph&&C["sh"+B]&&z.push(C["sh"+B])}),z=z.concat([C.batIn,C.house]))}return z.filter(W=>W.energy&&W.energy>0)}),o=m(()=>Re().range([0,ya-e.left-e.right]).domain([0,Sa(n.value,c=>c.energy)])),s=m(()=>xt().range([e.top,t.value-e.bottom]).domain(n.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let C=j;return[...[C.evuOut,C.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[C.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([j.batIn,j.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(C=>{c.splice(2+k++,0,{name:C.name,power:C.power,energy:C.energy,energyPv:0,energyBat:0,pvPercentage:0,color:C.color,icon:C.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(C=>{c.splice(3+k++,0,{name:C.name,power:C.power,energy:C.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:C.color,icon:C.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),P(_t,{"full-width":!0},{title:_(()=>[N(S(ds))]),buttons:_(()=>[r("div",ns,[y(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(Ct),onShiftRight:i(ea),onShiftUp:i(ta),onShiftDown:i(aa)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),v("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[r("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[r("figure",os,[(l(),v("svg",{viewBox:"0 0 500 "+t.value},[r("g",{transform:"translate("+e.left+","+e.top+")"},[y(Jo,{plotdata:n.value,xscale:o.value,yscale:s.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),r("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":us},S(i(f).graphMode=="year"?"MWh":"kWh"),9,ls),y(es,{plotdata:n.value,yscale:s.value,width:ya,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,is)],8,ss))]),i(Qe)?(l(),v("p",cs,"No data")):w("",!0)]),_:1}))}}),ps=R(hs,[["__scopeId","data-v-63a4748e"]]),gs={class:"d-flex flex-column align-items-center justify-content-start infoitem"},ms=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),n=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),o=m(()=>e.small?"mt-0":"mt-1");return(s,h)=>(l(),v("span",gs,[r("span",{class:q(["d-flex heading",o.value]),style:K(t.value)},S(e.heading),7),r("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(n.value)},[pe(s.$slots,"default",{},void 0,!0)],4)]))}}),X=R(ms,[["__scopeId","data-v-f6af00e8"]]),vs={class:"d-flex justify-content-between align-items-center titlerow"},fs={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ys={class:"contentrow grid-col-12"},bs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let o={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(o.color=e.titlecolor),e.small&&(o["font-size"]="var(--font-verysmall)"),o}),n=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(o,s)=>(l(),v("div",{class:q(["wb-subwidget px-3 pt-2 my-0",n.value])},[r("div",vs,[r("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(o.$slots,"title",{},void 0,!0)],4),r("div",fs,[pe(o.$slots,"buttons",{},void 0,!0)])]),r("div",ys,[pe(o.$slots,"default",{},void 0,!0)])],2))}}),at=R(bs,[["__scopeId","data-v-e989060d"]]),_s={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},ws={class:"titlecolumn m-0 p-0 d-flex align-items-center"},ks={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},xs={class:"justify-content-stretch d-flex"},Ss=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function n(){t.value=!t.value}const o=m(()=>{let s={color:"var(--color-charging)"};return t.value&&(s.color="var(--color-battery)"),s});return(s,h)=>(l(),P(at,{fullwidth:!!s.fullwidth},{default:_(()=>[r("div",_s,[r("div",ws,[r("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:n},[e.icon?(l(),v("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),N(" "+S(s.title),1)]),r("span",null,[e.infotext?(l(),v("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(o.value),onClick:n},null,4)):w("",!0)])]),t.value?(l(),v("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:n},[h[0]||(h[0]=r("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),N(" "+S(s.infotext),1)])):w("",!0),r("div",ks,[r("span",xs,[pe(s.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),H=R(Ss,[["__scopeId","data-v-b935eb33"]]),Ms={class:"d-flex flex-column"},$s={class:"d-flex flex-fill justify-content-between align-items-center"},Ps={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Cs={key:0,id:"rangeIndicator",class:"rangeIndicator"},Is={viewBox:"0 0 100 2"},Bs=["width"],Vs=["x","width"],Ls=["x","width"],Os=["id","min","max","step"],As={class:"d-flex justify-content-between align-items-center"},Ts={class:"minlabel ps-4"},Es={class:"valuelabel"},zs={class:"maxlabel pe-4"},Ws=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=t.decimals??0,o=e,s=m({get(){return Math.round(t.modelValue*Math.pow(10,n))/Math.pow(10,n)},set(k){o("update:modelValue",k)}});function h(){s.value>t.min&&(s.value=Math.round((s.value-t.step)*Math.pow(10,n))/Math.pow(10,n))}function d(){s.valueRe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,C)=>(l(),v("span",Ms,[r("span",$s,[r("span",{type:"button",class:"minusButton",onClick:h},C[1]||(C[1]=[r("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),r("div",Ps,[t.showSubrange?(l(),v("figure",Cs,[(l(),v("svg",Is,[r("g",null,[r("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,Bs),r("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Vs),r("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Ls)])]))])):w("",!0),ft(r("input",{id:k.id,"onUpdate:modelValue":C[0]||(C[0]=z=>s.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,Os),[[Za,s.value,void 0,{number:!0}]])]),r("span",{type:"button",class:"plusButton",onClick:d},C[2]||(C[2]=[r("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),r("span",As,[r("span",Ts,S(k.min),1),r("span",Es,S(s.value)+" "+S(k.unit),1),r("span",zs,S(k.max),1)])]))}}),Se=R(Ws,[["__scopeId","data-v-267ede95"]]),Ds=["id","value"],Gs=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(d){n("update:modelValue",d)}});function s(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(o.value=u.value)}return(d,u)=>(l(),v("div",null,[(l(!0),v(U,null,te(d.options,(p,c)=>(l(),v("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==o.value?"active":""]),value:p[1],style:K(s(c)),onClick:h},[r("span",{style:K(s(c))},[p[3]?(l(),v("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),N(" "+S(p[0]),1)],4)],14,Ds))),128))]))}}),We=R(Gs,[["__scopeId","data-v-df222cbe"]]),js={class:"mt-2"},Us={key:0},Fs=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),n=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],o=m({get(){return t.value.instantMaxEnergy/1e3},set(s){t.value.instantMaxEnergy=s*1e3}});return(s,h)=>(l(),v("div",js,[h[4]||(h[4]=r("p",{class:"heading ms-1"},"Sofortladen:",-1)),y(H,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[y(Se,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),v("hr",Us)):w("",!0),y(H,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[y(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:n.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),P(H,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),P(H,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxEnergy",modelValue:o.value,"onUpdate:modelValue":h[3]||(h[3]=d=>o.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ns=R(Fs,[["__scopeId","data-v-0303d179"]]),Hs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(h){n("update:modelValue",h)}}),s=m(()=>o.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),v("div",Hs,[ft(r("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(s.value)},null,4),[[Ma,o.value]])]))}}),Rs={class:"pt-2"},Js={key:3},Ys=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),n=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),o=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),s=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),v("div",Rs,[d[8]||(d[8]=r("p",{class:"heading ms-1"},"PV-Laden:",-1)),y(H,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[y(se,{id:"limitSoc",modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u)},null,8,["modelValue"])]),_:1}),s.value?(l(),P(H,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[y(Se,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),y(H,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[y(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),y(H,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[y(se,{modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),o.value?(l(),P(H,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[N(S(i(Te).minsoc),1)]),default:_(()=>[y(Se,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),o.value?(l(),P(H,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[y(Se,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),n.value||o.value?(l(),v("hr",Js)):w("",!0),y(H,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[y(se,{modelValue:n.value,"onUpdate:modelValue":d[6]||(d[6]=u=>n.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),n.value?(l(),P(H,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[y(Se,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),qs=R(Ys,[["__scopeId","data-v-faa69015"]]),Qs={class:"table table-borderless"},Zs={class:"tablecell"},Xs={class:"tablecell"},Ks={class:"tablecell"},ei={class:"tablecell"},ti={class:"tablecell left"},ai=["href"],ri=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,n=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function o(d){return n.value[d].time}function s(d){return{color:n.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":n.value[d].active?"bold":"regular"}}return(d,u)=>(l(),v(U,null,[u[1]||(u[1]=r("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),r("table",Qs,[u[0]||(u[0]=r("thead",null,[r("tr",null,[r("th",{class:"tableheader"},"Ziel"),r("th",{class:"tableheader"},"Limit"),r("th",{class:"tableheader"},"Zeit"),r("th",{class:"tableheader"},"Wiederholung"),r("th",{class:"tableheader"})])],-1)),r("tbody",null,[(l(!0),v(U,null,te(n.value,(p,c)=>(l(),v("tr",{key:c,style:K(h(c))},[r("td",Zs,S(p.limit.soc_scheduled)+"%",1),r("td",Xs,S(p.limit.soc_limit)+"%",1),r("td",Ks,S(o(c)),1),r("td",ei,S(e[p.frequency.selected]),1),r("td",ti,[r("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[r("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(c)),type:"button"},null,6)],8,ai)])],4))),128))])])],64))}}),ni=R(ri,[["__scopeId","data-v-e8f5ad9d"]]),oi={class:"table table-borderless"},si={class:"tablecell"},ii={class:"tablecell"},li={class:"tablecell"},ci={class:"tablecell"},ui={class:"tablecell left"},di=["href"],hi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,n=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function o(h){return{color:n.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function s(h){return{"font-weight":n.value[h].active?"bold":"regular"}}return(h,d)=>(l(),v(U,null,[d[1]||(d[1]=r("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),r("table",oi,[d[0]||(d[0]=r("thead",null,[r("tr",null,[r("th",{class:"tableheader"},"Von"),r("th",{class:"tableheader"},"Bis"),r("th",{class:"tableheader"},"Ladestrom"),r("th",{class:"tableheader"},"Wiederholung"),r("th",{class:"tableheader right"})])],-1)),r("tbody",null,[(l(!0),v(U,null,te(n.value,(u,p)=>(l(),v("tr",{key:p,style:K(s(p))},[r("td",si,S(u.time[0]),1),r("td",ii,S(u.time[1]),1),r("td",li,S(u.current)+" A",1),r("td",ci,S(e[u.frequency.selected]),1),r("td",ui,[r("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[r("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(p)),type:"button"},null,6)],8,di)])],4))),128))])])],64))}}),pi=R(hi,[["__scopeId","data-v-192e287b"]]),gi={class:"settingsheader mt-2 ms-1"},mi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,n)=>(l(),v(U,null,[r("p",gi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),y(H,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":n[0]||(n[0]=o=>i(Y)[e.vehicleId].chargeTemplateId=o),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(o=>[i(_e)[+o].name,o])},null,8,["modelValue","options"])]),_:1}),y(H,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":n[1]||(n[1]=o=>i(Y)[e.vehicleId].evTemplateId=o),modelModifiers:{number:!0},options:Object.keys(i(Rt)).map(o=>[i(Rt)[+o].name,o])},null,8,["modelValue","options"])]),_:1})],64))}}),vi=R(mi,[["__scopeId","data-v-fcb57a44"]]),fi={class:"settingsheader mt-2 ms-1"},yi=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(n,o)=>(l(),v(U,null,[r("p",fi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),y(H,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":o[0]||(o[0]=s=>i(t).chargeMode=s),options:Object.keys(i(ye)).map(s=>[i(ye)[s].name,s,i(ye)[s].color,i(ye)[s].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),y(H,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":o[1]||(o[1]=s=>i(t).connectedVehicle=s),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(s=>s.visible).map(s=>[s.name,s.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),y(H,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":o[2]||(o[2]=s=>i(t).isLocked=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),y(H,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":o[3]||(o[3]=s=>i(t).hasPriority=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),y(H,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":o[4]||(o[4]=s=>i(t).timedCharging=s)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),P(H,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[y(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":o[5]||(o[5]=s=>i(de).pvBatteryPriority=s),options:i(lr)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),P(H,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[y(se,{modelValue:i(t).etActive,"onUpdate:modelValue":o[6]||(o[6]=s=>i(t).etActive=s)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),bi=R(yi,[["__scopeId","data-v-e348a34c"]]),_i={class:"providername ms-1"},wi={class:"container"},ki={id:"pricechart",class:"p-0 m-0"},xi={viewBox:"0 0 400 300"},Si=["id","origin","transform"],Mi={key:0,class:"p-3"},$i={key:1,class:"d-flex justify-content-end"},Pi=["disabled"],Xe=400,ba=250,_a=12,Ci=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const n=ee(!1),o=ee(e.chargepoint),s=m({get(){return t.value},set(D){t.value=D,n.value=!0}});function h(){o.value&&(O[o.value.id].etMaxPrice=s.value),n.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let D=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{D.push([Oe,Z])}),D}),c=m(()=>p.value.length>1?(Xe-u.left-u.right)/p.value.length-1:0),k=m(()=>n.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),C=m(()=>{let D=Be(p.value,Z=>Z[0]);return D[1]&&(D[1]=new Date(D[1]),D[1].setTime(D[1].getTime()+36e5)),tt().range([u.left,Xe-u.right]).domain(D)}),z=m(()=>{let D=[0,0];return p.value.length>0?(D=Be(p.value,Z=>Z[1]),D[0]=Math.floor(D[0]-1),D[1]=Math.floor(D[1]+1)):D=[0,0],D}),W=m(()=>Re().range([ba-u.bottom,0]).domain(z.value)),B=m(()=>{const D=He(),Z=[[u.left,W.value(s.value)],[Xe-u.right,W.value(s.value)]];return D(Z)}),A=m(()=>{const D=He(),Z=[[u.left,W.value(g.lowerPriceBound)],[Xe-u.right,W.value(g.lowerPriceBound)]];return D(Z)}),V=m(()=>{const D=He(),Z=[[u.left,W.value(g.upperPriceBound)],[Xe-u.right,W.value(g.upperPriceBound)]];return D(Z)}),J=m(()=>{const D=He(),Z=[[u.left,W.value(0)],[Xe-u.right,W.value(0)]];return D(Z)}),I=m(()=>ht(C.value).ticks(6).tickSize(5).tickFormat(it("%H:%M"))),M=m(()=>vt(W.value).ticks(6).tickSizeInner(-(Xe-u.right-u.left)).tickFormat(D=>D.toString())),E=m(()=>{d.value==!0;const D=ue("g#"+$.value);D.selectAll("*").remove(),D.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Ze=>C.value(Ze[0])).attr("y",Ze=>W.value(Ze[1])).attr("width",c.value).attr("height",Ze=>W.value(z.value[0])-W.value(Ze[1])).attr("fill",Ze=>Ze[1]<=s.value?"var(--color-charging)":"var(--color-axis)");const Oe=D.append("g").attr("class","axis").call(I.value);Oe.attr("transform","translate(0,"+(ba-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",_a).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=D.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",_a).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&D.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),D.append("path").attr("d",A.value).attr("stroke","green"),D.append("path").attr("d",V.value).attr("stroke","red"),D.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),$=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let D=[];return re.etPriceList.forEach(Z=>{D.push(Z)}),D.sort((Z,Oe)=>Z-Oe)});function F(){let D=x.value[0];for(let Z of x.value){if(Z>=s.value)break;D=Z}s.value=D}function Le(){let D=x.value[0];for(let Z of x.value)if(Z>s.value){D=Z;break}else D=Z;s.value=D}return Ve(()=>{d.value=!d.value}),(D,Z)=>(l(),v(U,null,[Z[3]||(Z[3]=r("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),r("p",_i,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=r("hr",null,null,-1)),r("div",wi,[r("figure",ki,[(l(),v("svg",xi,[r("g",{id:$.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Si)]))])]),D.chargepoint!=null?(l(),v("div",Mi,[D.chargepoint.etActive?(l(),P(Se,{key:0,id:"pricechart_local",modelValue:s.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>s.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),r("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[r("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:F},Z[1]||(Z[1]=[r("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),r("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:Le},Z[2]||(Z[2]=[r("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),D.chargepoint!=null?(l(),v("div",$i,[r("span",{class:"me-3 pt-0",onClick:h},[r("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!n.value}," Bestätigen ",12,Pi)])])):w("",!0)],64))}}),Ta=R(Ci,[["__scopeId","data-v-8ec7a31d"]]),Ii={class:"status-string"},Bi={style:{color:"red"}},Vi={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Li={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},Oi=["data-bs-target"],Ai=["data-bs-target"],Ti=["data-bs-target"],Ei=["data-bs-target"],zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},ji=["id"],Ui=["id"],Fi=["id"],Ni=["id"],Hi=["id"],Ri=["id"],Ji=["id"],Yi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,n=m(()=>_e[t.chargeTemplate]),o=m(()=>t.id);return Ve(()=>{}),(s,h)=>(l(),v(U,null,[y(H,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[r("span",Ii,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),P(H,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[r("span",Bi,S(i(t).faultStr),1)]),_:1})):w("",!0),r("div",Vi,[r("nav",Li,[r("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+o.value},h[0]||(h[0]=[r("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,Oi),s.chargepoint.chargeMode=="instant_charging"?(l(),v("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+o.value},h[1]||(h[1]=[r("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Ai)):w("",!0),s.chargepoint.chargeMode=="pv_charging"?(l(),v("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+o.value},h[2]||(h[2]=[r("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Ti)):w("",!0),s.chargepoint.chargeMode=="scheduled_charging"?(l(),v("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+o.value},h[3]||(h[3]=[r("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Ei)):w("",!0),s.chargepoint.timedCharging?(l(),v("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+o.value},h[4]||(h[4]=[r("i",{class:"fa-solid fa-clock"},null,-1)]),8,zi)):w("",!0),r("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+o.value},h[5]||(h[5]=[r("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Wi),i(re).active&&i(t).etActive?(l(),v("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+o.value},h[6]||(h[6]=[r("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Di)):w("",!0)]),r("div",Gi,[r("div",{id:"chargeSettings"+o.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[y(bi,{chargepoint:s.chargepoint},null,8,["chargepoint"])],8,ji),r("div",{id:"instantSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[y(Ns,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ui),r("div",{id:"pvSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[y(qs,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Fi),r("div",{id:"scheduledSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[n.value!=null?(l(),P(ni,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Ni),r("div",{id:"timeSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[n.value!=null?(l(),P(pi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Hi),r("div",{id:"carSettings"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),P(vi,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Ri),r("div",{id:"priceChart"+o.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),P(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Ji)])])],64))}}),Yt=R(Yi,[["__scopeId","data-v-1164316d"]]),qi={class:"d-flex justify-content-center align-items-center"},Qi=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),n=m(()=>({color:e.color??"var(--color-menu)"}));return(o,s)=>(l(),v("span",qi,[r("i",{class:q(["fa me-1",t.value]),style:K(n.value)},null,6),N(" "+S(Math.round(o.soc)+"%"),1)]))}}),It=R(Qi,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ut(e.wattH,g.decimalPlaces));return(n,o)=>(l(),v("span",null,S(t.value),1))}}),Zi={class:"wb-widget p-0 m-0 shadow widgetWidth"},Xi={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},Ki={class:"d-flex align-items-center widgetname p-0 m-0"},el={class:"buttonrea d-flex float-right justify-content-end align-items-center"},tl={class:"grid12 pb-3"},al=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(n,o)=>(l(),v("div",{class:q(["p-2 m-0",t.value])},[r("div",Zi,[r("div",Xi,[r("div",Ki,[pe(n.$slots,"title",{},()=>[o[0]||(o[0]=r("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(n.$slots,"subtitle",{},void 0,!0)]),r("div",el,[pe(n.$slots,"buttons",{},void 0,!0)])]),r("div",tl,[pe(n.$slots,"default",{},void 0,!0)])])],2))}}),je=R(al,[["__scopeId","data-v-1d5bc1d9"]]),rl=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(n,o)=>(l(),v("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(n.$slots,"default",{},void 0,!0)],4))}}),$e=R(rl,[["__scopeId","data-v-36112fa3"]]),nl={class:"d-flex justify-content-center align-items-center"},ol={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},sl={key:0},il={key:1,class:"row m-0 mt-0 p-0"},ll={class:"col m-0 p-0"},cl={key:0},ul={class:"row"},dl={class:"col"},hl={class:"carTitleLine d-flex justify-content-between align-items-center"},pl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},gl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},ml={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},vl={class:"grid12"},fl={style:{color:"var(--color-charging)"}},yl={style:{color:"var(--color-charging)"}},bl={style:{color:"var(--color-charging)"}},_l={class:"targetCurrent"},wl={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},kl={class:"d-flex justify-content-stretch align-items-center"},xl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Sl=["id"],Ml=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),n=m({get(){return e.chargepoint.chargeMode},set($){O[e.chargepoint.id].chargeMode=$}}),o=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),s=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const $=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,F=e.chargepoint.dailyYield;return x>0?Math.round($/x*F).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let $="";return e.chargepoint.isLocked?$="fa-lock":e.chargepoint.isCharging?$=" fa-bolt":e.chargepoint.isPluggedIn&&($="fa-plug"),"fa "+$}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),C=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),W=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",I.value,e.chargepoint.connectedVehicle),A.value=!1}const I=m({get(){return e.chargepoint.soc},set($){O[e.chargepoint.id].soc=$}}),M=m(()=>{const[$]=re.etPriceList.values();return(Math.round($*10)/10).toFixed(1)}),E=ee(!1);return($,x)=>(l(),v(U,null,[B.value?w("",!0):(l(),P(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[r("span",nl,[r("span",{style:K(C.value),onClick:x[0]||(x[0]=F=>B.value=!B.value)},[x[12]||(x[12]=r("span",{class:"fa-solid fa-charging-station"}," ",-1)),N(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),v("span",ol,"Fehler")):w("",!0)])]),buttons:_(()=>[r("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=F=>B.value=!B.value)},x[13]||(x[13]=[r("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),v("div",cl,[r("div",ul,[r("div",dl,[r("div",hl,[r("h3",{onClick:x[3]||(x[3]=F=>B.value=!B.value)},[x[14]||(x[14]=r("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),N(" "+S($.chargepoint.vehicleName)+" ",1),$.chargepoint.hasPriority?(l(),v("span",pl)):w("",!0),$.chargepoint.etActive?(l(),v("span",gl)):w("",!0),$.chargepoint.timedCharging?(l(),v("span",ml)):w("",!0)]),$.chargepoint.isSocConfigured?(l(),P($e,{key:0,bgcolor:W.value},{default:_(()=>[y(It,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),$.chargepoint.isSocManual?(l(),v("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=F=>A.value=!A.value)})):w("",!0),$.chargepoint.isSocManual?w("",!0):(l(),v("i",{key:1,type:"button",class:q(["fa-solid fa-sm",$.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),r("div",vl,[y(Oa,{id:"chargemode-"+$.chargepoint.name,modelValue:n.value,"onUpdate:modelValue":x[5]||(x[5]=F=>n.value=F),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(F=>({text:i(ye)[F].name,value:F,color:i(ye)[F].color,icon:i(ye)[F].icon,active:i(ye)[F].mode==$.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),P(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[r("span",fl,[y(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[r("span",yl,S(s.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[r("span",bl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),P(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[r("span",_l,S(o.value),1)]),_:1})):w("",!0),y(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":Math.max($.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),y(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[N(S(h.value),1)]),_:1}),$.chargepoint.isSocConfigured?(l(),P(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[N(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),v("div",wl,[x[15]||(x[15]=r("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),r("span",kl,[r("span",null,[y(Se,{id:"manualSoc",modelValue:I.value,"onUpdate:modelValue":x[6]||(x[6]=F=>I.value=F),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),r("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=r("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),P(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[y(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=F=>t.value.etActive=F)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),P(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[r("span",{type:"button",onClick:x[8]||(x[8]=F=>E.value=!E.value)},[N(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),v("i",xl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),P(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[r("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),v("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),P(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),r("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=F=>E.value=!1)},x[16]||(x[16]=[r("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Sl)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),v("div",sl,[r("div",{class:"grid12",onClick:x[2]||(x[2]=F=>B.value=!B.value)},[y(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[r("span",{style:K({color:u.value})},[r("i",{class:q(p.value)},null,2),N(" "+S(d.value),1)],4)]),_:1}),y(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":$.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),v("div",il,[r("div",ll,[$.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:$.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),P(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[r("span",{style:K(C.value),onClick:x[10]||(x[10]=F=>B.value=!B.value)},[x[18]||(x[18]=r("span",{class:"fas fa-gear"}," ",-1)),N(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=F=>B.value=!B.value)},x[19]||(x[19]=[r("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[$.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:$.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),$l=R(Ml,[["__scopeId","data-v-3a733de3"]]),Pl=["id"],Cl={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Il={class:"modal-content"},Bl={class:"modal-header"},Vl={class:"modal-title"},Ll={class:"modal-body",style:{"background-color":"var(--color-bg)"}},Ol=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Ve(()=>{}),(t,n)=>(l(),v("div",{id:e.modalId,class:"modal fade"},[r("div",Cl,[r("div",Il,[r("div",Bl,[r("h3",Vl,[pe(t.$slots,"title",{},void 0,!0)]),n[0]||(n[0]=r("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[r("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),r("div",Ll,[pe(t.$slots,"default",{},void 0,!0),n[1]||(n[1]=r("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Pl))}}),Ea=R(Ol,[["__scopeId","data-v-eaefae30"]]),Al={class:"d-flex align-items-center"},Tl={class:"cpname"},El={class:"d-flex float-right justify-content-end align-items-center"},zl=["data-bs-target"],Wl=["data-bs-target"],Dl={class:"subgrid"},Gl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},jl={class:"d-flex flex-column align-items-center px-0"},Ul={class:"d-flex justify-content-center flex-wrap"},Fl={class:"d-flex align-items-center"},Nl={class:"badge phasesInUse rounded-pill"},Hl={class:"d-flex flex-wrap justify-content-center chargeinfo"},Rl={class:"me-1"},Jl={key:0,class:"subgrid socEditRow m-0 p-0"},Yl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},ql={class:"d-flex justify-content-stretch align-items-center"},Ql=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),n=m(()=>ye[e.chargepoint.chargeMode].icon),o=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),s=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>Me(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ut(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),C=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function W(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),v(U,null,[y(at,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[r("div",Al,[r("span",Tl,S(V.chargepoint.name),1),r("span",{class:"badge rounded-pill statusbadge mx-2",style:K(s.value)},[r("i",{class:q([o.value,"me-1"])},null,2),N(" "+S(A.value),1)],4)])]),buttons:_(()=>[r("div",El,[r("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[r("i",{class:q(["fa me-1",n.value])},null,2),N(" "+S(C.value),1)],12,zl),r("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Wl)])]),default:_(()=>[r("div",Dl,[y(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),v("span",Gl,[V.chargepoint.soc?(l(),P(It,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),v("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=I=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),v("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),y(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[r("div",jl,[r("span",Ul,[r("span",null,S(d.value),1),r("span",Fl,[r("span",Nl,S(p.value),1),r("span",null,S(u.value),1)])])])]),_:1}),y(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[r("div",Hl,[r("span",Rl,S(c.value),1),r("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),v("div",Jl,[r("div",Yl,[J[2]||(J[2]=r("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),r("span",ql,[r("span",null,[y(Se,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=I=>B.value=I),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),r("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:W})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),P(Xa,{to:"body"},[(l(),P(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[N(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),P(Yt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),Zl=R(Ql,[["__scopeId","data-v-25e4aa5d"]]),Xl=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,n)=>(l(),P(je,{"variable-width":!0},{title:_(()=>n[0]||(n[0]=[r("span",{class:"fa-solid fa-charging-station"}," ",-1),N(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),P($e,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[N("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),v(U,null,te(e.value,(o,s)=>(l(),v("div",{key:s,class:"subgrid pb-2"},[y(Zl,{chargepoint:o},null,8,["chargepoint"])]))),128))]),_:1}))}}),Kl=R(Xl,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const n=a,o=m(()=>{let p=Object.values(O);return u(),p}),s=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+n.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Ve(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),v(U,null,[n.compact?w("",!0):(l(),v("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",s.value])},[(l(!0),v(U,null,te(o.value,k=>(l(),v("swiper-slide",{key:k.id},[r("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[y($l,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),n.compact?(l(),P(Kl,{key:1})):w("",!0)],64))}}),ec={class:"container-fluid p-0 m-0"},tc={class:"row p-0 m-0"},ac={class:"d-grid gap-2"},rc=["onClick"],nc={class:"col-md-4 p-1"},oc={class:"d-grid gap-2"},sc={key:0},ic={class:"row justify-content-center m-1 p-0"},lc={class:"col-lg-4 p-1 m-0"},cc={class:"d-grid gap-2"},uc={class:"col-lg-4 p-1 m-0"},dc={class:"d-grid gap-2"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],n=m(()=>O[e.cpId]);function o(p){return p==n.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function s(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){n.value.chargeMode=p}function d(p){n.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),v("div",ec,[r("div",tc,[(l(),v(U,null,te(t,(k,C)=>r("div",{key:C,class:"col-md-4 p-1"},[r("div",ac,[r("button",{type:"button",class:q(o(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,rc)])])),64)),r("div",nc,[r("div",oc,[n.value.isLocked?(l(),v("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),n.value.isLocked?w("",!0):(l(),v("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),v("div",sc,[c[8]||(c[8]=r("hr",null,null,-1)),c[9]||(c[9]=r("div",{class:"row"},[r("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),r("div",ic,[r("div",lc,[r("div",cc,[r("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[N(" EV "),r("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),r("div",uc,[r("div",dc,[r("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[N(" Speicher "),r("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),r("div",hc,[r("div",pc,[r("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",s("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[N(" MinSoc "),r("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),mc={class:"col-lg-4 p-0 m-0 mt-1"},vc={class:"d-grid gap-2"},fc=["data-bs-target"],yc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},bc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},_c={key:0,class:"ms-2"},wc={class:"m-0 p-0"},kc={key:0,class:"ps-1"},xc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,n=m(()=>ye[e.chargepoint.chargeMode].name),o=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),s=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case fe.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case fe.standby:case fe.stop:c.background="darkgrey",c.color="black";break;case fe.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),v("div",mc,[r("div",vc,[r("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(o.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[r("div",yc,[r("span",bc,[r("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),v("span",_c,S(i(Me)(c.chargepoint.power)),1)):w("",!0)]),r("span",wc,S(c.chargepoint.name),1),r("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(s.value)},[r("i",{class:q(["fa me-1",h.value])},null,2),N(" "+S(n.value)+" ",1),c.chargepoint.chargeMode==i(fe).pv_charging&&i(de).isBatteryConfigured?(l(),v("span",kc,[k[0]||(k[0]=N(" ( ")),r("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=N(") "))])):w("",!0)],4)])],12,fc)]),y(Ea,{"modal-id":t},{title:_(()=>[N(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[y(gc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Sc=R(xc,[["__scopeId","data-v-31df6764"]]),Mc={class:"row p-0 mt-0 mb-1 m-0"},$c={class:"col p-0 m-0"},Pc={class:"container-fluid p-0 m-0"},Cc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Ic={key:0,class:"col time-display"},Bc=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),v("div",Mc,[r("div",$c,[r("div",Pc,[r("div",Cc,[i(g).showClock=="buttonbar"?(l(),v("span",Ic,S(i(La)(i(Jt))),1)):w("",!0),(l(!0),v(U,null,te(i(O),(n,o)=>(l(),P(Sc,{key:o,chargepoint:n,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Vc=R(Bc,[["__scopeId","data-v-791e4be0"]]),Lc={class:"battery-title"},Oc={class:"subgrid pt-1"},Ac=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${Me(-e.bat.power)})`:e.bat.power>0?`Lädt (${Me(e.bat.power)})`:"Bereit"),n=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",Lc,S(o.bat.name),1)]),buttons:_(()=>[y($e,{bgcolor:n.value},{default:_(()=>[N(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[r("div",Oc,[y(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[y(It,{soc:e.bat.soc},null,8,["soc"])]),_:1}),y(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),y(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Tc=R(Ac,[["__scopeId","data-v-f7f825f7"]]),Ec={class:"px-3 subgrid grid-12"},zc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${Me(Q.batOut.power)})`:j.batIn.power>0?`Lädt (${Me(j.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":j.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),n=m(()=>{let o=0;return he.value.forEach(s=>{o+=s.dailyYieldImport}),o});return(o,s)=>i(de).isBatteryConfigured?(l(),P(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>s[0]||(s[0]=[r("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),r("span",null,"Speicher",-1)])),buttons:_(()=>[y($e,{bgcolor:t.value},{default:_(()=>[N(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[r("div",Ec,[y(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[y(It,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),y(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[r("span",null,S(i(ut)(n.value)),1)]),_:1}),y(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[r("span",null,S(i(ut)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),v(U,null,te(i(he),([h,d])=>(l(),P(Tc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(zc,[["__scopeId","data-v-cc4da23c"]]),Wc={class:"devicename"},Dc={class:"subgrid"},Gc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),n=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function o(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function s(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),P(at,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[r("span",Wc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),v(U,null,te(d.device.temp,(p,c)=>(l(),v("span",{key:c},[p<300?(l(),P($e,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[r("span",null,S(i(Fr)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),v("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(n.value),onClick:o},null,6)):w("",!0),e.device.canSwitch?(l(),P($e,{key:1,type:"button",onClick:s},{default:_(()=>[N(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",Dc,[y(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[y(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),y(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),y(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[N(S(i(jr)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),jc=R(Gc,[["__scopeId","data-v-20651ac6"]]),Uc={class:"sh-title py-4"},Fc=["id","onUpdate:modelValue","value"],Nc=["for"],Hc=3,Rc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=Hc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function n(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function o(){s.value=!s.value}const s=ee(!1);return(h,d)=>(l(),v(U,null,[(l(!0),v(U,null,te(e.value,(u,p)=>(l(),P(je,{key:p,"variable-width":!0},{title:_(()=>[r("span",{onClick:o},[d[0]||(d[0]=r("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),r("span",Uc,S(n(p)),1)])]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",onClick:o},d[1]||(d[1]=[r("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),v(U,null,te(u,c=>(l(),P(jc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),s.value?(l(),P(je,{key:0},{title:_(()=>[r("span",{class:"smarthome",onClick:o},d[2]||(d[2]=[r("span",{class:"fas fa-gear"}," ",-1),N(" Einstellungen")]))]),buttons:_(()=>[r("span",{class:"ms-2 pt-1",onClick:o},d[3]||(d[3]=[r("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[y(H,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),v(U,null,te(t.value,(u,p)=>(l(),v("div",{key:p},[ft(r("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Fc),[[Ma,u.showInGraph]]),r("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Nc)]))),128))]),_:1}),r("div",{class:"row p-0 m-0",onClick:o},d[4]||(d[4]=[r("div",{class:"col-12 mb-3 pe-3 mt-0"},[r("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Rc,[["__scopeId","data-v-5b5cf6b3"]]),Jc={class:"countername"},Yc={class:"subgrid pt-1"},qc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),n=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",Jc,S(o.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),P($e,{key:0,bgcolor:n.value},{default:_(()=>[N(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),y($e,{color:"var(--color-bg)"},{default:_(()=>[N(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[r("div",Yc,[y(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[y(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),y(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),y(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Qc=R(qc,[["__scopeId","data-v-01dd8c4d"]]);class Zc{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function Xc(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new Zc(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const Kc=L({__name:"CounterList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),r("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),v(U,null,te(i(ke),(n,o)=>(l(),v("div",{key:o,class:"subgrid pb-2"},[y(Qc,{counter:n},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(Kc,[["__scopeId","data-v-5f059284"]]),eu={class:"vehiclename"},tu={class:"subgrid"},au=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let o="Unterwegs",s=e.vehicle.chargepoint;return s!=null&&(s.isCharging?o="Lädt ("+s.name+")":s.isPluggedIn&&(o="Bereit ("+s.name+")")),o}),n=m(()=>{let o=e.vehicle.chargepoint;return o!=null?o.isLocked?"var(--color-evu)":o.isCharging?"var(--color-charging)":o.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(o,s)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",eu,S(e.vehicle.name),1)]),default:_(()=>[r("div",tu,[y(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[r("span",{style:K({color:n.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),y(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[N(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),y(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[N(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),ru=R(au,[["__scopeId","data-v-9e2cb63e"]]),nu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),r("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),v(U,null,te(Object.values(i(Y)).filter(n=>n.visible),(n,o)=>(l(),v("div",{key:o,class:"subgrid"},[y(ru,{vehicle:n},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(nu,[["__scopeId","data-v-23b437ea"]]),ou={class:"grapharea"},su={id:"pricechart",class:"p-1 m-0 pricefigure"},iu={viewBox:"0 0 400 280"},lu=["id","origin","transform"],rt=380,Gt=250,jt=12,cu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),n={top:0,bottom:15,left:20,right:0},o=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),s=m(()=>o.value.length>1?(rt-n.left-n.right)/o.value.length:0),h=m(()=>{let A=Be(o.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),tt().range([n.left,rt-n.right]).domain(A)}),d=m(()=>{let A=Be(o.value,V=>V[1]);return A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1,A}),u=m(()=>Re().range([Gt-n.bottom,0]).domain(d.value)),p=m(()=>{const A=He(),V=[[n.left,u.value(g.lowerPriceBound)],[rt-n.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=He(),V=[[n.left,u.value(g.upperPriceBound)],[rt-n.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=He(),V=[[n.left,u.value(0)],[rt-n.right,u.value(0)]];return A(V)}),C=m(()=>ht(h.value).ticks(o.value.length).tickSize(5).tickSizeInner(-Gt).tickFormat(A=>A.getHours()%6==0?it("%H:%M")(A):"")),z=m(()=>vt(u.value).ticks(15).tickSize(0).tickSizeInner(-(rt-n.right-n.left)).tickFormat(A=>A.toString())),W=m(()=>{t.value==!0;const A=ue("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(o.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",s.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(C.value);J.attr("transform","translate(0,"+(Gt-n.bottom)+")"),J.selectAll(".tick").attr("font-size",jt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const I=A.append("g").attr("class","axis").call(z.value);I.attr("transform","translate("+n.left+",0)"),I.selectAll(".tick").attr("font-size",jt).attr("color","var(--color-bg)"),I.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),I.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(o.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",s.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+s.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const $=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",jt).attr("fill","var(--color-bg)");return $.append("tspan").attr("x",30).attr("dy","0em").text(x=>it("%H:%M")(x[0])),$.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Ve(()=>{t.value=!t.value}),(A,V)=>(l(),P(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[r("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),r("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),P($e,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[N(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),P($e,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[N(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",ou,[r("figure",su,[(l(),v("svg",iu,[r("g",{id:B.value,origin:W.value,transform:"translate("+n.top+","+n.left+") "},null,8,lu)]))])])]),_:1}))}}),Ut=R(cu,[["__scopeId","data-v-2b0afbac"]]),uu={class:"subgrid pt-1"},du=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(n,o)=>(l(),P(at,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[r("span",{class:"invertername",style:K(t.value)},S(n.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),P($e,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[N(S(i(Me)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[r("div",uu,[y(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),y(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),y(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[y(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),hu=R(du,[["__scopeId","data-v-258d8f17"]]),pu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),P(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[r("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),r("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),P($e,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[N(S(i(Me)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),v(U,null,te(i(we),([n,o])=>(l(),v("div",{key:n,class:"subgrid pb-2"},[y(hu,{inverter:o},null,8,["inverter"])]))),128))]),_:1}))}}),Ft=R(pu,[["__scopeId","data-v-b7a71f81"]]),gu={class:"row py-0 px-0 m-0"},mu=["breakpoints"],vu=L({__name:"CarouselFix",setup(a){let e,t;const n=ee(!1),o=m(()=>n.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,s=>{if(e){let h=s?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Ve(()=>{let s=document.querySelector(".swiper-carousel");s&&(t=s,e=t.swiper)}),(s,h)=>(l(),v("div",gu,[r("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:o.value},[r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item1",{},void 0,!0)],2)]),r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item2",{},void 0,!0)],2)]),r("swiper-slide",null,[r("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(s.$slots,"item3",{},void 0,!0)],2)])],8,mu)]))}}),fu=R(vu,[["__scopeId","data-v-17424929"]]);function yu(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?bu(a,e):a=="openWB/graph/lastlivevaluesJson"?_u(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function bu(a,e){if(!ge.initialized){let t=[];const n=e.toString().split(` +`);n.length>1?t=n.map(h=>JSON.parse(h)):t=[];const o=a.match(/(\d+)$/g),s=o?o[0]:"";s!=""&&typeof ge.rawDataPacks[+s-1]>"u"&&(ge.rawDataPacks[+s-1]=t,ge.initCounter++)}if(ge.initCounter==16){const t=[];ge.unsubscribeRefresh(),ge.initialized=!0,ge.rawDataPacks.forEach(n=>{n.forEach(o=>{const s=za(o);t.push(s)})}),yt(t),ge.subscribeUpdates()}}function _u(a,e){const t=JSON.parse(e),n=za(t);ge.graphRefreshCounter++,yt(f.data.concat(n)),ge.graphRefreshCounter>60&&ge.activate()}function za(a){const e=Object.values(O).length>0?Object.values(O)[0].connectedVehicle:0,t=Object.values(O).length>1?Object.values(O)[1].connectedVehicle:1,n="ev"+e+"-soc",o="ev"+t+"-soc",s={};s.date=+a.timestamp*1e3,+a.grid>0?(s.evuIn=+a.grid,s.evuOut=0):+a.grid<=0?(s.evuIn=0,s.evuOut=-a.grid):(s.evuIn=0,s.evuOut=0),+a["pv-all"]>=0?(s.pv=+a["pv-all"],s.inverter=0):(s.pv=0,s.inverter=-a["pv-all"]),s.house=+a["house-power"],+a["bat-all-power"]>0?(s.batOut=0,s.batIn=+a["bat-all-power"]):+a["bat-all-power"]<0?(s.batOut=-a["bat-all-power"],s.batIn=0):(s.batOut=0,s.batIn=0),a["bat-all-soc"]?s.batSoc=+a["bat-all-soc"]:s.batSoc=0,a[n]&&(s["soc"+e]=+a[n]),a[o]&&(s["soc"+t]=+a[o]),s.charging=+a["charging-all"];for(let h=0;h<10;h++){const d="cp"+h;s[d]=+(a[d+"-power"]??0)}return s.selfUsage=s.pv-s.evuOut,s.selfUsage<0&&(s.selfUsage=0),s.devices=0,s}const wu=["evuIn","pv","batOut","evuOut","charging","house"];let $t=[];function ku(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),$t=[],Xt.forEach(h=>{T.setEnergyPv(h,0),T.setEnergyBat(h,0)});const s=xu(t);yt(s),Kt(o,$t),g.debug&&Mu(t,o,s),f.graphMode=="today"&&setTimeout(()=>ce.activate(),3e5)}function xu(a){const e=[];let t={};return a.forEach(n=>{t=Su(n);const o=t;e.push(o)}),e}function Su(a){const e={};e.date=a.timestamp*1e3,e.evuOut=0,e.evuIn=0,Object.entries(a.counter).forEach(([o,s])=>{s.grid&&(e.evuOut+=s.power_exported,e.evuIn+=s.power_imported,$t.includes(o)||$t.push(o))}),e.evuOut==0&&e.evuIn==0&&Object.entries(a.counter).forEach(o=>{e.evuOut+=o[1].power_exported,e.evuIn+=o[1].power_imported}),Object.entries(a.pv).forEach(([o,s])=>{o!="all"?e[o]=s.power_exported:e.pv=s.power_exported}),Object.entries(a.bat).length>0?(e.batIn=a.bat.all.power_imported,e.batOut=a.bat.all.power_exported,e.batSoc=a.bat.all.soc??0):(e.batIn=0,e.batOut=0,e.batSoc=0),Object.entries(a.cp).forEach(([o,s])=>{o!="all"?(e[o]=s.power_imported,T.keys().includes(o)||T.addItem(o)):e.charging=s.power_imported}),Object.entries(a.ev).forEach(([o,s])=>{o!="all"&&(e["soc"+o.substring(2)]=s.soc)}),e.devices=0;let t=0;return Object.entries(a.sh).forEach(([o,s])=>{var h;o!="all"&&(e[o]=s.power_imported??0,T.keys().includes(o)||(T.addItem(o),T.items[o].showInGraph=ae.get(+o.slice(2)).showInGraph),(h=ae.get(+o.slice(2)))!=null&&h.countAsHouse?t+=e[o]:e.devices+=s.power_imported??0)}),e.selfUsage=Math.max(0,e.pv-e.evuOut),a.hc&&a.hc.all?e.house=a.hc.all.power_imported-t:e.house=e.evuIn+e.batOut+e.pv-e.evuOut-e.charging-e.devices-e.batOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(o=>!wu.includes(o)&&o!="charging").forEach(o=>{Sr(o,e)}):Object.keys(e).forEach(o=>{e[o+"Pv"]=0,e[o+"Bat"]=0}),e}function Mu(a,e,t){console.debug("---------------------------------------- Graph Data -"),console.debug(["--- Incoming graph data:",a]),console.debug(["--- Incoming energy data:",e]),console.debug(["--- Data to be displayed:",t]),console.debug("-----------------------------------------------------")}let kt={};const oa=["charging","house","batIn","devices"],$u=["evuIn","pv","batOut","batIn","evuOut","devices","sh1","sh2","sh3","sh4","sh5","sh6","sh7","sh8","sh9"];let et=[];function Pu(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),et=[],oa.forEach(s=>{T.items[s].energyPv=0,T.items[s].energyBat=0}),t.length>0&&yt(Wa(t)),Kt(o,et)}function Cu(a,e){const{entries:t,names:n,totals:o}=JSON.parse(e);Ne.value=new Map(Object.entries(n)),ra(),et=[],oa.forEach(s=>{T.items[s].energyPv=0,T.items[s].energyBat=0}),t.length>0&&yt(Wa(t)),Kt(o,et)}function Wa(a){const e=[];let t={};return kt={},a.forEach(n=>{t=Iu(n),e.push(t),Object.keys(t).forEach(o=>{o!="date"&&(t[o]<0&&(console.warn(`Negative energy value for ${o} in row ${t.date}. Ignoring the value.`),t[o]=0),kt[o]?kt[o]+=t[o]:kt[o]=t[o])})}),e}function Iu(a){const e={},t=er("%Y%m%d")(a.date);t&&(e.date=f.graphMode=="month"?t.getDate():t.getMonth()+1),e.evuOut=0,e.evuIn=0;let n=0,o=0;return Object.entries(a.counter).forEach(([h,d])=>{n+=d.energy_exported,o+=d.energy_imported,d.grid&&(e.evuOut+=d.energy_exported,e.evuIn+=d.energy_imported,et.includes(h)||et.push(h))}),et.length==0&&(e.evuOut=n,e.evuIn=o),e.pv=a.pv.all.energy_exported,Object.entries(a.bat).length>0?(a.bat.all.energy_imported>=0?e.batIn=a.bat.all.energy_imported:(console.warn("ignoring negative value for batIn on day "+e.date),e.batIn=0),a.bat.all.energy_exported>=0?e.batOut=a.bat.all.energy_exported:(console.warn("ignoring negative value for batOut on day "+e.date),e.batOut=0)):(e.batIn=0,e.batOut=0),Object.entries(a.cp).forEach(([h,d])=>{h!="all"?(T.keys().includes(h)||T.addItem(h),e[h]=d.energy_imported):e.charging=d.energy_imported}),Object.entries(a.ev).forEach(([h,d])=>{h!="all"&&(e["soc-"+h]=d.soc)}),e.devices=Object.entries(a.sh).reduce((h,d)=>(T.keys().includes(d[0])||T.addItem(d[0]),d[1].energy_imported>=0?h+=d[1].energy_imported:console.warn(`Negative energy value for device ${d[0]} in row ${e.date}. Ignoring this value`),h),0),a.hc&&a.hc.all?e.house=a.hc.all.energy_imported:e.house=e.pv+e.evuIn+e.batOut-e.evuOut-e.batIn-e.charging,e.selfUsage=e.pv-e.evuOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(h=>!$u.includes(h)).forEach(h=>{Mr(h,e)}):oa.map(h=>{e[h+"Pv"]=0,e[h+"Bat"]=0}),e}function Bu(a,e){const t=Vu(a);if(t&&!he.value.has(t)){console.warn("Invalid battery index: ",t);return}a=="openWB/bat/config/configured"?de.isBatteryConfigured=e=="true":a=="openWB/bat/get/power"?+e>0?(j.batIn.power=+e,Q.batOut.power=0):(j.batIn.power=0,Q.batOut.power=-e):a=="openWB/bat/get/soc"?de.batterySoc=+e:a=="openWB/bat/get/daily_exported"?Q.batOut.energy=+e:a=="openWB/bat/get/daily_imported"?j.batIn.energy=+e:t&&he.value.has(t)&&(a.match(/^openwb\/bat\/[0-9]+\/get\/daily_exported$/i)?he.value.get(t).dailyYieldExport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/daily_imported$/i)?he.value.get(t).dailyYieldImport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/exported$/i)?he.value.get(t).exported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_state$/i)?he.value.get(t).faultState=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_str$/i)?he.value.get(t).faultStr=e:a.match(/^openwb\/bat\/[0-9]+\/get\/imported$/i)?he.value.get(t).imported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/power$/i)?he.value.get(t).power=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/soc$/i)&&(he.value.get(t).soc=+e))}function Vu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function Lu(a,e){if(a=="openWB/optional/et/provider")JSON.parse(e).type==null?re.active=!1:(re.active=!0,re.etProvider=JSON.parse(e).name);else if(a=="openWB/optional/et/get/prices"){const t=JSON.parse(e);re.etPriceList=new Map,Object.keys(t).forEach(n=>{re.etPriceList.set(new Date(+n*1e3),t[n]*1e5)})}}function Ou(a,e){const t=Da(a);if(t&&!(t in O)){console.warn("Invalid chargepoint id received: "+t);return}if(a=="openWB/chargepoint/get/power"?j.charging.power=+e:a=="openWB/chargepoint/get/daily_imported"&&(j.charging.energy=+e),a=="openWB/chargepoint/get/daily_exported")de.cpDailyExported=+e;else if(t){if(a.match(/^openwb\/chargepoint\/[0-9]+\/config$/i))if(O[t]){const n=JSON.parse(e);O[t].name=n.name,O[t].icon=n.name,ie["cp"+t]?(ie["cp"+t].name=n.name,ie["cp"+t].icon=n.name):ie["cp"+t]={name:n.name,icon:n.name,color:"var(--color-charging)"}}else console.warn("invalid chargepoint index: "+t);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/state_str$/i))O[t].stateStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_str$/i))O[t].faultStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_state$/i))O[t].faultState=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/power$/i))O[t].power=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/daily_imported$/i))O[t].dailyYield=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/plug_state$/i))O[t].isPluggedIn=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/charge_state$/i))O[t].isCharging=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/manual_lock$/i))O[t].updateIsLocked(e=="true");else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/enabled$/i))O[t].isEnabled=e=="1";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/phases_in_use/i))O[t].phasesInUse=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/current/i))O[t].current=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/currents/i))O[t].currents=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/log/i)){const n=JSON.parse(e);O[t].chargedSincePlugged=n.imported_since_plugged}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/soc$/i)){const n=JSON.parse(e);O[t].soc=n.soc,O[t].waitingForSoc=!1,O[t].rangeCharged=n.range_charged,O[t].rangeUnit=n.range_unit}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/info$/i)){const n=JSON.parse(e);O[t].vehicleName=String(n.name),O[t].updateConnectedVehicle(+n.id)}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/config$/i)){const n=JSON.parse(e);switch(n.chargemode){case"instant_charging":O[t].updateChargeMode(fe.instant_charging);break;case"pv_charging":O[t].updateChargeMode(fe.pv_charging);break;case"scheduled_charging":O[t].updateChargeMode(fe.scheduled_charging);break;case"standby":O[t].updateChargeMode(fe.standby);break;case"stop":O[t].updateChargeMode(fe.stop);break}O[t].chargeTemplate=n.charge_template,O[t].averageConsumption=n.average_consumption}}}function Au(a,e){const t=Da(a);if(t!=null){if(!(t in Y)){const n=new fr(t);Y[t]=n}if(a.match(/^openwb\/vehicle\/[0-9]+\/name$/i))Object.values(O).forEach(n=>{n.connectedVehicle==t&&(n.vehicleName=JSON.parse(e))}),Y[t].name=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/soc$/i))Y[t].soc=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/range$/i))isNaN(+e)?Y[t].range=0:Y[t].range=+e;else if(a.match(/^openwb\/vehicle\/[0-9]+\/charge_template$/i))Y[t].updateChargeTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/ev_template$/i))Y[t].updateEvTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/soc_module\/config$/i)){const n=JSON.parse(e);Object.values(O).forEach(o=>{o.connectedVehicle==t&&(o.isSocConfigured=n.type!==null,o.isSocManual=n.type=="manual")})}}}function Tu(a,e){if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const n=+t[0],o=JSON.parse(e);_e[n]=o,Eu(n,o)}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/time_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),n=a.match(/[0-9]+$/i);if(t&&n){const o=+t[0].replace(/[^0-9]+/g,""),s=+n[0],h=JSON.parse(e);o in gt||(gt[o]=[]),gt[o][s]=h}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/chargemode\/scheduled_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),n=a.match(/[0-9]+$/i);if(t&&n){const o=+t[0].replace(/[^0-9]+/g,""),s=+n[0],h=JSON.parse(e);o in pt||(pt[o]=[]),pt[o][s]=h}}else if(a.match(/^openwb\/vehicle\/template\/ev_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const n=+t[0],o=JSON.parse(e);Rt[n]=o}}}function Eu(a,e){Object.values(O).forEach(t=>{t.chargeTemplate==a&&(t.updateCpPriority(e.prio),t.updateInstantChargeLimitMode(e.chargemode.instant_charging.limit.selected),t.updateInstantTargetCurrent(e.chargemode.instant_charging.current),t.updateInstantTargetSoc(e.chargemode.instant_charging.limit.soc),t.updateInstantMaxEnergy(e.chargemode.instant_charging.limit.amount),t.updatePvFeedInLimit(e.chargemode.pv_charging.feed_in_limit),t.updatePvMinCurrent(e.chargemode.pv_charging.min_current),t.updatePvMaxSoc(e.chargemode.pv_charging.max_soc),t.updatePvMinSoc(e.chargemode.pv_charging.min_soc),t.updatePvMinSocCurrent(e.chargemode.pv_charging.min_soc_current))})}function Da(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function zu(a,e){a.match(/^openWB\/LegacySmarthome\/config\//i)?Wu(a,e):a.match(/^openWB\/LegacySmarthome\/Devices\//i)&&Du(a,e)}function Wu(a,e){const t=Ga(a);if(t==null)return;ae.has(t)||qt(t);const n=ae.get(t);a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_configured$/i)?n.configured=e!="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_name$/i)?(n.name=e.toString(),n.icon=e.toString(),ie["sh"+t].name=e.toString(),ie["sh"+t].icon=e.toString()):a.match(/^openWB\/LegacySmarthome\/config\/set\/Devices\/[0-9]+\/mode$/i)?n.isAutomatic=e=="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_canSwitch$/i)?n.canSwitch=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_homeConsumtion$/i)?n.countAsHouse=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_temperatur_configured$/i)&&(n.tempConfigured=+e)}function Du(a,e){const t=Ga(a);if(t==null){console.warn("Smarthome: Missing index in "+a);return}ae.has(t)||qt(t);const n=ae.get(t);if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Watt$/i))n.power=+e,Gu("power");else if(!a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Wh$/i)){if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/RunningTimeToday$/i))n.runningTime=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor0$/i))n.temp[0]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor1$/i))n.temp[1]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor2$/i))n.temp[2]=+e;else if(a.match(/^openWB\/LegacySmartHome\/Devices\/[0-9]+\/Status$/i))switch(+e){case 10:n.status="off";break;case 11:n.status="on";break;case 20:n.status="detection";break;case 30:n.status="timeout";break;default:n.status="off"}}}function Gu(a){switch(a){case"power":j.devices.power=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.power,0);break;case"energy":j.devices.energy=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.energy,0);break;default:console.error("Unknown category")}}function Ga(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Pt=le([]);class sa{constructor(e,t,n,o){b(this,"name");b(this,"children");b(this,"count");b(this,"lastValue");this.name=e,this.children=t,this.count=n,this.lastValue=o}insert(e,t){if(e.length){const n=e.splice(1);if(e[0]==this.name)if(n.length){let o=!1;if(this.children.forEach(s=>{s.name==n[0]&&(s.insert(n,t),o=!0)}),!o){const s=new sa(n[0],[],0,"");s.insert(n,t),this.children.push(s)}}else this.count=this.count+1,this.lastValue=t}}}function ju(a,e){const t=a.split("/");if(t.length){let n=!1;if(Pt.forEach(o=>{o.name==t[0]&&(o.insert(t,e),n=!0)}),!n){const o=new sa(t[0],[],0,"");Pt.push(o),o.insert(t,e)}}}const Uu=["openWB/counter/#","openWB/bat/#","openWB/pv/#","openWB/chargepoint/#","openWB/vehicle/#","openWB/general/chargemode_config/pv_charging/#","openWB/optional/et/#","openWB/system/#","openWB/LegacySmartHome/#","openWB/command/"+Qt()+"/#"];function Fu(){gr(Nu),Uu.forEach(a=>{Ke(a)}),ve()}function Nu(a,e){ju(a,e.toString());const t=e.toString();a.match(/^openwb\/counter\/[0-9]+\//i)?Hu(a,t):a.match(/^openwb\/counter\//i)?Ru(a,t):a.match(/^openwb\/bat\//i)?Bu(a,t):a.match(/^openwb\/pv\//i)?Ju(a,t):a.match(/^openwb\/chargepoint\//i)?Ou(a,t):a.match(/^openwb\/vehicle\/template\//i)?Tu(a,t):a.match(/^openwb\/vehicle\//i)?Au(a,t):a.match(/^openwb\/general\/chargemode_config\/pv_charging\//i)?Yu(a,t):a.match(/^openwb\/graph\//i)?yu(a,t):a.match(/^openwb\/log\/daily\//i)?ku(a,t):a.match(/^openwb\/log\/monthly\//i)?Pu(a,t):a.match(/^openwb\/log\/yearly\//i)?Cu(a,t):a.match(/^openwb\/optional\/et\//i)?Lu(a,t):a.match(/^openwb\/system\//i)?Qu(a,t):a.match(/^openwb\/LegacySmartHome\//i)?zu(a,t):a.match(/^openwb\/command\//i)&&Zu(a,t)}function Hu(a,e){const t=a.split("/"),n=+t[2];if(n==de.evuId?qu(a,e):t[3]=="config",t[3]=="get"&&n in ke)switch(t[4]){case"power":ke[n].power=+e;break;case"config":break;case"fault_str":break;case"fault_state":break;case"power_factors":break;case"imported":break;case"exported":break;case"frequency":break;case"daily_imported":ke[n].energy_imported=+e;break;case"daily_exported":ke[n].energy_exported=+e;break}}function Ru(a,e){if(a.match(/^openwb\/counter\/get\/hierarchy$/i)){const t=JSON.parse(e);if(t.length){br(),rs();for(const n of t)n.type=="counter"&&(de.evuId=n.id);ja(t[0])}}else a.match(/^openwb\/counter\/set\/home_consumption$/i)?j.house.power=+e:a.match(/^openwb\/counter\/set\/daily_yield_home_consumption$/i)&&(j.house.energy=+e)}function ja(a){switch(a.type){case"counter":Xc(a.id,a.type);break;case"cp":yr(a.id);break;case"bat":Aa(a.id);break}a.children.forEach(e=>ja(e))}function Ju(a,e){const t=Xu(a);t&&!we.value.has(t)&&Er(t),a=="openWB/pv/get/power"?Q.pv.power=-e:a=="openWB/pv/get/daily_exported"?Q.pv.energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/power$/i)?we.value.get(t).power=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/daily_exported$/i)?we.value.get(t).energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/monthly_exported$/i)?we.value.get(t).energy_month=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/yearly_exported$/i)?we.value.get(t).energy_year=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/exported$/i)&&(we.value.get(t).energy_total=+e)}function Yu(a,e){const t=a.split("/");if(t.length>0)switch(t[4]){case"bat_mode":de.updatePvBatteryPriority(JSON.parse(e));break}}function qu(a,e){switch(a.split("/")[4]){case"power":+e>0?(Q.evuIn.power=+e,j.evuOut.power=0):(Q.evuIn.power=0,j.evuOut.power=-e);break;case"daily_imported":Q.evuIn.energy=+e;break;case"daily_exported":j.evuOut.energy=+e;break}}function Qu(a,e){if(a.match(/^openWB\/system\/device\/[0-9]+\/component\/[0-9]+\/config$/i)){const t=JSON.parse(e);switch(t.type){case"counter":case"consumption_counter":ke[t.id]&&(ke[t.id].name=t.name);break;case"inverter":case"inverter_secondary":we.value.has(t.id)||we.value.set(t.id,new $a(t.id)),we.value.get(t.id).name=t.name;break;case"bat":he.value.has(t.id)||Aa(t.id),he.value.get(t.id).name=t.name}}}function Zu(a,e){const t=a.split("/");if(a.match(/^openWB\/command\/[a-z]+\/error$/i)&&t[2]==Qt()){const n=JSON.parse(e);console.error(`Error message from openWB: +Command: ${n.command} +Data: JSON.stringify(err.data) +Error: + ${n.error}`)}}function Xu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Ku={key:0,class:"fas fa-caret-down"},ed={key:1,class:"fas fa-caret-right"},td={key:0,class:"content p-2 m-2"},ad={key:1,class:"sublist col-md-9 m-0 p-0 ps-2"},rd=L({__name:"MqttNode",props:{node:{},level:{},hide:{type:Boolean},expandAll:{type:Boolean}},setup(a){const e=a;let t=ee(!e.hide),n=ee(!1);const o=m(()=>e.node.name),s=m(()=>[...e.node.children].sort((c,k)=>c.namee.node.count>0?"("+e.node.count+")":""),d=m(()=>e.node.children.length),u=m(()=>e.node.lastValue!=""?{"font-style":"italic","grid-column-start":e.level,"grid-column-end":-1}:{"grid-column-start":e.level,"grid-column-end":-1});function p(){d.value>0&&(t.value=!t.value),e.node.lastValue!=""&&(n.value=!n.value)}return(c,k)=>{const C=tr("MqttNode",!0);return l(),v(U,null,[r("div",{class:"name py-2 px-2 m-0",style:K(u.value),onClick:p},[(i(t)||e.expandAll)&&d.value>0||i(n)?(l(),v("span",Ku)):(l(),v("span",ed)),N(" "+S(o.value)+S(h.value),1)],4),i(n)?(l(),v("div",td,[r("code",null,S(e.node.lastValue),1)])):w("",!0),(i(t)||e.expandAll)&&d.value>0?(l(),v("div",ad,[(l(!0),v(U,null,te(s.value,(z,W)=>(l(),P(C,{key:W,level:e.level+1,node:z,hide:!0,"expand-all":e.expandAll},null,8,["level","node","expand-all"]))),128))])):w("",!0)],64)}}}),nd=R(rd,[["__scopeId","data-v-df7e578a"]]),od={class:"mqviewer"},sd={class:"row pt-2"},id={class:"col"},ld={key:0,class:"topiclist"},cd=L({__name:"MQTTViewer",setup(a){Ve(()=>{});const e=ee(!1);function t(){e.value=!e.value}const n=m(()=>e.value?"active":"");return(o,s)=>(l(),v("div",od,[r("div",sd,[r("div",id,[s[0]||(s[0]=r("h3",{class:"mqtitle ps-2"},"MQTT Message Viewer",-1)),s[1]||(s[1]=r("hr",null,null,-1)),r("button",{class:q(["btn btn-small btn-outline-primary ms-2",n.value]),onClick:t}," Expand All ",2),s[2]||(s[2]=r("hr",null,null,-1))])]),i(Pt)[0]?(l(),v("div",ld,[(l(!0),v(U,null,te(i(Pt)[0].children.sort((h,d)=>h.name(l(),P(nd,{key:d,node:h,level:1,hide:!0,"expand-all":e.value},null,8,["node","expand-all"]))),128))])):w("",!0)]))}}),ud=R(cd,[["__scopeId","data-v-a349646d"]]),dd=["value"],hd=L({__name:"SelectInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,n=e,o=m({get(){return t.modelValue},set(s){n("update:modelValue",s)}});return(s,h)=>ft((l(),v("select",{id:"selectme","onUpdate:modelValue":h[0]||(h[0]=d=>o.value=d),class:"form-select"},[(l(!0),v(U,null,te(s.options,(d,u)=>(l(),v("option",{key:u,value:d[1]},S(d[0]),9,dd))),128))],512)),[[ar,o.value]])}}),pd=R(hd,[["__scopeId","data-v-5e33ce1f"]]),gd={class:"subgrid m-0 p-0"},md={class:"settingscolumn"},vd={class:"settingscolumn"},fd={class:"settingscolumn"},yd=L({__name:"ThemeSettings",emits:["reset-arcs"],setup(a,{emit:e}){const t=e,n=[["Dunkel","dark"],["Hell","light"],["Blau","blue"]],o=[["3 kW","0"],["3,1 kW","1"],["3,14 kW","2"],["3,141 kW","3"],["3141 W","4"]],s=[["Orange","normal"],["Grün/Violett","standard"],["Bunt","advanced"]],h=[["Aus","off"],["Menü","navbar"],["Buttonleiste","buttonbar"]],d=[["Aus","no"],['"Alles"-Reiter',"infoview"],["Immer","always"]];return(u,p)=>(l(),P(je,{"full-width":!0},{title:_(()=>p[22]||(p[22]=[N(" Look & Feel ")])),buttons:_(()=>p[23]||(p[23]=[r("span",{type:"button",class:"float-end mt-0 ms-1","data-bs-toggle":"collapse","data-bs-target":"#themesettings"},[r("span",null,[r("i",{class:"fa-solid fa-circle-check"})])],-1)])),default:_(()=>[r("div",gd,[r("div",md,[y(H,{fullwidth:!0,title:"Farbschema",icon:"fa-adjust",infotext:"Hintergrundfarbe"},{default:_(()=>[y(We,{modelValue:i(g).displayMode,"onUpdate:modelValue":p[0]||(p[0]=c=>i(g).displayMode=c),options:n},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Farbschema Smart-Home-Geräte",icon:"fa-palette",infotext:"Für die Smart-Home-Geräte stehen mehrere Schemata zur Verfügung."},{default:_(()=>[y(We,{modelValue:i(g).smartHomeColors,"onUpdate:modelValue":p[1]||(p[1]=c=>i(g).smartHomeColors=c),options:s},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Grafik: Raster",icon:"fa-th",infotext:"Verwende ein Hintergrundraster in den Grafiken"},{default:_(()=>[y(se,{modelValue:i(g).showGrid,"onUpdate:modelValue":p[2]||(p[2]=c=>i(g).showGrid=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Variable Bogenlänge",icon:"fa-chart-area",infotext:"Im Graph 'Aktuelle Leistung' können die Bögen immer die volle Länge haben, oder entsprechend des aktuellen Gesamtleistung verkürzt dargestellt werden."},{default:_(()=>[y(se,{modelValue:i(g).showRelativeArcs,"onUpdate:modelValue":p[3]||(p[3]=c=>i(g).showRelativeArcs=c)},null,8,["modelValue"])]),_:1}),i(g).showRelativeArcs?(l(),P(H,{key:0,fullwidth:!0,title:"Bögen zurücksetzen",icon:"fa-undo",infotext:"Durch Click auf den Button wird die Maximallänge der Bögen auf den aktuellen Wert gesetzt."},{default:_(()=>[i(g).showRelativeArcs?(l(),v("button",{key:0,class:"btn btn-secondary",onClick:p[4]||(p[4]=c=>t("reset-arcs"))}," Reset ")):w("",!0)]),_:1})):w("",!0),y(H,{fullwidth:!0,title:"Anzahl Dezimalstellen",icon:"fa-sliders-h",infotext:"Alle kW- und kWh-Werte werden mit der gewählten Anzahl an Stellen angezeigt."},{default:_(()=>[y(pd,{modelValue:i(g).decimalPlaces,"onUpdate:modelValue":p[5]||(p[5]=c=>i(g).decimalPlaces=c),options:o},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Uhrzeit anzeigen",icon:"fa-clock",infotext:"Zeige die aktuelle Uhrzeit an. In der Menüleiste oder neben den Lade-Buttons."},{default:_(()=>[y(We,{modelValue:i(g).showClock,"onUpdate:modelValue":p[6]||(p[6]=c=>i(g).showClock=c),options:h},null,8,["modelValue"])]),_:1})]),r("div",vd,[y(H,{fullwidth:!0,title:"Kompakte Ladepunktliste",icon:"fa-list",infotext:"Zeige eine einzelne Ladepunktliste statt separater Element pro Ladepunkt."},{default:_(()=>[y(We,{modelValue:i(g).shortCpList,"onUpdate:modelValue":p[7]||(p[7]=c=>i(g).shortCpList=c),options:d},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Buttonleiste für Ladepunkte",icon:"fa-window-maximize",infotext:"Informationen zu Ladepunkten über den Diagrammen anzeigen."},{default:_(()=>[y(se,{modelValue:i(g).showButtonBar,"onUpdate:modelValue":p[8]||(p[8]=c=>i(g).showButtonBar=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Filter-Buttons",icon:"fa-filter",infotext:"Hauptseite mit Buttons zur Auswahl der Kategorie."},{default:_(()=>[y(se,{modelValue:i(g).showQuickAccess,"onUpdate:modelValue":p[9]||(p[9]=c=>i(g).showQuickAccess=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Breite Widgets",icon:"fa-desktop",infotext:"Widgets immer breit machen"},{default:_(()=>[y(se,{modelValue:i(g).preferWideBoxes,"onUpdate:modelValue":p[10]||(p[10]=c=>i(g).preferWideBoxes=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Stufenlose Displaybreite",icon:"fa-maximize",infotext:"Die Breite des Displays wird immer voll ausgenutzt. Dies kann in einigen Fällen zu inkorrekter Darstellung führen."},{default:_(()=>[y(se,{modelValue:i(g).fluidDisplay,"onUpdate:modelValue":p[11]||(p[11]=c=>i(g).fluidDisplay=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Animationen",icon:"fa-film",infotext:"Animationen anzeigen"},{default:_(()=>[y(se,{modelValue:i(g).showAnimations,"onUpdate:modelValue":p[12]||(p[12]=c=>i(g).showAnimations=c)},null,8,["modelValue"])]),_:1})]),r("div",fd,[y(H,{fullwidth:!0,title:"Zähler anzeigen",icon:"fa-chart-bar",infotext:"Zeige die Werte zusätzlich angelegter Zähler"},{default:_(()=>[y(se,{modelValue:i(g).showCounters,"onUpdate:modelValue":p[13]||(p[13]=c=>i(g).showCounters=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Fahrzeuge anzeigen",icon:"fa-car",infotext:"Zeige alle Fahrzeuge mit Ladestand und Reichweite"},{default:_(()=>[y(se,{modelValue:i(g).showVehicles,"onUpdate:modelValue":p[14]||(p[14]=c=>i(g).showVehicles=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Standardfahrzeug anzeigen",icon:"fa-car",infotext:"Zeige das Standard-Fahrzeug in der Fahzeugliste"},{default:_(()=>[y(se,{modelValue:i(g).showStandardVehicle,"onUpdate:modelValue":p[15]||(p[15]=c=>i(g).showStandardVehicle=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Preistabelle anzeigen",icon:"fa-car",infotext:"Zeige die Strompreistabelle in einer separaten Box an"},{default:_(()=>[y(se,{modelValue:i(g).showPrices,"onUpdate:modelValue":p[16]||(p[16]=c=>i(g).showPrices=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Untere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der unteren Markierung festlegen"},{default:_(()=>[y(Se,{id:"lowerPriceBound",modelValue:i(g).lowerPriceBound,"onUpdate:modelValue":p[17]||(p[17]=c=>i(g).lowerPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Obere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der oberen Markierung festlegen"},{default:_(()=>[y(Se,{id:"upperPriceBound",modelValue:i(g).upperPriceBound,"onUpdate:modelValue":p[18]||(p[18]=c=>i(g).upperPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Wechselrichter-Details anzeigen",icon:"fa-solar-panel",infotext:"Zeige Details zu den einzelnen Wechselrichtern"},{default:_(()=>[y(se,{modelValue:i(g).showInverters,"onUpdate:modelValue":p[19]||(p[19]=c=>i(g).showInverters=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Alternatives Energie-Widget",icon:"fa-chart-area",infotext:"Horizontale Darstellung der Energie-Werte"},{default:_(()=>[y(se,{modelValue:i(g).alternativeEnergy,"onUpdate:modelValue":p[20]||(p[20]=c=>i(g).alternativeEnergy=c)},null,8,["modelValue"])]),_:1}),y(H,{fullwidth:!0,title:"Debug-Modus",icon:"fa-bug-slash",infotext:"Kontrollausgaben in der Console sowie Anzeige von Bildschirmbreite und MQ-Viewer"},{default:_(()=>[y(se,{modelValue:i(g).debug,"onUpdate:modelValue":p[21]||(p[21]=c=>i(g).debug=c)},null,8,["modelValue"])]),_:1})]),p[24]||(p[24]=r("div",{class:"grid-col-12 mb-3 me-3"},[r("button",{class:"btn btn-sm btn-secondary float-end","data-bs-toggle":"collapse","data-bs-target":"#themesettings"}," Schließen ")],-1))])]),_:1}))}}),bd=R(yd,[["__scopeId","data-v-c277ed25"]]),_d={class:"container-fluid px-2 m-0 theme-colors"},wd={id:"themesettings",class:"collapse"},kd={key:2,class:"row py-0 px-0 m-0"},xd={key:3,class:"row py-0 m-0 d-flex justify-content-center"},Sd={key:4,class:"nav nav-tabs nav-justified mx-1 mt-2",role:"tablist"},Md={key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pricecharttabbed"},$d={key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#vehiclelist"},Pd={key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#batterylist"},Cd={key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#smarthomelist"},Id={key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#counterlist"},Bd={key:5,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#inverterlist"},Vd={key:5,id:"cpContent",class:"tab-content mx-0 pt-1"},Ld={id:"showAll",class:"tab-pane active",role:"tabpanel","aria-labelledby":"showall-tab"},Od={class:"row py-0 m-0 d-flex justify-content-center"},Ad={id:"chargepointlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"chargepoint-tab"},Td={class:"row py-0 m-0 d-flex justify-content-center"},Ed={id:"vehiclelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"vehicle-tab"},zd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Wd={id:"batterylist",class:"tab-pane",role:"tabpanel","aria-labelledby":"battery-tab"},Dd={class:"row py-0 m-0 d-flex justify-content-center"},Gd={id:"smarthomelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"smarthome-tab"},jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Ud={id:"counterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"counter-tab"},Fd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Nd={id:"inverterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"inverter-tab"},Hd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Rd={id:"pricecharttabbed",class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},Jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Yd={key:0,class:"row p-2 mt-5"},qd={class:"col p-2"},Qd={class:"d-flex justify-content-between"},Zd={class:"mx-4"},Xd={key:0},Kd=L({__name:"ColorsTheme",setup(a){const e=ee(!1),t=m(()=>[...ae.values()].filter(h=>h.configured).length>0);function n(){Ba()}function o(){e.value=!e.value}Ve(()=>{n(),window.addEventListener("resize",Br),window.addEventListener("focus",s),Fu()});function s(){document.hasFocus()&&ve(!0)}return(h,d)=>(l(),v(U,null,[r("div",_d,[r("div",wd,[y(bd,{onResetArcs:i(Or)},null,8,["onResetArcs"])]),i(g).showButtonBar?(l(),P(Vc,{key:0})):w("",!0),w("",!0),(l(),v("div",kd,[y(fu,null,rr({item1:_(()=>[y(hn)]),item2:_(()=>[y(mo)]),_:2},[i(g).alternativeEnergy?{name:"item3",fn:_(()=>[y(ps)]),key:"0"}:{name:"item3",fn:_(()=>[y(Go)]),key:"1"}]),1024)])),i(g).showQuickAccess?w("",!0):(l(),v("div",xd,[y(Tt,{id:"1",compact:i(g).shortCpList=="always"},null,8,["compact"]),i(g).showPrices?(l(),P(Ut,{key:0,id:"NoTabs"})):w("",!0),i(g).showVehicles?(l(),P(Dt,{key:1})):w("",!0),y(Et),t.value?(l(),P(zt,{key:2})):w("",!0),i(g).showCounters?(l(),P(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),P(Ft,{key:4})):w("",!0)])),i(g).showQuickAccess?(l(),v("nav",Sd,[d[6]||(d[6]=nr('AllesLadepunkte',2)),i(g).showPrices?(l(),v("a",Md,d[0]||(d[0]=[r("i",{class:"fa-solid fa-lg fa-coins"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Strompreis",-1)]))):w("",!0),i(g).showVehicles?(l(),v("a",$d,d[1]||(d[1]=[r("i",{class:"fa-solid fa-lg fa-car"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Fahrzeuge",-1)]))):w("",!0),i(de).isBatteryConfigured?(l(),v("a",Pd,d[2]||(d[2]=[r("i",{class:"fa-solid fa-lg fa-car-battery"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Speicher",-1)]))):w("",!0),t.value?(l(),v("a",Cd,d[3]||(d[3]=[r("i",{class:"fa-solid fa-lg fa-plug"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Smart Home",-1)]))):w("",!0),i(g).showCounters?(l(),v("a",Id,d[4]||(d[4]=[r("i",{class:"fa-solid fa-lg fa-bolt"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Zähler",-1)]))):w("",!0),i(g).showInverters?(l(),v("a",Bd,d[5]||(d[5]=[r("i",{class:"fa-solid fa-lg fa-solar-panel"},null,-1),r("span",{class:"d-none d-md-inline ms-2"},"Wechselrichter",-1)]))):w("",!0)])):w("",!0),i(g).showQuickAccess?(l(),v("div",Vd,[r("div",Ld,[r("div",Od,[y(Tt,{id:"2",compact:i(g).shortCpList!="no"},null,8,["compact"]),i(g).showPrices?(l(),P(Ut,{key:0,id:"Overview"})):w("",!0),i(g).showVehicles?(l(),P(Dt,{key:1})):w("",!0),y(Et),t.value?(l(),P(zt,{key:2})):w("",!0),i(g).showCounters?(l(),P(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),P(Ft,{key:4})):w("",!0)])]),r("div",Ad,[r("div",Td,[y(Tt,{id:"3",compact:i(g).shortCpList=="always"},null,8,["compact"])])]),r("div",Ed,[i(g).showVehicles?(l(),v("div",zd,[y(Dt)])):w("",!0)]),r("div",Wd,[r("div",Dd,[y(Et)])]),r("div",Gd,[t.value?(l(),v("div",jd,[y(zt)])):w("",!0)]),r("div",Ud,[i(g).showCounters?(l(),v("div",Fd,[y(Wt)])):w("",!0)]),r("div",Nd,[i(g).showInverters?(l(),v("div",Hd,[y(Ft)])):w("",!0)]),r("div",Rd,[i(g).showPrices?(l(),v("div",Jd,[y(Ut,{id:"Tabbed"})])):w("",!0)])])):w("",!0)]),i(g).debug?(l(),v("div",Yd,[r("div",qd,[d[7]||(d[7]=r("hr",null,null,-1)),r("div",Qd,[r("p",Zd,"Screen Width: "+S(i(Mt).x),1),r("button",{class:"btn btn-sm btn-secondary mx-4",onClick:o}," MQ Viewer ")]),e.value?(l(),v("hr",Xd)):w("",!0),e.value?(l(),P(ud,{key:1})):w("",!0)])])):w("",!0)],64))}}),eh=R(Kd,[["__scopeId","data-v-668af4f2"]]),th={class:"navbar navbar-expand-lg px-0 mb-0"},ah={key:0,class:"position-absolute-50 navbar-text ms-4 navbar-time",style:{color:"var(--color-menu)"}},rh=L({__name:"NavigationBar",setup(a){let e;const t=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return Ve(()=>{e=setInterval(()=>{Jt.value=new Date},1e3)}),or(()=>{clearInterval(e)}),(n,o)=>(l(),v(U,null,[r("nav",th,[r("div",{class:q(t.value)},[o[0]||(o[0]=r("a",{href:"/",class:"navbar-brand"},[r("span",null,"openWB")],-1)),i(g).showClock=="navbar"?(l(),v("span",ah,S(i(La)(i(Jt))),1)):w("",!0),o[1]||(o[1]=r("button",{class:"navbar-toggler togglebutton ps-5",type:"button","data-bs-toggle":"collapse","data-bs-target":"#mainNavbar","aria-controls":"mainNavbar","aria-expanded":"false","aria-label":"Toggle navigation"},[r("span",{class:"fa-solid fa-ellipsis-vertical"})],-1)),o[2]||(o[2]=r("div",{id:"mainNavbar",class:"collapse navbar-collapse justify-content-end"},[r("div",{class:"nav navbar-nav"},[r("a",{id:"navStatus",class:"nav-link",href:"../../settings/#/Status"},"Status"),r("div",{class:"nav-item dropdown"},[r("a",{id:"loggingDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[N("Auswertungen "),r("i",{class:"fa-solid fa-caret-down"})]),r("div",{class:"dropdown-menu","aria-labelledby":"loggingDropdown"},[r("a",{href:"../../settings/#/Logging/ChargeLog",class:"dropdown-item"},"Ladeprotokoll"),r("a",{href:"../../settings/#/Logging/Chart",class:"dropdown-item"},"Diagramme")])]),r("div",{class:"nav-item dropdown"},[r("a",{id:"settingsDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[N("Einstellungen "),r("span",{class:"fa-solid fa-caret-down"})]),r("div",{class:"dropdown-menu","aria-labelledby":"settingsDropdown"},[r("a",{id:"navSettings",class:"nav-link",href:"../../settings/index.html"},"openWB"),r("a",{class:"nav-link","data-bs-toggle":"collapse","data-bs-target":"#themesettings","aria-expanded":"false","aria-controls":"themeSettings"},[r("span",null,[N("Look&Feel"),r("span",{class:"fa-solid fa-caret-down"})])])])])])],-1))],2)]),r("div",{class:q(t.value)},o[3]||(o[3]=[r("hr",{class:"m-0 p-0 mb-2"},null,-1)]),2)],64))}}),nh=R(rh,[["__scopeId","data-v-ed619966"]]),oh={id:"app",class:"m-0 p-0"},sh={class:"row p-0 m-0"},ih={class:"col-12 p-0 m-0"},lh=L({__name:"App",setup(a){const e=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return(t,n)=>(l(),v("div",oh,[y(nh),r("div",{class:q(["p-0",e.value])},[r("div",sh,[r("div",ih,[y(eh)])])],2)]))}}),ch=sr(lh);ir();ch.mount("#app"); diff --git a/packages/modules/web_themes/colors/web/index.html b/packages/modules/web_themes/colors/web/index.html index 1cf4e4b5f9..a2c75dc65b 100644 --- a/packages/modules/web_themes/colors/web/index.html +++ b/packages/modules/web_themes/colors/web/index.html @@ -24,7 +24,7 @@ openWB - +