-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathpower-flow-card-plus.js
More file actions
1 lines (1 loc) · 262 KB
/
power-flow-card-plus.js
File metadata and controls
1 lines (1 loc) · 262 KB
1
function e(e,t,i,o){var a,n=arguments.length,r=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r}function t(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var i,o;function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}"function"==typeof SuppressedError&&SuppressedError,function(e){e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none"}(i||(i={})),function(e){e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24"}(o||(o={}));var n=function(e,t,o){var a=t?function(e){switch(e.number_format){case i.comma_decimal:return["en-US","en"];case i.decimal_comma:return["de","es","it"];case i.space_comma:return["fr","sv","cs"];case i.system:return;default:return e.language}}(t):void 0;if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)!==i.none&&!Number.isNaN(Number(e))&&Intl)try{return new Intl.NumberFormat(a,r(e,o)).format(Number(e))}catch(t){return console.error(t),new Intl.NumberFormat(void 0,r(e,o)).format(Number(e))}return"string"==typeof e?e:function(e,t){return void 0===t&&(t=2),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}(e,void 0).toString()+""},r=function(e,t){var i=a({maximumFractionDigits:2},t);if("string"!=typeof e)return i;var o=e.indexOf(".")>-1?e.split(".")[1].length:0;return i.minimumFractionDigits=o,i.maximumFractionDigits=o,i},s=function(e,t,i,o){o=o||{},i=null==i?{}:i;var a=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});return a.detail=i,e.dispatchEvent(a),a};const l=(e,t)=>Number(`${Math.round(Number(`${e}e${t}`))}e-${t}`);function c(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}function d(e,t=0){return c(e)?Number(e):t}const h=(e,t,i,{unit:o,unitWhiteSpace:a,decimals:r,accept_negative:s,watt_threshold:d=1e3})=>{const h=!1===a?"":" ",u=(t?.type??"").includes("energy-flow-card-plus"),p=u?"Wh":"W",_=u?"kWh":"kW";if(null==i||""===i)return`0${h}${o??p}`;if(!c(i))return i.toString();const m=Number(i),y=void 0===o&&m>=d,f=r??(y?t.kw_decimals:t.w_decimals);return`${n((e=>s?e:Math.abs(e))(y?l(m/1e3,f??2):l(m,f??0)),e.locale)}${h}${o||(y?_:p)}`},u=globalThis,p=u.ShadowRoot&&(void 0===u.ShadyCSS||u.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_=Symbol(),m=new WeakMap;let y=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==_)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(p&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=m.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&m.set(t,e))}return e}toString(){return this.cssText}};const f=p?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new y("string"==typeof e?e:e+"",void 0,_))(t)})(e):e,{is:g,defineProperty:v,getOwnPropertyDescriptor:b,getOwnPropertyNames:w,getOwnPropertySymbols:k,getPrototypeOf:$}=Object,x=globalThis,S=x.trustedTypes,E=S?S.emptyScript:"",C=x.reactiveElementPolyfillSupport,A=(e,t)=>e,M={toAttribute(e,t){switch(t){case Boolean:e=e?E:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},P=(e,t)=>!g(e,t),D={attribute:!0,type:String,converter:M,reflect:!1,useDefault:!1,hasChanged:P};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let z=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=D){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&v(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:a}=b(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const n=o?.call(this);a?.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??D}static _$Ei(){if(this.hasOwnProperty(A("elementProperties")))return;const e=$(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(A("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(A("properties"))){const e=this.properties,t=[...w(e),...k(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(f(e))}else void 0!==e&&t.push(f(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(p)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const i of t){const t=document.createElement("style"),o=u.litNonce;void 0!==o&&t.setAttribute("nonce",o),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const a=(void 0!==i.converter?.toAttribute?i.converter:M).toAttribute(t,i.type);this._$Em=e,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:M;this._$Em=o;const n=a.fromAttribute(t,e.type);this[o]=n??this._$Ej?.get(o)??n,this._$Em=null}}requestUpdate(e,t,i,o=!1,a){if(void 0!==e){const n=this.constructor;if(!1===o&&(a=this[e]),i??(i=n.getPropertyOptions(e)),!((i.hasChanged??P)(a,t)||i.useDefault&&i.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:a},n){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,n??t??this[e]),!0!==a||void 0!==n)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[A("elementProperties")]=new Map,z[A("finalized")]=new Map,C?.({ReactiveElement:z}),(x.reactiveElementVersions??(x.reactiveElementVersions=[])).push("2.1.2");const T=globalThis,O=e=>e,N=T.trustedTypes,W=N?N.createPolicy("lit-html",{createHTML:e=>e}):void 0,j="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+B,H=`<${U}>`,L=document,I=()=>L.createComment(""),R=e=>null===e||"object"!=typeof e&&"function"!=typeof e,F=Array.isArray,G="[ \t\n\f\r]",V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,K=/>/g,q=RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,X=/"/g,J=/^(?:script|style|textarea|title)$/i,Q=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),ee=Q(1),te=Q(2),ie=Symbol.for("lit-noChange"),oe=Symbol.for("lit-nothing"),ae=new WeakMap,ne=L.createTreeWalker(L,129);function re(e,t){if(!F(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==W?W.createHTML(t):t}let se=class e{constructor({strings:t,_$litType$:i},o){let a;this.parts=[];let n=0,r=0;const s=t.length-1,l=this.parts,[c,d]=((e,t)=>{const i=e.length-1,o=[];let a,n=2===t?"<svg>":3===t?"<math>":"",r=V;for(let t=0;t<i;t++){const i=e[t];let s,l,c=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)d=r.lastIndex,r===V?"!--"===l[1]?r=Z:void 0!==l[1]?r=K:void 0!==l[2]?(J.test(l[2])&&(a=RegExp("</"+l[2],"g")),r=q):void 0!==l[3]&&(r=q):r===q?">"===l[0]?(r=a??V,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?q:'"'===l[3]?X:Y):r===X||r===Y?r=q:r===Z||r===K?r=V:(r=q,a=void 0);const h=r===q&&e[t+1].startsWith("/>")?" ":"";n+=r===V?i+H:c>=0?(o.push(s),i.slice(0,c)+j+i.slice(c)+B+h):i+B+(-2===c?t:h)}return[re(e,n+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]})(t,i);if(this.el=e.createElement(c,o),ne.currentNode=this.el.content,2===i||3===i){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(a=ne.nextNode())&&l.length<s;){if(1===a.nodeType){if(a.hasAttributes())for(const e of a.getAttributeNames())if(e.endsWith(j)){const t=d[r++],i=a.getAttribute(e).split(B),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:n,name:o[2],strings:i,ctor:"."===o[1]?ue:"?"===o[1]?pe:"@"===o[1]?_e:he}),a.removeAttribute(e)}else e.startsWith(B)&&(l.push({type:6,index:n}),a.removeAttribute(e));if(J.test(a.tagName)){const e=a.textContent.split(B),t=e.length-1;if(t>0){a.textContent=N?N.emptyScript:"";for(let i=0;i<t;i++)a.append(e[i],I()),ne.nextNode(),l.push({type:2,index:++n});a.append(e[t],I())}}}else if(8===a.nodeType)if(a.data===U)l.push({type:2,index:n});else{let e=-1;for(;-1!==(e=a.data.indexOf(B,e+1));)l.push({type:7,index:n}),e+=B.length-1}n++}}static createElement(e,t){const i=L.createElement("template");return i.innerHTML=e,i}};function le(e,t,i=e,o){if(t===ie)return t;let a=void 0!==o?i._$Co?.[o]:i._$Cl;const n=R(t)?void 0:t._$litDirective$;return a?.constructor!==n&&(a?._$AO?.(!1),void 0===n?a=void 0:(a=new n(e),a._$AT(e,i,o)),void 0!==o?(i._$Co??(i._$Co=[]))[o]=a:i._$Cl=a),void 0!==a&&(t=le(e,a._$AS(e,t.values),a,o)),t}let ce=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??L).importNode(t,!0);ne.currentNode=o;let a=ne.nextNode(),n=0,r=0,s=i[0];for(;void 0!==s;){if(n===s.index){let t;2===s.type?t=new de(a,a.nextSibling,this,e):1===s.type?t=new s.ctor(a,s.name,s.strings,this,e):6===s.type&&(t=new me(a,this,e)),this._$AV.push(t),s=i[++r]}n!==s?.index&&(a=ne.nextNode(),n++)}return ne.currentNode=L,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},de=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=oe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=le(this,e,t),R(e)?e===oe||null==e||""===e?(this._$AH!==oe&&this._$AR(),this._$AH=oe):e!==this._$AH&&e!==ie&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>F(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==oe&&R(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=se.createElement(re(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new ce(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=ae.get(e.strings);return void 0===t&&ae.set(e.strings,t=new se(e)),t}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,a=0;for(const n of t)a===i.length?i.push(o=new e(this.O(I()),this.O(I()),this,this.options)):o=i[a],o._$AI(n),a++;a<i.length&&(this._$AR(o&&o._$AB.nextSibling,a),i.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=O(e).nextSibling;O(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}},he=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,a){this.type=1,this._$AH=oe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=oe}_$AI(e,t=this,i,o){const a=this.strings;let n=!1;if(void 0===a)e=le(this,e,t,0),n=!R(e)||e!==this._$AH&&e!==ie,n&&(this._$AH=e);else{const o=e;let r,s;for(e=a[0],r=0;r<a.length-1;r++)s=le(this,o[i+r],t,r),s===ie&&(s=this._$AH[r]),n||(n=!R(s)||s!==this._$AH[r]),s===oe?e=oe:e!==oe&&(e+=(s??"")+a[r+1]),this._$AH[r]=s}n&&!o&&this.j(e)}j(e){e===oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ue=class extends he{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===oe?void 0:e}},pe=class extends he{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==oe)}},_e=class extends he{constructor(e,t,i,o,a){super(e,t,i,o,a),this.type=5}_$AI(e,t=this){if((e=le(this,e,t,0)??oe)===ie)return;const i=this._$AH,o=e===oe&&i!==oe||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==oe&&(i===oe||o);o&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},me=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){le(this,e)}};const ye=T.litHtmlPolyfillSupport;ye?.(se,de),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.3.2");const fe=globalThis;let ge=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let a=o._$litPart$;if(void 0===a){const e=i?.renderBefore??null;o._$litPart$=a=new de(t.insertBefore(I(),e),e,void 0,i??{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ie}};ge._$litElement$=!0,ge.finalized=!0,fe.litElementHydrateSupport?.({LitElement:ge});const ve=fe.litElementPolyfillSupport;ve?.({LitElement:ge}),(fe.litElementVersions??(fe.litElementVersions=[])).push("4.2.2");const be=e=>!0!==e.disable_dots&&("undefined"==typeof document||"hidden"!==document.visibilityState),we=(e,t)=>{const i=(e=>{const t=JSON.parse(JSON.stringify(e)).filter(e=>e?.has);return t})(e);return i?.[t]??void 0},ke=e=>we(e,1),$e=e=>we(e,2),xe=e=>we(e,3),Se=e=>!!$e(e)||!!xe(e),Ee=e=>!!ke(e)||!!xe(e),Ce=(e,t)=>t>0||"hide"!==e?.display_zero_lines?.mode,Ae=(e,t)=>{if(e>0)return"";const i=t?.display_zero_lines?.mode;if("show"===i||void 0===i)return"";let o="";if("transparency"===i||"custom"===i){const e=t?.display_zero_lines?.transparency;(e??1)&&(o+="transparency ")}return"grey_out"!==i&&"custom"!==i||(o+="grey"),o},Me=1;let Pe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const De=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Pe{constructor(e){if(super(e),e.type!==Me||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const o=!!t[e];o===this.st.has(e)||this.nt?.has(e)||(o?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return ie}}),ze=(e,{battery:t,grid:i,individual:o,newDur:a})=>i.has&&t.has&&Ce(e,Math.max(i.state.toBattery||0,t.state.toGrid||0))?ee`<div class="lines ${De({high:t.has||Ee(o),"individual1-individual2":!t.has&&o.every(e=>e?.has),"multi-individual":Se(o)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="battery-grid-flow"><path id="battery-grid" class="${Ae(t.state.toGrid||i.state.toBattery||0,e)}" d="M45,100 v-15 c0,-30 -10,-30 -30,-30 h-20" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toBattery?te`<circle r="1" class="battery-from-grid" vector-effect="non-scaling-stroke"><animateMotion dur="${i.batteryGrid}s" repeatCount="indefinite" keyPoints="1;0" keyTimes="0;1" calcMode="paced"><mpath xlink:href="#battery-grid"></animateMotion></circle>`:oe)(e,i,a)} ${((e,t,i)=>be(e)&&t.state.toGrid?te`<circle r="1" class="battery-to-grid" vector-effect="non-scaling-stroke"><animateMotion dur="${i.batteryGrid}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#battery-grid"></animateMotion></circle>`:oe)(e,t,a)}</svg></div>`:oe,Te=(e,{battery:t,grid:i,individual:o,newDur:a})=>t.has&&Ce(e,t.state.toHome)&&!e.entities.home?.hide?ee`<div class="lines ${De({high:t.has||Ee(o),"individual1-individual2":!t.has&&o.every(e=>e?.has),"multi-individual":Se(o)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="battery-home-flow"><path id="battery-home" class="battery-home ${Ae(t.state.toHome||0,e)}" d="M55,100 v-${i.has?15:17} c0,-30 10,-30 30,-30 h20" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toHome?te`<circle r="1" class="battery-home" vector-effect="non-scaling-stroke"><animateMotion dur="${i.batteryToHome}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#battery-home"></animateMotion></circle>`:oe)(e,t,a)}</svg></div>`:oe,Oe=(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})=>i.has&&Ce(e,i.state.fromGrid)&&!e.entities.home?.hide?ee`<div class="lines ${De({high:t.has||Ee(o),"individual1-individual2":!t.has&&o.every(e=>e?.has),"multi-individual":Se(o)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="grid-home-flow" class="flat-line"><path class="grid ${Ae(i.state.toHome||0,e)}" id="grid" d="M0,${t.has?50:a.has?56:53} H100" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toHome?te`<circle r="1" class="grid" vector-effect="non-scaling-stroke"><animateMotion dur="${i.gridToHome}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#grid"></animateMotion></circle>`:oe)(e,i,n)}</svg></div>`:oe,Ne=(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})=>i.hasReturnToGrid&&a.has&&Ce(e,a.state.toGrid||0)?ee`<div class="lines ${De({high:t.has||Ee(o),"individual1-individual2":!t.has&&o.every(e=>e?.has),"multi-individual":Se(o)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="solar-grid-flow"><path id="return" class="return ${Ae(a.state.toGrid||0,e)}" d="M${t.has?45:47},0 v15 c0,${t.has?"30 -10,30 -30,30":"35 -10,35 -30,35"} h-20" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toGrid&&t.has?te`<circle r="1" class="return" vector-effect="non-scaling-stroke"><animateMotion dur="${i.solarToGrid}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#return"></animateMotion></circle>`:oe)(e,a,n)}</svg></div>`:oe,We=(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})=>a.has&&Ce(e,a.state.toHome||0)&&!e.entities.home?.hide?ee`<div class="lines ${De({high:t.has||Ee(o),"individual1-individual2":!t.has&&o.every(e=>e?.has),"multi-individual":Se(o)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="solar-home-flow"><path id="solar" class="solar ${Ae(a.state.toHome||0,e)}" d="M${t.has?55:53},0 v${i.has?15:17} c0,${t.has?"30 10,30 30,30":"35 10,35 30,35"} h25" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toHome?te`<circle r="1" class="solar" vector-effect="non-scaling-stroke"><animateMotion dur="${i.solarToHome}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#solar"></animateMotion></circle>`:oe)(e,a,n)}</svg></div>`:oe,je=(e,{battery:t,individual:i,solar:o,newDur:a})=>t.has&&o.has&&Ce(e,o.state.toBattery||0)?ee`<div class="lines ${De({high:t.has||Ee(i),"individual1-individual2":!t.has&&i.every(e=>e?.has),"multi-individual":Se(i)})}"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" id="solar-battery-flow" class="flat-line"><path id="battery-solar" class="battery-solar ${Ae(o.state.toBattery||0,e)}" d="M50,0 V100" vector-effect="non-scaling-stroke"></path>${((e,t,i)=>be(e)&&t.state.toBattery?te`<circle r="1" class="battery-solar" vector-effect="non-scaling-stroke"><animateMotion dur="${i.solarToBattery}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#battery-solar"></animateMotion></circle>`:oe)(e,o,a)}</svg></div>`:oe,Be=["unavailable","unknown"],Ue=({main:e,className:t,template:i,value:o,entityId:a,icon:n,actions:r})=>o&&Be.includes(o)?oe:o||i?ee`<span class="secondary-info ${t}" @click="${t=>{t.stopPropagation(),e.onEntityClick(t,r,a)}}" @dblclick="${t=>{t.stopPropagation(),e.onEntityDoubleClick(t,r,a)}}" @pointerdown="${t=>{t.stopPropagation(),e.onEntityPointerDown(t,r,a)}}" @pointerup="${t=>{t.stopPropagation(),e.onEntityPointerUp(t)}}" @pointercancel="${t=>{t.stopPropagation(),e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&(t.stopPropagation(),e.openDetails(t,r,a,"tap"))}}">${n?ee`<ha-icon class="secondary-info small" .icon="${n}"></ha-icon>`:oe} ${i??o}</span>`:oe,He=(e,t,i,o,a,n)=>a?.secondary?.has||a?.secondary?.template?Ue({main:t,className:n,entityId:a.secondary.entity,icon:a.secondary.icon,value:h(e,i,a.secondary.state,{unit:a.secondary.unit,unitWhiteSpace:a.secondary.unit_white_space,decimals:a.secondary.decimals,accept_negative:a.secondary.accept_negative,watt_threshold:i.watt_threshold}),actions:{tap_action:a.secondary.tap_action,hold_action:a.secondary.hold_action,double_tap_action:a.secondary.double_tap_action},template:o[`${n}Secondary`]}):oe,Le=(e,t,i)=>{const o=e.use_new_flow_rate_model??!0?((e,t)=>{const i=e.max_expected_power,o=e.min_expected_power;return((e,t,i,o,a)=>e>a?i:(e-o)*(i-t)/(a-o)+t)(t,e.max_flow_rate,e.min_flow_rate,o,i)})(e,t):((e,t,i)=>{const o=e.min_flow_rate,a=e.max_flow_rate;return a-t/(i>0?i:t>0?t:1)*(a-o)})(e,t,i);return Number.isFinite(o)?o:e.max_flow_rate},Ie=(e,t)=>!1!==e&&t?t:"number"==typeof e?e:1.66,Re=ee`<div class="spacer"></div>`,Fe=(e,t,i,o,a,n,r)=>{const s=o.individual[n],l=a?.secondary?.has?h(e,i,a?.secondary?.state,{unit:a?.secondary?.unit||void 0,unitWhiteSpace:a.secondary.unit_white_space,decimals:a?.secondary?.decimals||0,accept_negative:a?.secondary?.accept_negative||!1,watt_threshold:i.watt_threshold}):void 0;return(()=>{if(s)return!0;if(!0===a?.secondary?.displayZero)return!0;if(!a?.secondary?.state)return!1;if(!c(a?.secondary?.state))return!0;const e=a?.secondary?.displayZeroTolerance??0;return Number(a.secondary.state)>=e||a.secondary.accept_negative&&"number"==typeof Number(+a.secondary.state)})()?Ue({main:t,className:r,entityId:a?.field?.secondary_info?.entity||a?.secondary.entity||void 0,icon:a?.secondary?.icon||void 0,value:l,template:o.individual[n]||void 0,actions:{tap_action:a?.field?.secondary_info?.tap_action||a?.secondary?.tap_action,hold_action:a?.field?.secondary_info?.hold_action||a?.secondary?.hold_action,double_tap_action:a?.field?.secondary_info?.double_tap_action||a?.secondary?.double_tap_action}}):oe},Ge=e=>e?.split("|").map(e=>e.trim()),Ve=e=>Ge(e).at(0)??"",Ze=(e,t)=>{const i=Ge(t);for(const t of i)if(!c(e.states[t]?.state))return!1;return i.length>0};let Ke={name:"Unknown Card",version:"0.0.0",readme:"https://github.com/flixlix/"};const qe=function(e,t,i){var o;return void 0===i&&(i=!1),function(){var a=[].slice.call(arguments),n=this,r=i&&!o;clearTimeout(o),o=setTimeout(function(){o=null,i||e.apply(n,a)},t),r&&e.apply(n,a)}}(e=>{console.log(`%c⚡ ${Ke.name} v${Ke.version} %cError: ${e}`,"color: #488fc2; font-weight: bold","color: #b33a3a; font-weight: normal")},6e4),Ye=e=>{qe(`Entity "${e??"Unknown"}" is not available or misconfigured`)},Xe=(e,t)=>{if(!t||!Ze(e,t))return Ye(t),null;const i=Ge(t);let o,a=0;for(const t of i){const i=e.states[t];i&&(o=d(i.state),a+=o)}return a},Je=["K","M","G","T","P","E","Z","Y"],Qe=(e,t)=>{const i=Xe(e,t);if(!t||null===i)return 0;const o=e.states[Ve(t)];if(!o)return 0;const a=o.attributes.unit_of_measurement??"";return et(i,a)},et=(e,t)=>{const i=t.toUpperCase().slice(0,1),o=Je.indexOf(i);return o>-1?e*Math.pow(1e3,o+1):e},tt=(e,t,i,o,a)=>{const n=(t.type??"").includes("energy-flow-card-plus")?"Wh":"W",r=t.entities.fossil_fuel_percentage?.unit_white_space??!0,s="percentage"===t.entities.fossil_fuel_percentage?.state_type?"%":n,l=t.entities.fossil_fuel_percentage?.display_zero_tolerance??0;if(a){const{nonFossilEnergy:i,nonFossilPercentage:c}=((e,t)=>{const i=1e3*Object.values(e).reduce((e,t)=>e+t,0),o=Math.max(t-i,0);return{nonFossilEnergy:o,nonFossilPercentage:t>0?o/t*100:0}})(a,o);if(s===n){let o=i;return l&&o<l&&(o=0),h(e,t,o,{unitWhiteSpace:r,watt_threshold:t.watt_threshold})}let d=c;return l&&d<l&&(d=0),h(e,t,d,{unit:"%",unitWhiteSpace:r,decimals:0,watt_threshold:t.watt_threshold})}if(!i||!Ze(e,i))return Ye(i),"NaN";const c=1-(Xe(e,i)??0)/100;let d;if(d="string"==typeof t.entities.grid?.entity?o:Qe(e,t.entities.grid?.entity.consumption)||0,s===n){let i=d*c;return l&&i<l&&(i=0),h(e,t,i,{unitWhiteSpace:r,watt_threshold:t.watt_threshold})}let u=100-(Xe(e,i)??0);return l&&u<l&&(u=0),h(e,t,u,{unit:"%",unitWhiteSpace:r,decimals:0,watt_threshold:t.watt_threshold})},it=238.76104,ot=async(e,t,i,o)=>{((e,t,i,o)=>{o=o||{},i=null==i?{}:i;const a=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});a.detail=i,e.dispatchEvent(a)})(e,"hass-action",{config:i,action:o})},at=(e,t)=>!!e.entities[t]?.invert_state,nt=e=>Math.abs(Math.min(e,0)),rt=e=>Math.max(e,0),st=(e,t,i)=>{const o=t.entities?.[i]?.secondary_info?.entity;if("string"!=typeof o)return null;const a=e.states[Ve(o)];if(!a)return null;const n=a.state;return c(n)?Number(n):n},lt=(e,t,i)=>{const o=t.entities[i]?.entity;if(void 0===o)return null;if("string"==typeof o){const a=Qe(e,o);return at(t,i)?rt(a):nt(a)}return Qe(e,o.production)},ct=(e,t,i)=>{const o=t.entities[i]?.entity;if(void 0===o)return null;if("string"==typeof o){const a=Qe(e,o);return at(t,i)?nt(a):rt(a)}return Qe(e,o.consumption)},dt=(e,t)=>{const i=t.entities.battery?.state_of_charge;return void 0===i?null:Xe(e,i)},ht=(e,t)=>lt(e,t,"battery"),ut=(e,t)=>ct(e,t,"battery"),pt=(e,t)=>ct(e,t,"grid"),_t=(e,t)=>st(e,t,"grid"),mt=(e,t)=>st(e,t,"home"),yt=(e,t)=>{if(t&&Ze(e,t))return e.states[Ve(t)];Ye(t)},ft=(e,t,i)=>t?.icon?t.icon:t?.use_metadata?"string"==typeof t?.entity?yt(e,t?.entity)?.attributes?.icon||i:yt(e,t?.entity?.consumption)?.attributes?.icon||yt(e,t?.entity?.production)?.attributes?.icon||i:i,gt=(e,t,i)=>t?.name?t.name:t?.use_metadata?"string"==typeof t?.entity?yt(e,t.entity)?.attributes?.friendly_name||i:yt(e,t?.entity?.consumption)?.attributes?.friendly_name||yt(e,t?.entity?.production)?.attributes?.friendly_name||i:i,vt=(e,t)=>{if("string"!=typeof t?.entity)return null;const i=yt(e,t?.secondary_info?.entity),o=i?.state;return c(o)?Number(o):o},bt=(e,t)=>!!e&&e>=t,wt=(e,t)=>e?t?bt(e,t)?e:0:e:0,kt={field:void 0,entity:"",has:!1,state:null,displayZero:!1,displayZeroTolerance:0,icon:"",name:"",color:null,unit:void 0,unit_white_space:!1,invertAnimation:!1,showDirection:!1,secondary:{entity:null,template:null,has:!1,state:null,icon:null,unit:null,unit_white_space:!1,displayZero:!1,accept_negative:!1,displayZeroTolerance:0,decimals:null}},$t=(e,t)=>{if(!t||!t?.entity)return kt;const i=t.entity,o=((e,t)=>{const i=t?.entity;if(void 0===i)return null;const o=Qe(e,i);return Math.abs(o)})(e,t),a=t?.display_zero||!1,n=t?.display_zero_tolerance||0,r=((e,t,i)=>!!e||!!bt(t,i))(a,o,n),s=o&&o<0,l=t?.inverted_animation||!1,c=s?!l:l;let d=null;var h;return t?.color&&"string"==typeof t?.color?d=t.color:t?.color&&"object"==typeof t?.color&&(d=(h=t.color)?"#".concat(h.map(e=>e.toString(16).padStart(2,"0")).join("")):""),{field:t,entity:i,has:r,state:o,displayZero:a,displayZeroTolerance:n,icon:ft(e,t,"mdi:flash"),name:gt(e,t,"Individual"),color:d,unit:t?.unit_of_measurement,unit_white_space:!1!==t?.unit_white_space,decimals:t?.decimals,invertAnimation:c,showDirection:t?.show_direction||!1,secondary:{entity:t?.secondary_info?.entity||null,template:t?.secondary_info?.template||null,has:void 0!==t?.secondary_info?.entity,state:vt(e,t)||null,accept_negative:t?.secondary_info?.accept_negative||!1,icon:t?.secondary_info?.icon||null,unit:t?.secondary_info?.unit_of_measurement||null,unit_white_space:!1!==t?.secondary_info?.unit_white_space,displayZero:t?.secondary_info?.display_zero||!1,displayZeroTolerance:t?.secondary_info?.display_zero_tolerance||0,decimals:t?.secondary_info?.decimals||null,tap_action:t?.secondary_info?.tap_action,hold_action:t?.secondary_info?.hold_action,double_tap_action:t?.secondary_info?.double_tap_action}}},xt=(e,t)=>{const i=t.entities.fossil_fuel_percentage,o=i?.entity,a=i?.display_zero,n=pt(e,t);return void 0!==o&&(!0===a||null!==n&&1*n-(Xe(e,o)??0)/100>0)},St=(e,t)=>{const i=t.entities.fossil_fuel_percentage,o=i?.entity,a=i?.display_zero,n=pt(e,t);return void 0!==o&&(!0===a||null!==n&&(!1!==xt(e,t)&&1*n-(Xe(e,o)??0)/100>0))},Et=(e,t)=>st(e,t,"fossil_fuel_percentage"),Ct=(e,t)=>{const i=t.entities.solar?.entity,o=t.entities.solar?.secondary_info?.entity;if(void 0===i)return null;const a=Qe(e,i),n=o?Math.max(Qe(e,o),0):0,r=t.entities.solar?.secondary_info?.sum_total,s=r?a+n:a;return at(t,"solar")?nt(s):rt(s)},At=(e,t)=>st(e,t,"solar"),Mt=(e,t)=>e in t,Pt=(e,t,i)=>{let o="var(--primary-text-color)";return"string"==typeof e&&Mt(e,t)&&(o=t[e]?.color??o),!0===e&&Mt(i,t)&&(o=t[i]?.color??o),o},Dt=e=>e?"#".concat(e.map(e=>e.toString(16).padStart(2,"0")).join("")):"",zt=((e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new y(i,e,_)})`:host{--size-circle-entity:79.99px;--mdc-icon-size:24px;--clickable-cursor:pointer;--individual-left-bottom-color:#d0cc5b;--individual-left-top-color:#964cb5;--individual-right-top-color:#b54c9d;--individual-right-bottom-color:#5bd0cc;--non-fossil-color:var(--energy-non-fossil-color, #0f9d58);--icon-non-fossil-color:var(--non-fossil-color, #0f9d58);--icon-solar-color:var(--energy-solar-color, #ff9800);--icon-individual-bottom-color:var(--individual-left-bottom-color, #d0cc5b);--icon-individual-top-color:var(--individual-left-top-color, #964cb5);--icon-grid-color:var(--energy-grid-consumption-color, #488fc2);--icon-battery-color:var(--energy-battery-in-color, #f06292);--icon-home-color:var(--energy-grid-consumption-color, #488fc2);--text-solar-color:var(--primary-text-color);--text-non-fossil-color:var(--primary-text-color);--text-individual-bottom-color:var(--primary-text-color);--text-individual-top-color:var(--primary-text-color);--text-home-color:var(--primary-text-color);--secondary-text-individual-bottom-color:var(--primary-text-color);--secondary-text-individual-top-color:var(--primary-text-color);--text-battery-state-of-charge-color:var(--primary-text-color);--cirlce-grid-color:var(--energy-grid-consumption-color, #488fc2);--circle-battery-color:var(--energy-battery-in-color, #f06292);--battery-grid-line:var(--energy-grid-return-color, #8353d1);--secondary-text-solar-color:var(--primary-text-color);--secondary-text-grid-color:var(--primary-text-color);--secondary-text-home-color:var(--primary-text-color);--secondary-text-non-fossil-color:var(--primary-text-color);--lines-svg-not-flat-line-height:106%;--lines-svg-not-flat-line-top:-2%;--lines-svg-flat-width:calc(100% - 160px);--lines-svg-not-flat-width:calc(103% - 165px);--lines-svg-not-flat-multi-indiv-height:104%;--lines-svg-not-flat-multi-indiv-width:calc(103% - var(--size-circle-entity) * 3.7);--lines-svg-not-flat-multi-indiv-width:calc(((106% - 165px) * 0.5));--lines-svg-not-flat-multi-indiv-width:calc(((130% - 246px) * 0.5));--lines-svg-not-flat-multi-indiv-right-indiv-width:calc(((130% - 210px) * 0.5));--lines-svg-not-flat-multi-indiv-right-indiv-height:103%;--lines-svg-flat-multi-indiv-width:calc((129% - 242px) * 0.5);--lines-svg-flat-left:0;--lines-svg-not-flat-left:0;--dot-size:3.5px;--transparency:var(--transparency-unused-lines);--greyed-out--line-color:#bdbdbd;--text-grid-consumption-color:var(--energy-grid-consumption-color);--text-grid-return-color:var(--energy-grid-return-color);--text-battery-in-color:var(--energy-battery-in-color);--text-battery-out-color:var(--energy-battery-out-color);--home-circle-animation:rotate-in 0.6s ease-in}ha-card{overflow:hidden}ha-card.full-size{height:100%}.card-content.full-size{transform:scale(2) translateY(30%)}.card-content{position:relative;margin:0 auto}.circle{width:80px;height:80px;border-radius:50%;box-sizing:border-box;border:2px solid;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;font-size:12px;line-height:12px;position:relative;text-decoration:none;color:var(--primary-text-color);gap:2px;overflow:hidden}.circle>ha-ripple{position:absolute;inset:0;border-radius:50%;pointer-events:none;z-index:0}.circle>:not(ha-ripple){position:relative;z-index:1}.card-content,.row{max-width:470px}.lines{position:absolute;bottom:0;left:var(--size-circle-entity);width:100%;height:146px;display:flex;justify-content:flex-start;padding:0 16px 16px;box-sizing:border-box;pointer-events:none}:dir(rtl) .lines{justify-content:flex-end}.lines:not(.multi-individual) svg.flat-line{left:var(--lines-svg-flat-left)}.lines:not(.multi-individual) svg:not(.flat-line){left:var(--lines-svg-not-flat-left)}.lines:has(svg:not(.flat-line)){margin-left:-1%}.lines.individual-bottom-individual-top{bottom:110px}.lines.high{bottom:100px;height:156px}.lines svg{width:var(--lines-svg-flat-width);height:100%;max-width:340px;position:relative}.lines svg:not(.flat-line){width:var(--lines-svg-not-flat-width);height:var(--lines-svg-not-flat-line-height);top:var(--lines-svg-not-flat-line-top)}.multi-individual{left:calc(var(--size-circle-entity) + 2%);margin-left:-2.2%!important}.multi-individual svg{width:var(--lines-svg-flat-multi-indiv-width)}.multi-individual svg:not(.flat-line){width:var(--lines-svg-not-flat-multi-indiv-width);margin-top:1px;height:var(--lines-svg-not-flat-multi-indiv-height)}.row{display:flex;justify-content:space-between;max-width:500px;margin:0 auto}.circle-container{display:flex;flex-direction:column;align-items:center}.circle-container.solar{height:130px}.circle-container.individual-top{height:130px}.circle-container.individual-bottom{justify-content:flex-end}.circle-container.individual-bottom.bottom{position:relative;top:-20px;margin-bottom:-20px}.circle-container.battery{height:110px;justify-content:flex-end}.spacer{width:var(--size-circle-entity)}.circle-container .circle{cursor:var(--clickable-cursor)}#battery-grid{stroke:var(--battery-grid-line)}ha-icon{display:inline;padding-bottom:2px}ha-icon.small{--mdc-icon-size:12px}.label{color:var(--secondary-text-color);font-size:12px;max-width:80px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;min-height:20px}.card-content.no-labels .label{display:none}.card-content.no-labels .circle-container.individual-top,.card-content.no-labels .circle-container.low-carbon,.card-content.no-labels .circle-container.solar{height:110px!important}.card-content.no-labels .lines,.card-content.no-labels .right-individual-flow-container{transform:translateY(20px)}line,path{stroke:var(--disabled-text-color);stroke-width:1;fill:none}path.transparency{opacity:calc(calc(100 - var(--transparency))/ 100)}path.grey{stroke:var(--greyed-out--line-color)!important}.circle svg{position:absolute;fill:none;stroke-width:4px;width:100%;height:100%;top:0;left:0}span.secondary-info{color:var(--primary-text-color);font-size:12px;max-width:60px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.individual-top circle,.individual-top path{stroke:var(--individual-left-top-color)}#individual-left-bottom-icon{color:var(--icon-individual-left-bottom-color)}#individual-left-top-icon{color:var(--icon-individual-left-top-color)}#individual-right-bottom-icon{color:var(--icon-individual-right-bottom-color)}#individual-right-top-icon{color:var(--icon-individual-right-top-color)}#solar-icon{color:var(--icon-solar-color)}circle.individual-top{stroke-width:4;width:var(--dot-size);fill:var(--individual-left-top-color)}circle.individual-bottom{stroke-width:4;width:var(--dot-size);fill:var(--individual-left-bottom-color)}.individual-top .circle{border-color:var(--individual-left-top-color)}.individual-bottom circle,.individual-bottom path{stroke:var(--individual-left-bottom-color)}.individual-bottom .circle{border-color:var(--individual-left-bottom-color)}.individual-right-top .circle{border-color:var(--individual-right-top-color)}circle.individual-right-top .circle{fill:var(--individual-right-top-color)}.individual-right-top circle,.individual-right-top path{stroke:var(--individual-right-top-color)}.individual-right-bottom .circle{border-color:var(--individual-right-bottom-color)}circle.individual-right-bottom .circle{fill:var(--individual-right-bottom-color)}.individual-right-bottom circle,.individual-right-bottom path{stroke:var(--individual-right-bottom-color)}.right-individual-flow-container{position:absolute;right:calc(var(--size-circle-entity) - 27% * 1.1 + 6px);width:100%;display:flex;justify-content:flex-end;height:156px;bottom:100px;padding:0 16px 16px;margin-right:-1.2%;box-sizing:border-box;pointer-events:none}.right-individual-flow-container>svg{width:var(--lines-svg-not-flat-multi-indiv-right-indiv-width)}.right-individual-flow{height:var(--lines-svg-not-flat-multi-indiv-right-indiv-height);margin-top:2px;width:var(--lines-svg-not-flat-multi-indiv-width);top:var(--lines-svg-not-flat-line-top);max-width:340px;position:relative}.circle-container.low-carbon{height:130px}.low-carbon path{stroke:var(--non-fossil-color)}.low-carbon .circle{border-color:var(--non-fossil-color)}.low-carbon ha-icon:not(.small){color:var(--icon-non-fossil-color)}circle.low-carbon{stroke-width:4;fill:var(--non-fossil-color);stroke:var(--non-fossil-color)}.solar{color:var(--primary-text-color)}.solar .circle{border-color:var(--energy-solar-color)}.solar ha-icon:not(.small){color:var(--icon-solar-color)}circle.solar,path.solar{stroke:var(--energy-solar-color)}circle.solar{stroke-width:4;fill:var(--energy-solar-color)}.battery .circle{border-color:var(--circle-battery-color)}circle.battery,path.battery{stroke:var(--energy-battery-out-color)}circle.battery-home,path.battery-home{stroke:var(--energy-battery-out-color)}circle.battery-home{stroke-width:4;fill:var(--energy-battery-out-color)}circle.battery-solar,path.battery-solar{stroke:var(--energy-battery-in-color)}circle.battery-solar{stroke-width:4;fill:var(--energy-battery-in-color)}.battery-in{color:var(--energy-battery-in-color)}.battery-out{color:var(--energy-battery-out-color)}span.battery-in{color:var(--text-battery-in-color)}span.battery-out{color:var(--text-battery-out-color)}path.battery-from-grid{stroke:var(--energy-grid-consumption-color)}path.battery-to-grid{stroke:var(--battery-grid-line)}.battery ha-icon:not(.small){color:var(--icon-battery-color)}circle.battery-to-grid,circle.return,path.return{stroke:var(--energy-grid-return-color)}circle.battery-to-grid,circle.return{stroke-width:4;fill:var(--energy-grid-return-color)}.return{color:var(--energy-grid-return-color)}span.return{color:var(--text-grid-return-color)}.grid .circle{border-color:var(--circle-grid-color)}.consumption{color:var(--energy-grid-consumption-color)}span.consumption{color:var(--text-grid-consumption-color)}circle.battery-from-grid,circle.grid,path.grid{stroke:var(--energy-grid-consumption-color)}circle.battery-from-grid,circle.grid{stroke-width:4;fill:var(--energy-grid-consumption-color)}.grid ha-icon:not(.small){color:var(--icon-grid-color)}.home .circle{border-width:0;border-color:var(--primary-color)}.home .circle.border{border-width:2px}.home ha-icon:not(.small){color:var(--icon-home-color)}.circle svg circle{animation:var(--home-circle-animation);transition:stroke-dashoffset .4s,stroke-dasharray .4s;fill:none}span.solar{color:var(--text-solar-color)}span.low-carbon{color:var(--text-non-fossil-color)}span.low-carbon.secondary-info{color:var(--secondary-text-non-fossil-color)}#home-circle{color:var(--text-home-color);z-index:2}.individual-bottom .circle{color:var(--text-individual-bottom-color)}.individual-top .circle{color:var(--text-individual-top-color)}.individual-bottom span.secondary-info{color:var(--secondary-text-individual-bottom-color)}.individual-top span.secondary-info{color:var(--secondary-text-individual-top-color)}span.secondary-info.left-top{color:var(--secondary-text-individual-left-top-color)}span.individual-left-top{color:var(--text-individual-left-top-color)}span.secondary-info.left-bottom{color:var(--secondary-text-individual-left-bottom-color)}span.individual-left-bottom{color:var(--text-individual-left-bottom-color)}span.secondary-info.right-top{color:var(--secondary-text-individual-right-top-color)}span.individual-right-top{color:var(--text-individual-right-top-color)}span.secondary-info.right-bottom{color:var(--secondary-text-individual-right-bottom-color)}span.individual-right-bottom{color:var(--text-individual-right-bottom-color)}.solar span.secondary-info{color:var(--secondary-text-solar-color)}.grid span.secondary-info{color:var(--secondary-text-grid-color)}.home span.secondary-info{color:var(--secondary-text-home-color)}#battery-state-of-charge-text{color:var(--text-battery-state-of-charge-color)}@keyframes rotate-in{from{stroke-dashoffset:238.76104;stroke-dasharray:238.76104}}.card-actions{display:flex;justify-content:space-between;align-items:center}.card-actions a{text-decoration:none}.home-circle-sections{pointer-events:none}.pointer-events-none{pointer-events:none}`;const Tt={maxFlowRate:6,minFlowRate:.75,wattDecimals:0,kilowattDecimals:1,minExpectedPower:.01,maxExpectedPower:2e3,wattThreshold:1e3,transparencyZeroLines:0,displayZeroLines:{mode:"show",transparency:50,grey_color:[189,189,189]}};const Ot=window,Nt=Ot.ShadowRoot&&(void 0===Ot.ShadyCSS||Ot.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),jt=new WeakMap;let Bt=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Nt&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=jt.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&jt.set(t,e))}return e}toString(){return this.cssText}};const Ut=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new Bt(i,e,Wt)},Ht=Nt?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new Bt("string"==typeof e?e:e+"",void 0,Wt))(t)})(e):e;var Lt;const It=window,Rt=It.trustedTypes,Ft=Rt?Rt.emptyScript:"",Gt=It.reactiveElementPolyfillSupport,Vt={toAttribute(e,t){switch(t){case Boolean:e=e?Ft:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},Zt=(e,t)=>t!==e&&(t==t||e==e),Kt={attribute:!0,type:String,converter:Vt,reflect:!1,hasChanged:Zt},qt="finalized";let Yt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const o=this._$Ep(i,t);void 0!==o&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,t=Kt){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,t);void 0!==o&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(o){const a=this[e];this[t]=o,this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Kt}static finalize(){if(this.hasOwnProperty(qt))return!1;this[qt]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(Ht(e))}else void 0!==e&&t.push(Ht(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach(e=>e(this))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{Nt?e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(t=>{const i=document.createElement("style"),o=Ot.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=t.cssText,e.appendChild(i)})})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=Kt){var o;const a=this.constructor._$Ep(e,i);if(void 0!==a&&!0===i.reflect){const n=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:Vt).toAttribute(t,i.type);this._$El=e,null==n?this.removeAttribute(a):this.setAttribute(a,n),this._$El=null}}_$AK(e,t){var i;const o=this.constructor,a=o._$Ev.get(e);if(void 0!==a&&this._$El!==a){const e=o.getPropertyOptions(a),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:Vt;this._$El=a,this[a]=n.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let o=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Zt)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((e,t)=>this[t]=e),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};var Xt;Yt[qt]=!0,Yt.elementProperties=new Map,Yt.elementStyles=[],Yt.shadowRootOptions={mode:"open"},null==Gt||Gt({ReactiveElement:Yt}),(null!==(Lt=It.reactiveElementVersions)&&void 0!==Lt?Lt:It.reactiveElementVersions=[]).push("1.6.3");const Jt=window,Qt=Jt.trustedTypes,ei=Qt?Qt.createPolicy("lit-html",{createHTML:e=>e}):void 0,ti="$lit$",ii=`lit$${(Math.random()+"").slice(9)}$`,oi="?"+ii,ai=`<${oi}>`,ni=document,ri=()=>ni.createComment(""),si=e=>null===e||"object"!=typeof e&&"function"!=typeof e,li=Array.isArray,ci="[ \t\n\f\r]",di=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,hi=/-->/g,ui=/>/g,pi=RegExp(`>|${ci}(?:([^\\s"'>=/]+)(${ci}*=${ci}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_i=/'/g,mi=/"/g,yi=/^(?:script|style|textarea|title)$/i,fi=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),gi=Symbol.for("lit-noChange"),vi=Symbol.for("lit-nothing"),bi=new WeakMap,wi=ni.createTreeWalker(ni,129,null,!1);function ki(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ei?ei.createHTML(t):t}const $i=(e,t)=>{const i=e.length-1,o=[];let a,n=2===t?"<svg>":"",r=di;for(let t=0;t<i;t++){const i=e[t];let s,l,c=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)d=r.lastIndex,r===di?"!--"===l[1]?r=hi:void 0!==l[1]?r=ui:void 0!==l[2]?(yi.test(l[2])&&(a=RegExp("</"+l[2],"g")),r=pi):void 0!==l[3]&&(r=pi):r===pi?">"===l[0]?(r=null!=a?a:di,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?pi:'"'===l[3]?mi:_i):r===mi||r===_i?r=pi:r===hi||r===ui?r=di:(r=pi,a=void 0);const h=r===pi&&e[t+1].startsWith("/>")?" ":"";n+=r===di?i+ai:c>=0?(o.push(s),i.slice(0,c)+ti+i.slice(c)+ii+h):i+ii+(-2===c?(o.push(void 0),t):h)}return[ki(e,n+(e[i]||"<?>")+(2===t?"</svg>":"")),o]};class xi{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let a=0,n=0;const r=e.length-1,s=this.parts,[l,c]=$i(e,t);if(this.el=xi.createElement(l,i),wi.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(o=wi.nextNode())&&s.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const e=[];for(const t of o.getAttributeNames())if(t.endsWith(ti)||t.startsWith(ii)){const i=c[n++];if(e.push(t),void 0!==i){const e=o.getAttribute(i.toLowerCase()+ti).split(ii),t=/([.?@])?(.*)/.exec(i);s.push({type:1,index:a,name:t[2],strings:e,ctor:"."===t[1]?Mi:"?"===t[1]?Di:"@"===t[1]?zi:Ai})}else s.push({type:6,index:a})}for(const t of e)o.removeAttribute(t)}if(yi.test(o.tagName)){const e=o.textContent.split(ii),t=e.length-1;if(t>0){o.textContent=Qt?Qt.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],ri()),wi.nextNode(),s.push({type:2,index:++a});o.append(e[t],ri())}}}else if(8===o.nodeType)if(o.data===oi)s.push({type:2,index:a});else{let e=-1;for(;-1!==(e=o.data.indexOf(ii,e+1));)s.push({type:7,index:a}),e+=ii.length-1}a++}}static createElement(e,t){const i=ni.createElement("template");return i.innerHTML=e,i}}function Si(e,t,i=e,o){var a,n,r,s;if(t===gi)return t;let l=void 0!==o?null===(a=i._$Co)||void 0===a?void 0:a[o]:i._$Cl;const c=si(t)?void 0:t._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===c?l=void 0:(l=new c(e),l._$AT(e,i,o)),void 0!==o?(null!==(r=(s=i)._$Co)&&void 0!==r?r:s._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(t=Si(e,l._$AS(e,t.values),l,o)),t}class Ei{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:i},parts:o}=this._$AD,a=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:ni).importNode(i,!0);wi.currentNode=a;let n=wi.nextNode(),r=0,s=0,l=o[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new Ci(n,n.nextSibling,this,e):1===l.type?t=new l.ctor(n,l.name,l.strings,this,e):6===l.type&&(t=new Ti(n,this,e)),this._$AV.push(t),l=o[++s]}r!==(null==l?void 0:l.index)&&(n=wi.nextNode(),r++)}return wi.currentNode=ni,a}v(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Ci{constructor(e,t,i,o){var a;this.type=2,this._$AH=vi,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cp=null===(a=null==o?void 0:o.isConnected)||void 0===a||a}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Si(this,e,t),si(e)?e===vi||null==e||""===e?(this._$AH!==vi&&this._$AR(),this._$AH=vi):e!==this._$AH&&e!==gi&&this._(e):void 0!==e._$litType$?this.g(e):void 0!==e.nodeType?this.$(e):(e=>li(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==vi&&si(this._$AH)?this._$AA.nextSibling.data=e:this.$(ni.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:o}=e,a="number"==typeof o?this._$AC(e):(void 0===o.el&&(o.el=xi.createElement(ki(o.h,o.h[0]),this.options)),o);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.v(i);else{const e=new Ei(a,this),t=e.u(this.options);e.v(i),this.$(t),this._$AH=e}}_$AC(e){let t=bi.get(e.strings);return void 0===t&&bi.set(e.strings,t=new xi(e)),t}T(e){li(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const a of e)o===t.length?t.push(i=new Ci(this.k(ri()),this.k(ri()),this,this.options)):i=t[o],i._$AI(a),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cp=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class Ai{constructor(e,t,i,o,a){this.type=1,this._$AH=vi,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=vi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,o){const a=this.strings;let n=!1;if(void 0===a)e=Si(this,e,t,0),n=!si(e)||e!==this._$AH&&e!==gi,n&&(this._$AH=e);else{const o=e;let r,s;for(e=a[0],r=0;r<a.length-1;r++)s=Si(this,o[i+r],t,r),s===gi&&(s=this._$AH[r]),n||(n=!si(s)||s!==this._$AH[r]),s===vi?e=vi:e!==vi&&(e+=(null!=s?s:"")+a[r+1]),this._$AH[r]=s}n&&!o&&this.j(e)}j(e){e===vi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class Mi extends Ai{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===vi?void 0:e}}const Pi=Qt?Qt.emptyScript:"";class Di extends Ai{constructor(){super(...arguments),this.type=4}j(e){e&&e!==vi?this.element.setAttribute(this.name,Pi):this.element.removeAttribute(this.name)}}class zi extends Ai{constructor(e,t,i,o,a){super(e,t,i,o,a),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=Si(this,e,t,0))&&void 0!==i?i:vi)===gi)return;const o=this._$AH,a=e===vi&&o!==vi||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,n=e!==vi&&(o===vi||a);a&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}}class Ti{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Si(this,e)}}const Oi={I:Ci},Ni=Jt.litHtmlPolyfillSupport;null==Ni||Ni(xi,Ci),(null!==(Xt=Jt.litHtmlVersions)&&void 0!==Xt?Xt:Jt.litHtmlVersions=[]).push("2.8.0");var Wi,ji;let Bi=class extends Yt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var o,a;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:t;let r=n._$litPart$;if(void 0===r){const e=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:null;n._$litPart$=r=new Ci(t.insertBefore(ri(),e),e,void 0,null!=i?i:{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return gi}};Bi.finalized=!0,Bi._$litElement$=!0,null===(Wi=globalThis.litElementHydrateSupport)||void 0===Wi||Wi.call(globalThis,{LitElement:Bi});const Ui=globalThis.litElementPolyfillSupport;null==Ui||Ui({LitElement:Bi}),(null!==(ji=globalThis.litElementVersions)&&void 0!==ji?ji:globalThis.litElementVersions=[]).push("3.3.3");const Hi=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:o}=t;return{kind:i,elements:o,finisher(t){customElements.define(e,t)}}})(e,t),Li=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function Ii(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):Li(e,t)}function Ri(e){return Ii({...e,state:!0})}function Fi(e,t){return(({finisher:e,descriptor:t})=>(i,o)=>{var a;if(void 0===o){const o=null!==(a=i.originalKey)&&void 0!==a?a:i.key,n=null!=t?{kind:"method",placement:"prototype",key:o,descriptor:t(i.key)}:{...i,key:o};return null!=e&&(n.finisher=function(t){e(t,o)}),n}{const a=i.constructor;void 0!==t&&Object.defineProperty(i,o,t(o)),null==e||e(a,o)}})({descriptor:t=>{const i={get(){var t,i;return null!==(i=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e))&&void 0!==i?i:null},enumerable:!0,configurable:!0};return i}})}var Gi;null===(Gi=window.HTMLSlotElement)||void 0===Gi||Gi.prototype.assignedElements;!function(e){const t=`https://github.com/flixlix/${e.type}`,i=window;var o;i.customCards=i.customCards||[],i.customCards.push({...e,preview:!0,documentationURL:t}),o={name:e.name,version:e.version,readme:t},Ke=o,console.groupCollapsed(`%c⚡ ${Ke.name} v${Ke.version} is installed`,"color: #488fc2; font-weight: bold"),console.log("Readme:",Ke.readme),console.groupEnd()}({type:"power-flow-card-plus",name:"Power Flow Card Plus",description:"An extended version of the power flow card with richer options, advanced features and a few small UI enhancements. Inspired by the Energy Dashboard.",version:"0.3.3"});let Vi=class extends Bi{constructor(){super(...arguments),this._config={},this._templateResults={},this._unsubRenderTemplates=new Map,this._width=0,this.wideEnoughForFourIndividuals=359,this._handleVisibilityChange=()=>{"undefined"!=typeof document&&"visible"===document.visibilityState&&this.requestUpdate()},this.previousDur={},this._pendingTapTimeouts=new WeakMap,this._holdTimeouts=new WeakMap,this._holdTriggered=new WeakMap,this._doubleTapDelay=250,this._holdDelay=500}setConfig(e){if(e.entities.individual1||e.entities.individual2)throw new Error("You are using an outdated configuration. Please update your configuration to the latest version.");if(!e.entities||!e.entities?.battery?.entity&&!e.entities?.grid?.entity&&!e.entities?.solar?.entity)throw new Error("At least one entity for battery, grid or solar must be defined");this._config={...e,kw_decimals:d(e.kw_decimals,Tt.kilowattDecimals),min_flow_rate:d(e.min_flow_rate,Tt.minFlowRate),max_flow_rate:d(e.max_flow_rate,Tt.maxFlowRate),w_decimals:d(e.w_decimals,Tt.wattDecimals),watt_threshold:d(e.watt_threshold,Tt.wattThreshold),max_expected_power:d(e.max_expected_power,Tt.maxExpectedPower),min_expected_power:d(e.min_expected_power,Tt.minExpectedPower),display_zero_lines:{mode:e.display_zero_lines?.mode??Tt.displayZeroLines.mode,transparency:d(e.display_zero_lines?.transparency,Tt.displayZeroLines.transparency),grey_color:e.display_zero_lines?.grey_color??Tt.displayZeroLines.grey_color}}}connectedCallback(){super.connectedCallback(),"undefined"!=typeof document&&document.addEventListener("visibilitychange",this._handleVisibilityChange),this._tryConnectAll()}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=void 0,"undefined"!=typeof document&&document.removeEventListener("visibilitychange",this._handleVisibilityChange),this._tryDisconnectAll(),super.disconnectedCallback()}static async getConfigElement(){return await Promise.resolve().then(function(){return wr}),document.createElement("power-flow-card-plus-editor")}static getStubConfig(e){return function(e){function t(t,i){const o=Ve(t),a=e.states[o]?.attributes.friendly_name;return i.some(e=>o.includes(e)||a?.includes(e))}const i=Object.keys(e.states).filter(t=>{const i=e.states[Ve(t)];return i?.state&&i.attributes&&"power"===i.attributes.device_class||i?.entity_id.includes("power")}),o=["grid","utility","net","meter"],a=["solar","pv","photovoltaic","inverter"],n=["battery"],r=["battery_percent","battery_level","state_of_charge","soc","percentage"],s=i.filter(e=>t(e,o))[0],l=i.filter(e=>t(e,a))[0];return{entities:{battery:{entity:i.filter(e=>t(e,n))[0]??"",state_of_charge:Object.keys(e.states).filter(t=>{const i=e.states[t];return i&&i.state&&i.attributes&&"%"===i.attributes.unit_of_measurement}).filter(e=>t(e,r))[0]??""},grid:s?{entity:s}:void 0,solar:l?{entity:l,display_zero_state:!0}:void 0},clickable_entities:!0,display_zero_lines:!0,use_new_flow_rate_model:!0,w_decimals:Tt.wattDecimals,kw_decimals:Tt.kilowattDecimals,min_flow_rate:Tt.minFlowRate,max_flow_rate:Tt.maxFlowRate,max_expected_power:Tt.maxExpectedPower,min_expected_power:Tt.minExpectedPower,watt_threshold:Tt.wattThreshold,transparency_zero_lines:Tt.transparencyZeroLines,sort_individual_devices:!1}}(e)}getCardSize(){return 3}_normalizeActionConfig(e){if(e)return"tap_action"in e||"hold_action"in e||"double_tap_action"in e?e:{tap_action:{action:"more-info"}}}openDetails(e,t,i,o="tap"){e.stopPropagation();const a=this._normalizeActionConfig(t);if(!!!(a?.tap_action||a?.hold_action||a?.double_tap_action)){if(!i||!this._config.clickable_entities)return;if(!((e,t)=>{const i=Ge(t);for(const t of i)if(!(t in e.states))return!1;return!0})(this.hass,i))return;const e=new CustomEvent("hass-more-info",{composed:!0,detail:{entityId:i}});return void this.dispatchEvent(e)}ot(e.target,this.hass,{entity:i,tap_action:a?.tap_action,hold_action:a?.hold_action,double_tap_action:a?.double_tap_action},o)}onEntityClick(e,t,i){e.stopPropagation();const o=e.currentTarget,a=this._normalizeActionConfig(t);if(o)if(this._holdTriggered.get(o))this._holdTriggered.set(o,!1);else{if(a?.double_tap_action){const t=this._pendingTapTimeouts.get(o);t&&clearTimeout(t);const n=setTimeout(()=>{this.openDetails({stopPropagation:()=>e.stopPropagation(),target:o},a,i,"tap"),this._pendingTapTimeouts.delete(o)},this._doubleTapDelay);return void this._pendingTapTimeouts.set(o,n)}this.openDetails({stopPropagation:()=>e.stopPropagation(),target:o},a,i,"tap")}}onEntityDoubleClick(e,t,i){const o=e.currentTarget,a=this._normalizeActionConfig(t);if(!o)return;const n=this._pendingTapTimeouts.get(o);n&&(clearTimeout(n),this._pendingTapTimeouts.delete(o)),a?.double_tap_action&&this.openDetails({stopPropagation:()=>e.stopPropagation(),target:o},a,i,"double_tap")}onEntityPointerDown(e,t,i){const o=e.currentTarget,a=this._normalizeActionConfig(t);if(!o||!a?.hold_action)return;const n=this._holdTimeouts.get(o);n&&clearTimeout(n),this._holdTriggered.set(o,!1);const r=setTimeout(()=>{this._holdTriggered.set(o,!0),this.openDetails({stopPropagation:()=>e.stopPropagation(),target:o},a,i,"hold"),this._holdTimeouts.delete(o)},this._holdDelay);this._holdTimeouts.set(o,r)}onEntityPointerUp(e){const t=e.currentTarget;if(!t)return;const i=this._holdTimeouts.get(t);i&&(clearTimeout(i),this._holdTimeouts.delete(t))}render(){if(!this._config||!this.hass)return vi;const e=this._renderData??this._computeRenderData(),{entities:t,grid:i,solar:o,battery:a,home:n,nonFossil:r,individualObjs:s,newDur:l,templatesObj:d,homeBatteryCircumference:u,homeGridCircumference:p,homeNonFossilCircumference:_,homeSolarCircumference:m,homeUsageToDisplay:y,individualFieldLeftTop:f,individualFieldLeftBottom:g,individualFieldRightTop:v,individualFieldRightBottom:b}=e,w=e=>e?void 0===e?.state?"":h(this.hass,this._config,e?.state,{decimals:e?.decimals,unit:e?.unit,unitWhiteSpace:e?.unit_white_space,watt_threshold:this._config.watt_threshold}):"";return fi`<ha-card .header="${this._config.title}" class="${this._config.full_size?"full-size":""}" style="${this._config.style_ha_card?this._config.style_ha_card:""}"><div class="card-content ${this._config.full_size?"full-size":""} ${this._config.no_labels?"no-labels":""}" id="power-flow-card-plus" style="${this._config.style_card_content?this._config.style_card_content:""}">${o.has||s?.some(e=>e?.has)||r.hasPercentage?fi`<div class="row">${((e,t,{nonFossil:i,entities:o,templatesObj:a,grid:n,newDur:r,fossilEnergyConsumption:s})=>{const l=!1===t.clickable_entities;return i.hasPercentage?ee`<div class="circle-container low-carbon"><span class="label">${i.name}</span><div class="circle ${l?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,o.fossil_fuel_percentage,o.fossil_fuel_percentage?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,o.fossil_fuel_percentage,o.fossil_fuel_percentage?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,o.fossil_fuel_percentage,o.fossil_fuel_percentage?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,o.fossil_fuel_percentage,o.fossil_fuel_percentage?.entity,"tap")}}"><ha-ripple .disabled="${l}"></ha-ripple>${He(e.hass,e,t,a,i,"nonFossilFuel")} ${" "!==i.icon?ee`<ha-icon id="low-carbon-icon" .icon="${i.icon}"></ha-icon>`:oe} ${!1!==o.fossil_fuel_percentage?.display_zero_state||(i.state.power||0)>(o.fossil_fuel_percentage?.display_zero_tolerance||0)?ee`<span class="low-carbon">${tt(e.hass,t,o.fossil_fuel_percentage.entity,n.state.fromGrid,s)}</span>`:oe}</div>${Ce(t,i.state.power||0)?ee`<svg width="80" height="30"><path d="M40 -10 v40" class="low-carbon ${Ae(i.state.power||0,t)}" id="low-carbon"/>${be(t)&&i.has&&i.state.power>0?te`<circle r="1.75" class="low-carbon" vector-effect="non-scaling-stroke"><animateMotion dur="${Ie(o.fossil_fuel_percentage?.calculate_flow_rate,r.nonFossil)}s" repeatCount="indefinite" calcMode="paced"><mpath xlink:href="#low-carbon"></animateMotion></circle>`:oe}</svg>`:oe}</div>`:Re})(this,this._config,{entities:t,grid:i,newDur:l,nonFossil:r,templatesObj:d})} ${o.has?((e,t,{entities:i,solar:o,templatesObj:a})=>{const n=!1===t.clickable_entities,r=a.solarSecondary,s=i.solar?.secondary_info?.sum_total,l=t.entities.solar?.secondary_info?.entity,d=l?Math.max(Qe(e.hass,l),0):0,u=s?o.state.total-d:o.state.total;return ee`<div class="circle-container solar"><span class="label">${o.name}</span><div class="circle ${n?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,o,o.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,o,o.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,o,o.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,o,o.entity,"tap")}}"><ha-ripple .disabled="${n}"></ha-ripple>${(()=>{if(r)return!0;if(!0===t.entities.solar?.secondary_info?.display_zero)return!0;if(!o?.secondary?.state)return!1;if(!c(o?.secondary?.state))return!0;const e=t.entities.solar?.secondary_info?.display_zero_tolerance??0;return Number(o.secondary.state)>=e||t.entities.solar?.secondary_info?.accept_negative&&"number"==typeof Number(+o.secondary.state)})()?He(e.hass,e,t,a,o,"solar"):oe} ${" "!==o.icon?ee`<ha-icon id="solar-icon" .icon="${o.icon}"></ha-icon>`:oe} ${!1!==i.solar?.display_zero_state||(u||0)>0?ee`<span class="solar">${h(e.hass,t,u,{unit:o.state.unit,unitWhiteSpace:o.state.unit_white_space,decimals:o.state.decimals,watt_threshold:t.watt_threshold})}</span>`:oe}</div></div>`})(this,this._config,{entities:t,solar:o,templatesObj:d}):s?.some(e=>e?.has)?Re:vi} ${f?((e,t,{individualObj:i,templatesObj:o,displayState:a,newDur:n})=>{if(!i)return Re;const r=!1===t.clickable_entities,s=t?.entities?.individual?.findIndex(e=>e.entity===i.entity)||0,l=n.individual[s]||0;return ee`<div class="circle-container individual-top"><span class="label">${i.name}</span><div class="circle ${r?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,i?.field,i?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i?.field,i?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i?.field,i?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i?.field,i?.entity,"tap")}}"><ha-ripple .disabled="${r}"></ha-ripple>${Fe(e.hass,e,t,o,i,s,"left-top")} ${" "!==i.icon?ee`<ha-icon id="individual-left-top-icon" .icon="${i.icon}"></ha-icon>`:oe} ${!1!==i?.field?.display_zero_state||(i.state||0)>(i.displayZeroTolerance??0)?ee`<span class="individual-top individual-left-top">${i?.showDirection?ee`<ha-icon class="small" .icon="${i.invertAnimation?"mdi:arrow-down":"mdi:arrow-up"}"></ha-icon>`:oe}${a}</span>`:oe}</div>${Ce(t,i.state||0)&&!t.entities.home?.hide?ee`<svg width="80" height="30"><path d="M40 -10 v50" id="individual-top" class="${Ae(i.state||0,t)}"/>${be(t)&&i.state&&i.state>=(i.displayZeroTolerance??0)?te`<circle r="1.75" class="individual-top" vector-effect="non-scaling-stroke"><animateMotion dur="${Ie(i?.field?.calculate_flow_rate,l)}s" repeatCount="indefinite" calcMode="paced" keyPoints="${i.invertAnimation?"0;1":"1;0"}" keyTimes="0;1"><mpath xlink:href="#individual-top"></animateMotion></circle>`:oe}</svg>`:oe}</div>`})(this,this._config,{individualObj:f,displayState:w(f),newDur:l,templatesObj:d}):Re} ${Se(s)?((e,t,{individualObj:i,templatesObj:o,displayState:a,newDur:n,battery:r,individualObjs:s})=>{if(!i)return Re;const l=!1===t.clickable_entities,c=t?.entities?.individual?.findIndex(e=>e.entity===i.entity);if(-1===c||void 0===c)return Re;const d=n.individual[c]||1.66,h=!!r?.has||Ee(s);return ee`<div class="circle-container individual-top individual-right individual-right-top"><span class="label">${i.name}</span><div class="circle ${l?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,i?.field,i?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i?.field,i?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i?.field,i?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i?.field,i?.entity,"tap")}}"><ha-ripple .disabled="${l}"></ha-ripple>${Fe(e.hass,e,t,o,i,c,"right-top")} ${" "!==i.icon?ee`<ha-icon id="individual-right-top-icon" .icon="${i.icon}"></ha-icon>`:oe} ${!1!==i?.field?.display_zero_state||(i.state||0)>(i.displayZeroTolerance??0)?ee`<span class="individual-top individual-right-top">${i?.showDirection?ee`<ha-icon class="small" .icon="${i.invertAnimation?"mdi:arrow-down":"mdi:arrow-up"}"></ha-icon>`:oe}${a}</span>`:oe}</div>${Ce(t,i.state||0)&&!t.entities.home?.hide?ee`<div class="right-individual-flow-container"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" class="right-individual-flow"><path id="individual-top-right-home" class="${Ae(i.state||0,t)}" d="M${h?45:47},0 v15 c0,${h?"30 -10,30 -30,30":"35 -10,35 -30,35"} h-20" vector-effect="non-scaling-stroke"/>${be(t)&&i.state&&i.state>=(i.displayZeroTolerance??0)?te`<circle r="1" class="individual-top" vector-effect="non-scaling-stroke"><animateMotion dur="${Ie(i?.field?.calculate_flow_rate,d)}s" repeatCount="indefinite" calcMode="paced" keyPoints="${i.invertAnimation?"0;1":"1;0"}" keyTimes="0;1"><mpath xlink:href="#individual-top-right-home"></animateMotion></circle>`:oe}</svg></div>`:oe}</div>`})(this,this._config,{displayState:w(v),individualObj:v,newDur:l,templatesObj:d,battery:a,individualObjs:s}):vi}</div>`:vi}<div class="row">${i.has?((e,t,{entities:i,grid:o,templatesObj:a})=>{const n=!1===t.clickable_entities;return ee`<div class="circle-container grid"><div class="circle ${n?"pointer-events-none":""}" @click="${t=>{const a=o.powerOutage?.entityGenerator??i.grid?.power_outage?.entity,n=o.powerOutage?.isOutage&&a?a:"string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityClick(t,o,n)}}" @dblclick="${t=>{const a=o.powerOutage?.entityGenerator??i.grid?.power_outage?.entity,n=o.powerOutage?.isOutage&&a?a:"string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityDoubleClick(t,o,n)}}" @pointerdown="${t=>{const a=o.powerOutage?.entityGenerator??i.grid?.power_outage?.entity,n=o.powerOutage?.isOutage&&a?a:"string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityPointerDown(t,i.grid,n)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const a=o.powerOutage?.entityGenerator??i.grid?.power_outage?.entity,n=o.powerOutage?.isOutage&&a?a:"string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.openDetails(t,i.grid,n,"tap")}}}"><ha-ripple .disabled="${n}"></ha-ripple>${He(e.hass,e,t,a,o,"grid")} ${" "!==o.icon?ee`<ha-icon id="grid-icon" .icon="${o.icon}"></ha-icon>`:oe} ${("two_way"===i.grid?.display_state||void 0===i.grid?.display_state||"one_way_no_zero"===i.grid?.display_state&&(o.state.toGrid??0)>0||"one_way"===i.grid?.display_state&&(null===o.state.fromGrid||0===o.state.fromGrid)&&0!==o.state.toGrid)&&null!==o.state.toGrid&&!o.powerOutage.isOutage?ee`<span class="return" @click="${t=>{const a="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.production;e.onEntityClick(t,o,a)}}" @dblclick="${t=>{const a="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.production;e.onEntityDoubleClick(t,o,a)}}" @pointerdown="${t=>{const o="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.production;e.onEntityPointerDown(t,i.grid,o)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const o="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.production;e.openDetails(t,i.grid,o,"tap")}}}"><ha-icon class="small" .icon="${"mdi:arrow-left"}"></ha-icon>${h(e.hass,t,o.state.toGrid,{unit:o.unit,unitWhiteSpace:o.unit_white_space,decimals:o.decimals,watt_threshold:t.watt_threshold})}</span>`:oe} ${("two_way"===i.grid?.display_state||void 0===i.grid?.display_state||"one_way_no_zero"===i.grid?.display_state&&o.state.fromGrid>0||"one_way"===i.grid?.display_state&&(null===o.state.toGrid||0===o.state.toGrid))&&null!==o.state.fromGrid&&!o.powerOutage.isOutage||o.powerOutage.isOutage&&o.powerOutage.entityGenerator?ee`<span class="consumption" @click="${t=>{const a="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityClick(t,o,a)}}" @dblclick="${t=>{const a="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityDoubleClick(t,o,a)}}" @pointerdown="${t=>{const o="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.onEntityPointerDown(t,i.grid,o)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const o="string"==typeof i.grid.entity?i.grid.entity:i.grid.entity.consumption;e.openDetails(t,i.grid,o,"tap")}}}"><ha-icon class="small" .icon="${"mdi:arrow-right"}"></ha-icon>${h(e.hass,t,o.state.fromGrid,{unit:o.unit,unitWhiteSpace:o.unit_white_space,decimals:o.decimals,watt_threshold:t.watt_threshold})}</span>`:oe} ${o.powerOutage?.isOutage&&!o.powerOutage?.entityGenerator?ee`<span class="grid power-outage">${o.powerOutage.name}</span>`:oe}</div><span class="label">${o.name}</span></div>`})(this,this._config,{entities:t,grid:i,templatesObj:d}):Re} ${Re} ${t.home?.hide?Re:((e,t,{home:i,entities:o,templatesObj:a,homeUsageToDisplay:n,homeSolarCircumference:r,CIRCLE_CIRCUMFERENCE:s,homeBatteryCircumference:l,homeNonFossilCircumference:c,homeGridCircumference:d,individual:h})=>{const u=h.filter(e=>e.has).length<=1,p=void 0!==o.home?.entity,_=["none",void 0],m=!_.includes(o.home?.tap_action?.action)||!_.includes(o.home?.hold_action?.action)||!_.includes(o.home?.double_tap_action?.action),y=p||m,f=!1===t.clickable_entities||!y;return ee`<div class="circle-container home"><div class="circle ${f?"pointer-events-none":""}" id="home-circle" @click="${t=>{e.onEntityClick(t,o.home,o.home?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,o.home,o.home?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,o.home,o.home?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,o.home,o.home?.entity,"tap")}}"><ha-ripple .disabled="${f}"></ha-ripple>${He(e.hass,e,t,a,i,"home")} ${" "!==i.icon?ee`<ha-icon id="home-icon" .icon="${i.icon}"></ha-icon>`:oe} ${n} <svg class="home-circle-sections">${void 0!==r?te`<circle class="solar" cx="40" cy="40" r="38" stroke-dasharray="${r} ${s-r}" shape-rendering="geometricPrecision" stroke-dashoffset="-${s-r}">`:oe} ${l?te`<circle class="battery" cx="40" cy="40" r="38" stroke-dasharray="${l} ${s-l}" stroke-dashoffset="-${s-l-(r||0)}" shape-rendering="geometricPrecision">`:oe} ${void 0!==c?te`<circle class="low-carbon" cx="40" cy="40" r="38" stroke-dasharray="${c} ${s-c}" stroke-dashoffset="-${s-c-(l||0)-(r||0)}" shape-rendering="geometricPrecision">`:oe}<circle class="grid" cx="40" cy="40" r="38" stroke-dasharray="${d??s-r-(l||0)} ${void 0!==d?s-d:r+(l||0)}" stroke-dashoffset="0" shape-rendering="geometricPrecision"/></svg></div>${u?ee`<span class="label">${i.name}</span>`:ee`<span class="label"></span>`}</div>`})(this,this._config,{CIRCLE_CIRCUMFERENCE:it,entities:t,home:n,homeBatteryCircumference:u,homeGridCircumference:p,homeNonFossilCircumference:_,homeSolarCircumference:m,templatesObj:d,homeUsageToDisplay:y,individual:s})} ${Se(s)?Re:vi}</div>${a.has||Ee(s)?fi`<div class="row">${Re} ${a.has?((e,t,{battery:i,entities:o})=>{const a=!1===t.clickable_entities;return ee`<div class="circle-container battery"><div class="circle ${a?"pointer-events-none":""}" @click="${t=>{const a=o.battery?.state_of_charge?o.battery?.state_of_charge:"string"==typeof o.battery?.entity?o.battery?.entity:o.battery?.entity.production;e.onEntityClick(t,i,a)}}" @dblclick="${t=>{const a=o.battery?.state_of_charge?o.battery?.state_of_charge:"string"==typeof o.battery?.entity?o.battery?.entity:o.battery?.entity.production;e.onEntityDoubleClick(t,i,a)}}" @pointerdown="${t=>{const a=o.battery?.state_of_charge?o.battery?.state_of_charge:"string"==typeof o.battery?.entity?o.battery?.entity:o.battery?.entity.production;e.onEntityPointerDown(t,i,a)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const a=o.battery?.state_of_charge?o.battery?.state_of_charge:"string"==typeof o.battery?.entity?o.battery.entity:o.battery?.entity.production;e.openDetails(t,i,a,"tap")}}}"><ha-ripple .disabled="${a}"></ha-ripple>${null!==i.state_of_charge.state&&!1!==o.battery?.show_state_of_charge?ee`<span @click="${t=>{e.onEntityClick(t,i,o.battery?.state_of_charge)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i,o.battery?.state_of_charge)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i,o.battery?.state_of_charge)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i,o.battery?.state_of_charge,"tap")}}" id="battery-state-of-charge-text">${h(e.hass,t,i.state_of_charge.state,{unit:i.state_of_charge.unit??"%",unitWhiteSpace:i.state_of_charge.unit_white_space,decimals:i.state_of_charge.decimals,accept_negative:!0,watt_threshold:t.watt_threshold})}</span>`:oe} ${" "!==i.icon?ee`<ha-icon id="battery-icon" .icon="${i.icon}" @click="${t=>{e.onEntityClick(t,i,o.battery?.state_of_charge)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i,o.battery?.state_of_charge)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i,o.battery?.state_of_charge)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i,o.battery?.state_of_charge,"tap")}}"></ha-icon>`:oe} ${"two_way"===o.battery?.display_state||void 0===o.battery?.display_state||"one_way_no_zero"===o.battery?.display_state&&i.state.toBattery>0||"one_way"===o.battery?.display_state&&0!==i.state.toBattery?ee`<span class="battery-in" @click="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.production;e.onEntityClick(t,o.battery,i)}}" @dblclick="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.production;e.onEntityDoubleClick(t,o.battery,i)}}" @pointerdown="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.production;e.onEntityPointerDown(t,o.battery,i)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.production;e.openDetails(t,o.battery,i,"tap")}}}"><ha-icon class="small" .icon="${"mdi:arrow-down"}"></ha-icon>${h(e.hass,t,i.state.toBattery,{unit:i.unit,unitWhiteSpace:i.unit_white_space,decimals:i.decimals,watt_threshold:t.watt_threshold})}</span>`:oe} ${"two_way"===o.battery?.display_state||void 0===o.battery?.display_state||"one_way_no_zero"===o.battery?.display_state&&i.state.fromBattery>0||"one_way"===o.battery?.display_state&&(0===i.state.toBattery||0!==i.state.fromBattery)?ee`<span class="battery-out" @click="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.consumption;e.onEntityClick(t,o.battery,i)}}" @dblclick="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.consumption;e.onEntityDoubleClick(t,o.battery,i)}}" @pointerdown="${t=>{const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.consumption;e.onEntityPointerDown(t,o.battery,i)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{if("Enter"===t.key){const i="string"==typeof o.battery.entity?o.battery.entity:o.battery.entity.consumption;e.openDetails(t,o.battery,i,"tap")}}}"><ha-icon class="small" .icon="${"mdi:arrow-up"}"></ha-icon>${h(e.hass,t,i.state.fromBattery,{unit:i.unit,unitWhiteSpace:i.unit_white_space,decimals:i.decimals,watt_threshold:t.watt_threshold})}</span>`:oe}</div><span class="label">${i.name}</span></div>`})(this,this._config,{battery:a,entities:t}):Re} ${g?((e,t,{individualObj:i,templatesObj:o,displayState:a,newDur:n})=>{if(!i)return Re;const r=!1===t.clickable_entities,s=t?.entities?.individual?.findIndex(e=>e.entity===i.entity)||0,l=n.individual[s]||0;return ee`<div class="circle-container individual-bottom bottom">${Ce(t,i?.state||0)&&!t.entities.home?.hide?ee`<svg width="80" height="30"><path d="M40 40 v-40" id="individual-bottom" class="${Ae(i?.state||0,t)}"/>${be(t)&&i?.state&&i.state>=(i.displayZeroTolerance??0)?te`<circle r="1.75" class="individual-bottom" vector-effect="non-scaling-stroke"><animateMotion dur="${Ie(!1!==i.field?.calculate_flow_rate,l)}s" repeatCount="indefinite" calcMode="paced" keyPoints="${i.invertAnimation?"0;1":"1;0"}" keyTimes="0;1"><mpath xlink:href="#individual-bottom"></animateMotion></circle>`:oe}</svg>`:ee`<svg width="80" height="30"></svg>`}<div class="circle ${r?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,i?.field,i?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i?.field,i?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i?.field,i?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i?.field,i?.entity,"tap")}}"><ha-ripple .disabled="${r}"></ha-ripple>${Fe(e.hass,e,t,o,i,s,"left-bottom")} ${" "!==i?.icon?ee`<ha-icon id="individual-left-bottom-icon" .icon="${i?.icon}"></ha-icon>`:oe} ${!1!==i?.field?.display_zero_state||(i?.state||0)>(i.displayZeroTolerance??0)?ee`<span class="individual-bottom individual-left-bottom">${i?.showDirection?ee`<ha-icon class="small" .icon="${i?.invertAnimation?"mdi:arrow-up":"mdi:arrow-down"}"></ha-icon>`:oe}${a}</span>`:oe}</div><span class="label">${i?.name}</span></div>`})(this,this._config,{displayState:w(g),individualObj:g,newDur:l,templatesObj:d}):Re} ${Se(s)?((e,t,{individualObj:i,templatesObj:o,displayState:a,newDur:n})=>{if(!i)return Re;const r=!1===t.clickable_entities,s=t?.entities?.individual?.findIndex(e=>e.entity===i.entity);if(-1===s||void 0===s)return Re;const l=n.individual[s]||1.66;return ee`<div class="circle-container individual-bottom individual-right individual-right-bottom"><div class="circle ${r?"pointer-events-none":""}" @click="${t=>{e.onEntityClick(t,i?.field,i?.entity)}}" @dblclick="${t=>{e.onEntityDoubleClick(t,i?.field,i?.entity)}}" @pointerdown="${t=>{e.onEntityPointerDown(t,i?.field,i?.entity)}}" @pointerup="${t=>{e.onEntityPointerUp(t)}}" @pointercancel="${t=>{e.onEntityPointerUp(t)}}" @keyDown="${t=>{"Enter"===t.key&&e.openDetails(t,i?.field,i?.entity,"tap")}}"><ha-ripple .disabled="${r}"></ha-ripple>${Fe(e.hass,e,t,o,i,s,"right-bottom")} ${" "!==i.icon?ee`<ha-icon id="individual-right-bottom-icon" .icon="${i.icon}"></ha-icon>`:oe} ${!1!==i?.field?.display_zero_state||(i.state||0)>(i.displayZeroTolerance??0)?ee`<span class="individual-bottom individual-right-bottom">${i?.showDirection?ee`<ha-icon class="small" .icon="${i.invertAnimation?"mdi:arrow-down":"mdi:arrow-up"}"></ha-icon>`:oe}${a}</span>`:oe}</div><span class="label">${i.name}</span> ${Ce(t,i.state||0)&&!t.entities.home?.hide?ee`<div class="right-individual-flow-container"><svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" class="right-individual-flow"><path id="individual-bottom-right-home" class="${Ae(i.state||0,t)}" d="M45,100 v-15 c0,-30 -10,-30 -30,-30 h-20" vector-effect="non-scaling-stroke"/>${be(t)&&i.state&&i.state>=(i.displayZeroTolerance??0)?te`<circle r="1" class="individual-bottom" vector-effect="non-scaling-stroke"><animateMotion dur="${Ie(i?.field?.calculate_flow_rate,l)}s" repeatCount="indefinite" calcMode="paced" keyPoints="${i.invertAnimation?"0;1":"1;0"}" keyTimes="0;1"><mpath xlink:href="#individual-bottom-right-home"></animateMotion></circle>`:oe}</svg></div>`:oe}</div>`})(this,this._config,{displayState:w(b),individualObj:b,newDur:l,templatesObj:d}):vi}</div>`:Re} ${((e,{battery:t,grid:i,individual:o,solar:a,newDur:n})=>ee`${We(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})} ${Ne(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})} ${je(e,{battery:t,individual:o,solar:a,newDur:n})} ${Oe(e,{battery:t,grid:i,individual:o,solar:a,newDur:n})} ${Te(e,{battery:t,grid:i,individual:o,newDur:n})} ${ze(e,{battery:t,grid:i,individual:o,newDur:n})}`)(this._config,{battery:a,grid:i,individual:s,newDur:l,solar:o})}</div>${k=this._config,$=this.hass,k.dashboard_link||k.second_dashboard_link?ee`<div class="card-actions">${k.dashboard_link?ee`<ha-button appearance="plain" size="small" href="${k.dashboard_link}">${k.dashboard_link_label||$.localize("ui.panel.lovelace.cards.energy.energy_distribution.go_to_energy_dashboard")}</ha-button>`:oe} ${k.second_dashboard_link?ee`<ha-button appearance="plain" size="small" href="${k.second_dashboard_link}">${k.second_dashboard_link_label||$.localize("ui.panel.lovelace.cards.energy.energy_distribution.go_to_energy_dashboard")}</ha-button>`:oe}</div>`:oe}</ha-card>`;var k,$}updated(e){if(super.updated(e),!this._config||!this.hass)return;const t=this.shadowRoot?.querySelector("#power-flow-card-plus");if(t){this._resizeObserver||(this._resizeObserver=new ResizeObserver(e=>{const t=e[0];if(!t)return;const i=Math.round(t.contentRect.width);i!==this._width&&(this._width=i)})),this._resizeObserver.observe(t);const e=Math.round(t.getBoundingClientRect().width);e!==this._width&&(this._width=e)}this._tryConnectAll()}willUpdate(e){super.willUpdate(e),this._config&&this.hass&&(e.has("hass")||e.has("_config")||e.has("_templateResults")||e.has("_width")||void 0===this._renderData)&&(this.style.setProperty("--clickable-cursor",!1!==this._config.clickable_entities?"pointer":"default"),this._renderData=this._computeRenderData())}_computeRenderData(){const{entities:e}=this._config,t=null,i={entity:e.grid?.entity,has:void 0!==e?.grid?.entity,hasReturnToGrid:"string"==typeof e.grid?.entity||!!e.grid?.entity?.production,state:{fromGrid:pt(this.hass,this._config),toGrid:(o=this.hass,a=this._config,lt(o,a,"grid")),toBattery:t,toHome:t},powerOutage:{has:void 0!==e.grid?.power_outage?.entity,isOutage:(e.grid&&this.hass.states[e.grid.power_outage?.entity]?.state)===(e.grid?.power_outage?.state_alert??"on"),icon:e.grid?.power_outage?.icon_alert||"mdi:transmission-tower-off",name:e.grid?.power_outage?.label_alert??fi`Power<br>Outage`,entityGenerator:e.grid?.power_outage?.entity_generator},icon:ft(this.hass,e.grid,"mdi:transmission-tower"),name:gt(this.hass,e.grid,this.hass.localize("ui.panel.lovelace.cards.energy.energy_distribution.grid")),mainEntity:"object"==typeof e.grid?.entity?e.grid.entity.consumption||e.grid.entity.production:e.grid?.entity,color:{fromGrid:e.grid?.color?.consumption,toGrid:e.grid?.color?.production,icon_type:e.grid?.color_icon,circle_type:e.grid?.color_circle},tap_action:e.grid?.tap_action,hold_action:e.grid?.hold_action,double_tap_action:e.grid?.double_tap_action,secondary:{entity:e.grid?.secondary_info?.entity,decimals:e.grid?.secondary_info?.decimals,template:e.grid?.secondary_info?.template,has:void 0!==e.grid?.secondary_info?.entity,state:_t(this.hass,this._config),icon:e.grid?.secondary_info?.icon,unit:e.grid?.secondary_info?.unit_of_measurement,unit_white_space:e.grid?.secondary_info?.unit_white_space,accept_negative:e.grid?.secondary_info?.accept_negative||!1,color:{type:e.grid?.secondary_info?.color_value},tap_action:e.grid?.secondary_info?.tap_action,hold_action:e.grid?.secondary_info?.hold_action,double_tap_action:e.grid?.secondary_info?.double_tap_action}};var o,a;const n=void 0!==e.solar?.entity,r=(Ct(this.hass,this._config)??0)>0,s=!1!==e.solar?.display_zero||r,l={entity:e.solar?.entity,has:n&&s,state:{total:Ct(this.hass,this._config),toHome:t,toGrid:t,toBattery:t},icon:ft(this.hass,e.solar,"mdi:solar-power"),name:gt(this.hass,e.solar,this.hass.localize("ui.panel.lovelace.cards.energy.energy_distribution.solar")),tap_action:e.solar?.tap_action,hold_action:e.solar?.hold_action,double_tap_action:e.solar?.double_tap_action,secondary:{entity:e.solar?.secondary_info?.entity,decimals:e.solar?.secondary_info?.decimals,template:e.solar?.secondary_info?.template,has:void 0!==e.solar?.secondary_info?.entity,accept_negative:e.solar?.secondary_info?.accept_negative||!1,state:At(this.hass,this._config),icon:e.solar?.secondary_info?.icon,unit:e.solar?.secondary_info?.unit_of_measurement,unit_white_space:e.solar?.secondary_info?.unit_white_space,tap_action:e.solar?.secondary_info?.tap_action,hold_action:e.solar?.secondary_info?.hold_action,double_tap_action:e.solar?.secondary_info?.double_tap_action}},c={entity:e.battery?.entity,has:!!e.battery?.entity&&("object"==typeof e.battery?.entity?e.battery?.entity.consumption||e.battery?.entity.production:void 0!==e.battery?.entity),mainEntity:"object"==typeof e.battery?.entity?e.battery.entity.consumption:e.battery?.entity,name:gt(this.hass,e.battery,this.hass.localize("ui.panel.lovelace.cards.energy.energy_distribution.battery")),icon:ft(this.hass,e.battery,"mdi:battery-high"),state_of_charge:{state:dt(this.hass,this._config),unit:e?.battery?.state_of_charge_unit??"%",unit_white_space:e?.battery?.state_of_charge_unit_white_space??!0,decimals:e?.battery?.state_of_charge_decimals||0},state:{toBattery:ht(this.hass,this._config),fromBattery:ut(this.hass,this._config),toGrid:0,toHome:0},tap_action:e.battery?.tap_action,hold_action:e.battery?.hold_action,double_tap_action:e.battery?.double_tap_action,color:{fromBattery:e.battery?.color?.consumption,toBattery:e.battery?.color?.production,icon_type:void 0,circle_type:e.battery?.color_circle}},d={entity:e.home?.entity,has:void 0!==e?.home?.entity,state:t,icon:ft(this.hass,e?.home,"mdi:home"),name:gt(this.hass,e?.home,this.hass.localize("ui.panel.lovelace.strategy.home.home")),tap_action:e.home?.tap_action,hold_action:e.home?.hold_action,double_tap_action:e.home?.double_tap_action,secondary:{entity:e.home?.secondary_info?.entity,template:e.home?.secondary_info?.template,has:void 0!==e.home?.secondary_info?.entity,state:mt(this.hass,this._config),accept_negative:e.home?.secondary_info?.accept_negative||!1,unit:e.home?.secondary_info?.unit_of_measurement,unit_white_space:e.home?.secondary_info?.unit_white_space,icon:e.home?.secondary_info?.icon,decimals:e.home?.secondary_info?.decimals,tap_action:e.home?.secondary_info?.tap_action,hold_action:e.home?.secondary_info?.hold_action,double_tap_action:e.home?.secondary_info?.double_tap_action}},u=e.individual?.map(e=>$t(this.hass,e))||[],p={entity:e.fossil_fuel_percentage?.entity,name:gt(this.hass,e.fossil_fuel_percentage,this.hass.localize("card.label.non_fossil_fuel_percentage")),icon:ft(this.hass,e.fossil_fuel_percentage,"mdi:leaf"),has:xt(this.hass,this._config),hasPercentage:St(this.hass,this._config),state:{power:t},color:e.fossil_fuel_percentage?.color,color_value:e.fossil_fuel_percentage?.color_value,tap_action:e.fossil_fuel_percentage?.tap_action,hold_action:e.fossil_fuel_percentage?.hold_action,double_tap_action:e.fossil_fuel_percentage?.double_tap_action,secondary:{entity:e.fossil_fuel_percentage?.secondary_info?.entity,decimals:e.fossil_fuel_percentage?.secondary_info?.decimals,template:e.fossil_fuel_percentage?.secondary_info?.template,has:void 0!==e.fossil_fuel_percentage?.secondary_info?.entity,state:Et(this.hass,this._config),accept_negative:e.fossil_fuel_percentage?.secondary_info?.accept_negative||!1,icon:e.fossil_fuel_percentage?.secondary_info?.icon,unit:e.fossil_fuel_percentage?.secondary_info?.unit_of_measurement,unit_white_space:e.fossil_fuel_percentage?.secondary_info?.unit_white_space,color_value:e.fossil_fuel_percentage?.secondary_info?.color_value,tap_action:e.fossil_fuel_percentage?.secondary_info?.tap_action,hold_action:e.fossil_fuel_percentage?.secondary_info?.hold_action,double_tap_action:e.fossil_fuel_percentage?.secondary_info?.double_tap_action}};i.state.fromGrid=wt(i.state.fromGrid,e.grid?.display_zero_tolerance),i.state.toGrid=wt(i.state.toGrid,e.grid?.display_zero_tolerance),l.state.total=wt(l.state.total,e.solar?.display_zero_tolerance),c.state.fromBattery=wt(c.state.fromBattery,e.battery?.display_zero_tolerance),c.state.toBattery=wt(c.state.toBattery,e.battery?.display_zero_tolerance),0===i.state.fromGrid&&(i.state.toHome=0,i.state.toBattery=0),0===l.state.total&&(l.state.toGrid=0,l.state.toBattery=0,l.state.toHome=0),0===c.state.fromBattery&&(c.state.toGrid=0,c.state.toHome=0),function(e){const{entities:t,grid:i,solar:o,battery:a,nonFossil:n,getEntityStateWatts:r,getEntityState:s}=e;o.has&&(o.state.toHome=(o.state.total??0)-(i.state.toGrid??0)-(a.state.toBattery??0));const l=Math.max(t.grid?.display_zero_tolerance??0,t.battery?.display_zero_tolerance??0);if(null!==o.state.toHome&&o.state.toHome<0?(a.has&&(i.state.toBattery=Math.abs(o.state.toHome),i.state.toBattery>(i.state.fromGrid??0)&&(a.state.toGrid=Math.min(i.state.toBattery-(i.state.fromGrid??0),0),i.state.toBattery=i.state.fromGrid)),o.state.toHome=0):null!==a.state.toBattery&&a.state.toBattery>0?(o.state.toBattery=(o.state.total??0)-(o.state.toHome||0)-(i.state.toGrid||0),i.state.toBattery=(a.state.toBattery??0)-o.state.toBattery):i.state.toBattery=0,i.state.toBattery=(i.state.toBattery??0)>l?i.state.toBattery:0,a.has&&(o.has?(a.state.toGrid||(a.state.toGrid=Math.max(0,(i.state.toGrid||0)-(o.state.total||0)-(a.state.toBattery||0)-(i.state.toBattery||0))),o.state.toBattery=(a.state.toBattery??0)-(i.state.toBattery||0),t.solar?.display_zero_tolerance&&t.solar.display_zero_tolerance>=(o.state.total||0)&&(o.state.toBattery=0)):a.state.toGrid=i.state.toGrid||0,a.state.toGrid=(a.state.toGrid||0)>l&&a.state.toGrid||0,a.state.toHome=(a.state.fromBattery??0)-(a.state.toGrid??0)),i.state.toHome=Math.max((i.state.fromGrid??0)-(i.state.toBattery??0),0),o.has&&i.state.toGrid&&(o.state.toGrid=i.state.toGrid-(a.state.toGrid??0)),i.powerOutage.isOutage&&(i.state.fromGrid=i.powerOutage.entityGenerator?Math.max(r(i.powerOutage.entityGenerator),0):0,i.state.toHome=Math.max((i.state.fromGrid??0)-(i.state.toBattery??0),0),i.state.toGrid=0,a.state.toGrid=0,o.state.toGrid=0,i.icon=i.powerOutage.icon,n.has=!1,n.hasPercentage=!1),n.has){const e=1-(s(t.fossil_fuel_percentage?.entity)??0)/100;n.state.power=(i.state.toHome??0)*e}}({entities:{grid:e.grid,battery:e.battery,solar:e.solar,fossil_fuel_percentage:e.fossil_fuel_percentage},grid:i,solar:l,battery:c,nonFossil:p,getEntityStateWatts:e=>Qe(this.hass,e),getEntityState:e=>Xe(this.hass,e)});const _=u?.reduce((e,t)=>e+(t.has&&t.state||0),0)||0,m=Math.max((i.state.toHome??0)+(l.state.toHome??0)+(c.state.toHome??0),0),y=c.state.toHome?it*(c.state.toHome/m):0,f=l.state.toHome?it*(l.state.toHome/m):0,g=p.state.power?it*(p.state.power/m):0,v=it*((m-(p.state.power??0)-(c.state.toHome??0)-(l.state.toHome??0))/m),b=e.home?.override_state&&e.home.entity?e.home?.subtract_individual?h(this.hass,this._config,Qe(this.hass,e.home.entity)-_,{unit:e.home?.unit_of_measurement,unitWhiteSpace:e.home?.unit_white_space,watt_threshold:this._config.watt_threshold}):h(this.hass,this._config,Qe(this.hass,e.home.entity),{unit:e.home?.unit_of_measurement,unitWhiteSpace:e.home?.unit_white_space,watt_threshold:this._config.watt_threshold}):e.home?.subtract_individual?h(this.hass,this._config,m-_||0,{unit:e.home?.unit_of_measurement,unitWhiteSpace:e.home?.unit_white_space,watt_threshold:this._config.watt_threshold}):h(this.hass,this._config,m,{unit:e.home?.unit_of_measurement,unitWhiteSpace:e.home?.unit_white_space,watt_threshold:this._config.watt_threshold}),w=(i.state.toHome??0)+(l.state.toHome??0)+(l.state.toGrid??0)+(l.state.toBattery??0)+(c.state.toHome??0)+(i.state.toBattery??0)+(c.state.toGrid??0);null===c.state_of_charge.state?c.icon="mdi:battery":c.state_of_charge.state<=72&&c.state_of_charge.state>44?c.icon="mdi:battery-medium":c.state_of_charge.state<=44&&c.state_of_charge.state>16?c.icon="mdi:battery-low":c.state_of_charge.state<=16&&(c.icon="mdi:battery-outline"),void 0!==e.battery?.icon&&(c.icon=e.battery?.icon);const k=e.battery?.use_metadata;if(k){const t=ft(this.hass,e.battery,"NO_ICON_METADATA");"NO_ICON_METADATA"!==t&&(c.icon=t)}const $={batteryGrid:Le(this._config,Math.max(i.state.toBattery??0,c.state.toGrid??0,0),w),batteryToHome:Le(this._config,c.state.toHome??0,w),gridToHome:Le(this._config,i.state.toHome??0,w),solarToBattery:Le(this._config,l.state.toBattery??0,w),solarToGrid:Le(this._config,l.state.toGrid??0,w),solarToHome:Le(this._config,l.state.toHome??0,w),individual:u?.map(e=>Le(this._config,e.state??0,_))||[],nonFossil:Le(this._config,p.state.power??0,w)};if(be(this._config)){["batteryGrid","batteryToHome","gridToHome","solarToBattery","solarToGrid","solarToHome"].forEach(e=>{const t=this[`${e}Flow`];t&&this.previousDur[e]&&this.previousDur[e]!==$[e]&&(t.pauseAnimations(),t.setCurrentTime(t.getCurrentTime()*($[e]/this.previousDur[e])),t.unpauseAnimations()),this.previousDur[e]=$[e]})}else this.previousDur={};const x={battery:{value:y,color:"var(--energy-battery-out-color)"},solar:{value:f,color:"var(--energy-solar-color)"},grid:{value:v,color:"var(--energy-grid-consumption-color)"},gridNonFossil:{value:g,color:"var(--energy-non-fossil-color)"}},S=Object.keys(x).reduce((e,t)=>x[e].value>x[t].value?e:t),E=["left-top","left-bottom","right-top","right-bottom"],C={gridSecondary:this._templateResults.gridSecondary?.result,solarSecondary:this._templateResults.solarSecondary?.result,homeSecondary:this._templateResults.homeSecondary?.result,nonFossilFuelSecondary:this._templateResults.nonFossilFuelSecondary?.result,individual:u?.map((e,t)=>this._templateResults[`${E[t]}Secondary`]?.result)||[]},A=this._width>420,M=this._config.sort_individual_devices?(e=>e.map((e,t)=>({obj:e,index:t})).sort((e,t)=>{const i=(t.obj.state||0)-(e.obj.state||0);if(0!==i)return i;const o=e.obj.entity.localeCompare(t.obj.entity);return 0!==o?o:e.index-t.index}).map(({obj:e})=>e))(u):u,P=this._config.allow_layout_break||this._width>=this.wideEnoughForFourIndividuals?4:2,D=M.filter(e=>e.has).slice(0,P),z=(e=>we(e,0))(D),T=ke(D),O=$e(D),N=xe(D);return((e,t)=>{const{grid:i,solar:o,entities:a,individual:n,battery:r,homeSources:s,homeLargestSource:l,nonFossil:c,display_zero_lines_transparency:d,display_zero_lines_grey_color:h,isCardWideEnough:u}=t;if(e.style.setProperty("--icon-grid-color","consumption"===i.color.icon_type?"var(--energy-grid-consumption-color)":"production"===i.color.icon_type?"var(--energy-grid-return-color)":"color_dynamically"===i.color.icon_type?(i.state.fromGrid??0)>=(i.state.toGrid??0)?"var(--energy-grid-consumption-color)":"var(--energy-grid-return-color)":"var(--primary-text-color)"),e.style.setProperty("--circle-grid-color","consumption"===i.color.circle_type?"var(--energy-grid-consumption-color)":"production"===i.color.circle_type?"var(--energy-grid-return-color)":"no_color"!==i.color.circle_type?(i.state.fromGrid??0)>=(i.state.toGrid??0)?"var(--energy-grid-consumption-color)":"var(--energy-grid-return-color)":"var(--energy-grid-consumption-color)"),void 0!==i.color.fromGrid&&("object"==typeof i.color.fromGrid&&(i.color.fromGrid=Dt(i.color.fromGrid)),e.style.setProperty("--energy-grid-consumption-color",i.color.fromGrid||"#a280db")),void 0!==i.color.toGrid&&("object"==typeof i.color.toGrid&&(i.color.toGrid=Dt(i.color.toGrid)),e.style.setProperty("--energy-grid-return-color",i.color.toGrid||"#a280db")),e.style.setProperty("--secondary-text-grid-color","consumption"===i.secondary.color.type?"var(--energy-grid-consumption-color)":"production"===i.secondary.color.type?"var(--energy-grid-return-color)":!0===i.secondary.color.type?(i.state.fromGrid??0)>=(i.state.toGrid??0)?"var(--energy-grid-consumption-color)":"var(--energy-grid-return-color)":"var(--primary-text-color)"),!1===a.grid?.color_value?(e.style.setProperty("--text-grid-consumption-color","var(--primary-text-color)"),e.style.setProperty("--text-grid-return-color","var(--primary-text-color)")):(e.style.setProperty("--text-grid-consumption-color","var(--energy-grid-consumption-color)"),e.style.setProperty("--text-grid-return-color","var(--energy-grid-return-color)")),e.style.setProperty("--text-solar-color",a.solar?.color_value?"var(--energy-solar-color)":"var(--primary-text-color)"),e.style.setProperty("--secondary-text-solar-color",a.solar?.secondary_info?.color_value?"var(--energy-solar-color)":"var(--primary-text-color)"),void 0!==a.solar?.color){let t=a.solar.color;"object"==typeof t&&(t=Dt(t)),e.style.setProperty("--energy-solar-color",t||"#ff9800")}e.style.setProperty("--icon-solar-color",a.solar?.color_icon?"var(--energy-solar-color)":"var(--primary-text-color)"),void 0!==r.color.fromBattery&&("object"==typeof r.color.fromBattery&&(r.color.fromBattery=Dt(r.color.fromBattery)),e.style.setProperty("--energy-battery-out-color",r.color.fromBattery||"#4db6ac")),void 0!==r.color.toBattery&&("object"==typeof r.color.toBattery&&(r.color.toBattery=Dt(r.color.toBattery)),e.style.setProperty("--energy-battery-in-color",r.color.toBattery||"#a280db")),r.color.icon_type=a.battery?.color_icon,e.style.setProperty("--icon-battery-color","consumption"===r.color.icon_type?"var(--energy-battery-in-color)":"production"===r.color.icon_type?"var(--energy-battery-out-color)":"color_dynamically"===r.color.icon_type?r.state.fromBattery>=r.state.toBattery?"var(--energy-battery-out-color)":"var(--energy-battery-in-color)":"var(--primary-text-color)");const p=a.battery?.color_state_of_charge_value;if(e.style.setProperty("--text-battery-state-of-charge-color","consumption"===p?"var(--energy-battery-in-color)":"production"===p?"var(--energy-battery-out-color)":"color_dynamically"===p?r.state.fromBattery>=r.state.toBattery?"var(--energy-battery-out-color)":"var(--energy-battery-in-color)":"var(--primary-text-color)"),e.style.setProperty("--circle-battery-color","consumption"===r.color.circle_type?"var(--energy-battery-in-color)":"production"===r.color.circle_type||"no_color"!==r.color.circle_type&&r.state.fromBattery>=r.state.toBattery?"var(--energy-battery-out-color)":"var(--energy-battery-in-color)"),!1===a.battery?.color_value?(e.style.setProperty("--text-battery-in-color","var(--primary-text-color)"),e.style.setProperty("--text-battery-out-color","var(--primary-text-color)")):(e.style.setProperty("--text-battery-in-color","var(--energy-battery-in-color)"),e.style.setProperty("--text-battery-out-color","var(--energy-battery-out-color)")),void 0!==c.color&&("object"==typeof c.color&&(c.color=Dt(c.color)),e.style.setProperty("--non-fossil-color",c.color||"var(--energy-non-fossil-color)")),e.style.setProperty("--icon-non-fossil-color",a.fossil_fuel_percentage?.color_icon?"var(--non-fossil-color)":"var(--primary-text-color)"),e.style.setProperty("--text-non-fossil-color",a.fossil_fuel_percentage?.color_value?"var(--non-fossil-color)":"var(--primary-text-color)"),e.style.setProperty("--secondary-text-non-fossil-color",a.fossil_fuel_percentage?.secondary_info?.color_value?"var(--non-fossil-color)":"var(--primary-text-color)"),e.style.setProperty("--secondary-text-home-color",a.home?.secondary_info?.color_value?"var(--text-home-color)":"var(--primary-text-color)"),e.style.setProperty("--icon-home-color",Pt(a.home?.color_icon,s,l)),e.style.setProperty("--text-home-color",Pt(a.home?.color_value,s,l)),!1===a.home?.circle_animation&&e.style.setProperty("--home-circle-animation","none"),e.style.setProperty("--battery-grid-line",i.state.toBattery?"var(--energy-grid-consumption-color)":"var(--energy-grid-return-color)"),e.style.setProperty("--transparency-unused-lines",d?d.toString():"0"),void 0!==h){let t=h;"object"==typeof t&&(t=Dt(t)),e.style.setProperty("--greyed-out--line-color",t)}if(o.has&&(r.has?(e.style.setProperty("--lines-svg-not-flat-line-height","106%"),e.style.setProperty("--lines-svg-not-flat-line-top","-3%"),e.style.setProperty("--lines-svg-flat-width","calc(100% - 160px)"),e.style.setProperty("--lines-svg-flat-left","0"),e.style.setProperty("--lines-svg-not-flat-left","0")):(e.style.setProperty("--lines-svg-not-flat-line-top","-2%"),e.style.setProperty("--lines-svg-flat-width",u?"calc(100% - 154px)":"calc(100% - 157px)"),e.style.setProperty("--lines-svg-not-flat-width",u?"calc(103% - 172px)":"calc(103% - 169px)"),e.style.setProperty("--lines-svg-not-flat-left","3px"),e.style.setProperty("--lines-svg-flat-left","-3px"))),n?.some(e=>e.has)){const t=(t,i)=>{const o=["left-top","left-bottom","right-top","right-bottom"][i]||"left-top";let a=t?.color;"object"==typeof a&&(a=Dt(a)),e.style.setProperty(`--individual-${o}-color`,a||["#d0cc5b","#964cb5","#b54c9d","#5bd0cc"][i]||"#d0cc5b"),e.style.setProperty(`--icon-individual-${o}-color`,!1!==t?.color_icon?`var(--individual-${o}-color)`:"var(--primary-text-color)"),e.style.setProperty(`--text-individual-${o}-color`,t?.color_value?`var(--individual-${o}-color)`:"var(--primary-text-color)"),e.style.setProperty(`--secondary-text-individual-${o}-color`,t?.secondary_info?.color_value?`var(--individual-${o}-color)`:"var(--primary-text-color)")},i=n.filter(e=>e?.has);for(let e=0;e<(i.length<4?i.length:4);e++){const o=i[e];o&&t(o.field||{},e)}}})(this,{grid:i,solar:l,battery:c,display_zero_lines_grey_color:"grey_out"===this._config.display_zero_lines?.mode?this._config.display_zero_lines?.grey_color:"",display_zero_lines_transparency:"transparency"===this._config.display_zero_lines?.mode?this._config.display_zero_lines?.transparency:void 0,entities:e,homeLargestSource:S,homeSources:x,individual:M,nonFossil:p,isCardWideEnough:A}),{entities:e,grid:i,solar:l,battery:c,home:d,nonFossil:p,individualObjs:D,newDur:$,templatesObj:C,homeBatteryCircumference:y,homeSolarCircumference:f,homeNonFossilCircumference:g,homeGridCircumference:v,homeUsageToDisplay:b,sortedIndividualObjects:D,individualFieldLeftTop:z,individualFieldLeftBottom:T,individualFieldRightTop:O,individualFieldRightBottom:N}}_tryConnectAll(){const{entities:e}=this._config,t={gridSecondary:e.grid?.secondary_info?.template,solarSecondary:e.solar?.secondary_info?.template,homeSecondary:e.home?.secondary_info?.template,individualSecondary:e.individual?.map(e=>e.secondary_info?.template),nonFossilFuelSecondary:e.fossil_fuel_percentage?.secondary_info?.template};for(const[e,i]of Object.entries(t))if(i)if(Array.isArray(i)){const e=["left-top","left-bottom","right-top","right-bottom"];i.forEach((t,i)=>{t&&this._tryConnect(t,`${e[i]}Secondary`)})}else this._tryConnect(i,e)}async _tryConnect(e,t){var i,o,a;if(this.hass&&this._config&&void 0===this._unsubRenderTemplates?.get(t)&&""!==e)try{const n=this._config.entity_id,r="string"==typeof n||Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0,s=(i=this.hass.connection,o=e=>{this._templateResults[t]=e},a={template:e,entity_ids:r,variables:{config:this._config,user:this.hass.user.name},strict:!0},i.subscribeMessage(e=>o(e),{type:"render_template",...a}));this._unsubRenderTemplates?.set(t,s),await s}catch{this._templateResults={...this._templateResults,[t]:{result:e,listeners:{all:!1,domains:[],entities:[],time:!1}}},this._unsubRenderTemplates?.delete(t)}}async _tryDisconnectAll(){const{entities:e}=this._config,t={gridSecondary:e.grid?.secondary_info?.template,solarSecondary:e.solar?.secondary_info?.template,homeSecondary:e.home?.secondary_info?.template,individualSecondary:e.individual?.map(e=>e.secondary_info?.template)};for(const[e,i]of Object.entries(t))i&&this._tryDisconnect(e)}async _tryDisconnect(e){const t=this._unsubRenderTemplates?.get(e);if(t)try{(await t)(),this._unsubRenderTemplates?.delete(e)}catch(e){if("not_found"!==e.code&&"template_error"!==e.code)throw e}}};Vi.styles=zt,e([Ii({attribute:!1}),t("design:type",Object)],Vi.prototype,"hass",void 0),e([Ri(),t("design:type",Object)],Vi.prototype,"_config",void 0),e([Ri(),t("design:type",Object)],Vi.prototype,"_templateResults",void 0),e([Ri(),t("design:type",Map)],Vi.prototype,"_unsubRenderTemplates",void 0),e([Ri(),t("design:type",Object)],Vi.prototype,"_width",void 0),e([Fi("#battery-grid-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"batteryGridFlow",void 0),e([Fi("#battery-home-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"batteryToHomeFlow",void 0),e([Fi("#grid-home-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"gridToHomeFlow",void 0),e([Fi("#solar-battery-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"solarToBatteryFlow",void 0),e([Fi("#solar-grid-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"solarToGridFlow",void 0),e([Fi("#solar-home-flow"),t("design:type",SVGSVGElement)],Vi.prototype,"solarToHomeFlow",void 0),Vi=e([Hi("power-flow-card-plus")],Vi);var Zi={label:{car:"Cotxe",motorbike:"Moto"}},Ki={accept_negative:"Accepta Negatius",action:"Acció",advanced:"Opcions Avançades",allow_layout_break:"Permet trencar el disseny",battery:"Bateria",calculate_flow_rate:"Calcula la Relació de Fluxe",circle_animation:"Animació Circular",clickable_entities:"Entitats cliquejables",color:"Color",color_circle:"Color de Cercle",color_dynamically:"Color dinàmic",color_icon:"Color de Icona",color_state_of_charge_value:"Color",color_value:"Color de Valor",combined:"Entitat Combinada (Una entitat amb valors positius i negatius)",consumption:"Consum",custom:"Personalitzat",custom_colors:"Colors Personalitzats",dashboard_link:"Enllaç al Panell",dashboard_link_label:"Nom del Panell",decimals:"Nombre de decimals",disable_dots:"Deshabilitar Punts",display_state:"Mostra Estat",display_zero:"Mostra Zero",display_zero_lines:"Mostra Línies Zero",display_zero_state:"Mostra Estat Zero",display_zero_tolerance:"Mostra Zero Tolerància",double_tap_action:"Acció en doble toc",entity_generator:"Generador",fossil_fuel_percentage:"Comb. Fòssils",grey_color:"Color Gris",grey_out:"En Gris",grid:"Xarxa",hide:"Amaga",hold_action:"Acció en mantenir premut",home:"Casa",icon_alert:"Icona per a Alerta",individual:"Individu",invert_state:"Inverteix l'estat",inverted_animation:"Invertir Animació",kw_decimals:"Decimals Kilowatt",kwh_decimals:"Decimals kWh",kwh_threshold:"Límit kWh a MWh",label_alert:"Etiqueta per a Alerta",max_expected_power:"Potència Màxima Esperada",max_flow_rate:"Rel. Màx de Fluxe",min_expected_power:"Potència Mínima Esperada",min_flow_rate:"Rel. Mín. de Fluxe",mode:"Mode de visualització",mwh_decimals:"Decimals MWh",mwh_threshold:"Límit MWh a TWh",navigation_path:"Ruta de Navegació",no_color:"Sense color",no_labels:"Sense etiquetes",override_state:"Sobrescriu l'Estat",power_outage:"Pèrdua de Potència",production:"Producció",secondary_info:"Informació Secundària",separated:"Entitats Separades (Una entitat per a consum i una per a producció)",show:"Mostra",show_direction:"Mostrar Direcció",show_state_of_charge:"Mostra l'Estat de Càrrega",solar:"Energia solar",sort_individual_devices:"Ordena Dispositius Individuals",state_alert:"Estat d'Alerta",state_of_charge:"Estat de Càrrega",state_of_charge_decimals:"Nombre de decimals",state_of_charge_icon:"Icona",state_of_charge_unit:"Unitat",state_of_charge_unit_white_space:"Espai en Blanc",state_type:"Tipus d'Estat",subtract_individual:"Resta Individuals",sum_total:"Suma solar i secundària",tap_action:"Acció al Tocar",template:"Plantilla",transparency:"Transparència",unit_of_measurement:"Unitat",unit_white_space:"Unitat Espai en Blanc",use_metadata:"Empra Metadades",use_new_flow_rate_model:"Nou Model de Rel. de Fluxe",w_decimals:"Decimals Watt",watt_threshold:"Límit Watt a Kilowatt",wh_decimals:"Decimals Wh",wh_threshold:"Límit Wh a kWh"},qi={card:Zi,editor:Ki},Yi=Object.freeze({__proto__:null,card:Zi,default:qi,editor:Ki}),Xi={label:{car:"Auto",motorbike:"Motorka"}},Ji={accept_negative:"Přijmout záporné hodnoty",action:"Akce",advanced:"Pokročilá nastavení",allow_layout_break:"Povolit zalomení rozvržení",battery:"Baterie",calculate_flow_rate:"Počítat průtok",circle_animation:"Kruhová animace",clickable_entities:"Entity, na které se dá kliknout",color:"Barva",color_circle:"Barva kruhu",color_dynamically:"Barva dynamicky",color_icon:"Barva ikony",color_state_of_charge_value:"Barva",color_value:"Barva hodnoty",combined:"Kombinovaná entita (jedna entita s kladnými a zápornými hodnotami)",consumption:"Spotřeba",custom:"Volitelné",custom_colors:"Vlastní barvy",dashboard_link:"Odkaz na informační panel",dashboard_link_label:"Název odkazu na informační panel",decimals:"Desetinná místa",disable_dots:"Vypnout tečky",display_state:"Zobrazit stav",display_zero:"Zobrazit nulu",display_zero_lines:"Zobrazit nulové řádky",display_zero_state:"Zobrazení nulového stavu",display_zero_tolerance:"Zobrazit nulovou toleranci",double_tap_action:"Akce při dvojitém klepnutí",entity_generator:"Generátor",fossil_fuel_percentage:"Fosilní palivo",grey_color:"Šedá barva",grey_out:"Šedý výstup",grid:"Síť",hide:"Skrýt",hold_action:"Akce při podržení",home:"Dům",icon_alert:"Ikona pro upozornění",individual:"Individuální",invert_state:"Invertovat stav",inverted_animation:"Invertovat animaci",kw_decimals:"Desetinná místa pro kilowatty",kwh_decimals:"Desetinná místa pro kWh",kwh_threshold:"Práh kWh na MWh",label_alert:"Štítek pro upozornění",max_expected_power:"Maximální očekávaný výkon",max_flow_rate:"Maximální průtok",min_expected_power:"Minimální očekávaný výkon",min_flow_rate:"Minimální průtok",mode:"Režim",mwh_decimals:"Desetinná místa pro MWh",mwh_threshold:"Práh MWh na TWh",navigation_path:"Navigační cesta",no_color:"Bez barvy",no_labels:"Bez popisků",override_state:"Přepsat stav",power_outage:"Výpadek",production:"Výroba",secondary_info:"Sekundární informace",separated:"Oddelené subjekty (jeden subjekt pro spotřebu a jeden pro výrobu)",show:"Zobrazit",show_direction:"Zobrazit směr",show_state_of_charge:"Zobrazit stav nabití",solar:"Solární",sort_individual_devices:"Seřaďte individuálně",state_alert:"Stav upozornění",state_of_charge:"Stav nabití",state_of_charge_decimals:"Desetinná místa",state_of_charge_icon:"Ikona",state_of_charge_unit:"Jednotky",state_of_charge_unit_white_space:"Bílá plocha",state_type:"Typ stavu",subtract_individual:"Odečíst individuálně",sum_total:"Sečíst solární a sekundární",tap_action:"Akce po klepnutí",template:"Šablona",transparency:"Průhlednost",unit_of_measurement:"Jednotka",unit_white_space:"Jednotka bílé plochy",use_metadata:"Použít Metadata",use_new_flow_rate_model:"Nový model průtoku",w_decimals:"Desetinná místa pro Watty",watt_threshold:"Práh wattů na kilowatty",wh_decimals:"Desetinná místa pro Wh",wh_threshold:"Práh Wh na kWh"},Qi={card:Xi,editor:Ji},eo=Object.freeze({__proto__:null,card:Xi,default:Qi,editor:Ji}),to={label:{car:"Auto",motorbike:"Motorrad"}},io={accept_negative:"Negative Werte akzeptieren",action:"Aktion",advanced:"Erweiterte Optionen",allow_layout_break:"Layoutumbruch zulassen",battery:"Batterie",calculate_flow_rate:"Flussrate berechnen",circle_animation:"Kreisanimation",clickable_entities:"Klickbare Entitäten",color:"Farbe",color_circle:"Farbe des Kreises",color_dynamically:"Farbe dynamisch",color_icon:"Farbe des Symbols",color_state_of_charge_value:"Farbe",color_value:"Farbe des Wertes",combined:"Kombinierte Entität (Eine Entität mit positiven und negativen Werten)",consumption:"Verbrauch",custom:"Benutzerdefiniert",custom_colors:"Benutzerdefinierte Farben",dashboard_link:"Dashboard-Link",dashboard_link_label:"Name des Dashboard-Links",decimals:"Dezimalstellen",disable_dots:"Punkte deaktivieren",display_state:"Zustand anzeigen",display_zero:"Null anzeigen",display_zero_lines:"Nulllinien anzeigen",display_zero_state:"Nullzustand anzeigen",display_zero_tolerance:"Nulltoleranz",double_tap_action:"Aktion beim Doppeltippen",entity_generator:"Generator",fossil_fuel_percentage:"Fossile Brennstoffe",grey_color:"Graue Farbe",grey_out:"Ausgrauen",grid:"Netz",hide:"Verstecken",hold_action:"Aktion beim Halten",home:"Zuhause",icon_alert:"Symbol für Alarm",individual:"Individuell",invert_state:"Zustand umkehren",inverted_animation:"Animation umkehren",kw_decimals:"Kilowatt-Dezimalstellen",kwh_decimals:"kWh-Dezimalstellen",kwh_threshold:"kWh-zu-MWh-Schwelle",label_alert:"Beschriftung für Alarm",max_expected_power:"Maximale erwartete Leistung",max_flow_rate:"Maximale Flussrate",min_expected_power:"Minimale erwartete Leistung",min_flow_rate:"Minimale Flussrate",mode:"Modus",mwh_decimals:"MWh-Dezimalstellen",mwh_threshold:"MWh-zu-TWh-Schwelle",navigation_path:"Navigationspfad",no_color:"Keine Farbe",no_labels:"Keine Beschriftungen",override_state:"Zustand überschreiben",power_outage:"Stromausfall",production:"Produktion",secondary_info:"Sekundäre Information",separated:"Getrennte Entitäten (Eine Entität für den Verbrauch und eine für die Produktion)",show:"Anzeigen",show_direction:"Richtung anzeigen",show_state_of_charge:"Ladezustand anzeigen",solar:"Solarenergie",sort_individual_devices:"Individuelle Geräte sortieren",state_alert:"Alarmzustand",state_of_charge:"Ladezustand",state_of_charge_decimals:"Dezimalstellen",state_of_charge_icon:"Symbol",state_of_charge_unit:"Einheit",state_of_charge_unit_white_space:"Leerzeichen",state_type:"Typ des Zustands",subtract_individual:"Individuell abziehen",sum_total:"Solar und Sekundär summieren",tap_action:"Aktion beim Antippen",template:"Vorlage",transparency:"Transparenz",unit_of_measurement:"Einheit",unit_white_space:"Weißraum für Einheit",use_metadata:"Metadaten verwenden",use_new_flow_rate_model:"Neues Fluss-Modell verwenden",w_decimals:"Watt-Dezimalstellen",watt_threshold:"Watt-zu-Kilowatt-Schwelle",wh_decimals:"Wh-Dezimalstellen",wh_threshold:"Wh-zu-kWh-Schwelle"},oo={card:to,editor:io},ao=Object.freeze({__proto__:null,card:to,default:oo,editor:io}),no={label:{car:"Bil",motorbike:"Motorcykel"}},ro={accept_negative:"Accepter negative værdier",action:"Handling",advanced:"Avancerede indstillinger",allow_layout_break:"Tillad layout-brud",battery:"Batteri",calculate_flow_rate:"Beregn Hastighed",circle_animation:"Cirkel Animation",clickable_entities:"Klikbare enheder",color:"Farve",color_circle:"Farve af Cirkel",color_dynamically:"Farve dynamisk",color_icon:"Farve af ikon",color_state_of_charge_value:"Farve",color_value:"Farve af værdi",combined:"Kombineret enhed (Én enhed med positive og negative værdier)",consumption:"Forbrug",custom:"Brugerdefinerede",custom_colors:"Brugerdefinerede farver",dashboard_link:"Dashboard-link",dashboard_link_label:"Navn på dashboard-link",decimals:"Decimaler",disable_dots:"Deaktiver prikker",display_state:"Vis Tilstand",display_zero:"Vis Nul",display_zero_lines:"Vis Nul Linjer",display_zero_state:"Vis Nultilstand",display_zero_tolerance:"Vis ingen tolerance",double_tap_action:"Dobbelttryk-handling",entity_generator:"Generator",fossil_fuel_percentage:"Fossilt Brændstof",grey_color:"Grå farve",grey_out:"Grået ud",grid:"El-Net",hide:"Skjul",hold_action:"Hold-handling",home:"Hjem",icon_alert:"Ikon for alarm",individual:"Individuel",invert_state:"Omvendt tilstand",inverted_animation:"Omvendt Animation",kw_decimals:"Kilowatt Decimal",kwh_decimals:"kWh Decimal",kwh_threshold:"kWh til MWh Grænse",label_alert:"Etiket til Alarm",max_expected_power:"Maks. forventet effekt",max_flow_rate:"Maks. flowhastighed",min_expected_power:"Min. forventet effekt",min_flow_rate:"Min. flowhastighed",mode:"Tilstand",mwh_decimals:"MWh Decimal",mwh_threshold:"MWh til TWh Grænse",navigation_path:"Navigationssti",no_color:"Ingen farve",no_labels:"Ingen etiketter",override_state:"Overskriv Tilstand",power_outage:"Strømafbrydelse",production:"Produktion",secondary_info:"Sekundær info",separated:"Adskilte enheder (én enhed til forbrug og én til produktion)",show:"Vis",show_direction:"Vis Retning",show_state_of_charge:"Vis ladningstilstand",solar:"Solenergi",sort_individual_devices:"Sorter individuelle enheder",state_alert:"Alarmtilstand",state_of_charge:"Ladningstilstand",state_of_charge_decimals:"Decimal",state_of_charge_icon:"Ikon",state_of_charge_unit:"Enhed",state_of_charge_unit_white_space:"Tomt mellemrum",state_type:"Tilstande",subtract_individual:"Fratræk individuel",sum_total:"Sum sol og sekundær",tap_action:"Tryk-handling",template:"Skabelon",transparency:"Transparens",unit_of_measurement:"Enhed",unit_white_space:"Enhed tomt mellemrum",use_metadata:"Brug Metadata",use_new_flow_rate_model:"Ny flowhastighedsmodel",w_decimals:"Watt Decimal",watt_threshold:"Watt til Kilowatt Grænse",wh_decimals:"Wh Decimal",wh_threshold:"Wh til kWh Grænse"},so={card:no,editor:ro},lo=Object.freeze({__proto__:null,card:no,default:so,editor:ro}),co={label:{car:"Car",motorbike:"Motorbike"}},ho={accept_negative:"Accept Negative",action:"Action",advanced:"Advanced Options",allow_layout_break:"Allow Layout Break",battery:"Battery",calculate_flow_rate:"Calculate Flow Rate",circle_animation:"Circle Animation",clickable_entities:"Clickable Entities",color:"Color",color_circle:"Color of Circle",color_dynamically:"Color Dynamically",color_icon:"Color of Icon",color_state_of_charge_value:"Color",color_value:"Color of Value",combined:"Combined Entity (One entity with positive and negative values)",consumption:"Consumption",custom:"Custom",custom_colors:"Custom Colors",dashboard_link:"Dashboard Link",dashboard_link_label:"Dashboard Link Name",decimals:"Decimals",disable_dots:"Disable Dots",display_state:"Display State",display_zero:"Display Zero",display_zero_lines:"Display Zero Lines",display_zero_state:"Display Zero State",display_zero_tolerance:"Display Zero Tolerance",double_tap_action:"Double Tap Action",entity_generator:"Generator",fossil_fuel_percentage:"Fossil Fuel",grey_color:"Grey Color",grey_out:"Grey Out",grid:"Grid",hide:"Hide",hold_action:"Hold Action",home:"Home",icon_alert:"Icon for Alert",individual:"Individual",invert_state:"Invert State",inverted_animation:"Invert Animation",kw_decimals:"Kilowatt Decimals",kwh_decimals:"kWh Decimals",kwh_threshold:"kWh to MWh Threshold",label_alert:"Label for Alert",max_expected_power:"Max Expected Power",max_flow_rate:"Max Flow Rate",min_expected_power:"Min Expected Power",min_flow_rate:"Min Flow Rate",mode:"Mode",mwh_decimals:"MWh Decimals",mwh_threshold:"MWh to TWh Threshold",navigation_path:"Navigation Path",no_color:"No Color",no_labels:"No Labels",override_state:"Override State",power_outage:"Power Outage",production:"Production",secondary_info:"Secondary Info",separated:"Separated Entities (One entity for consumption and one for production)",show:"Show",show_direction:"Show Direction",show_state_of_charge:"Show State of Charge",solar:"Solar",sort_individual_devices:"Sort individual devices",state_alert:"State of Alert",state_of_charge:"State of Charge",state_of_charge_decimals:"Decimals",state_of_charge_icon:"Icon",state_of_charge_unit:"Unit",state_of_charge_unit_white_space:"White Space",state_type:"Type of State",subtract_individual:"Subtract Individual",sum_total:"Sum solar and secondary",tap_action:"Tap Action",template:"Template",transparency:"Transparency",unit_of_measurement:"Unit",unit_white_space:"Unit White Space",use_metadata:"Use Metadata",use_new_flow_rate_model:"New Flow Rate Model",w_decimals:"Watt Decimals",watt_threshold:"Watt to Kilowatt Threshold",wh_decimals:"Wh Decimals",wh_threshold:"Wh to kWh Threshold"},uo={card:co,editor:ho},po=Object.freeze({__proto__:null,card:co,default:uo,editor:ho}),_o={label:{car:"Coche",motorbike:"Motocicleta"}},mo={accept_negative:"Aceptar valores negativos",action:"Acción",advanced:"Opciones Avanzadas",allow_layout_break:"Permitir salto de diseño",battery:"Batería",calculate_flow_rate:"Calcular Tasa de Flujo",circle_animation:"Animación de Círculo",clickable_entities:"Entidades Clicables",color:"Color",color_circle:"Color del Círculo",color_dynamically:"Color dinámico",color_icon:"Color del Icono",color_state_of_charge_value:"Color",color_value:"Color del Valor",combined:"Entidad combinada (una entidad con valores positivos y negativos)",consumption:"Consumo",custom:"Personalizado",custom_colors:"Colores personalizados",dashboard_link:"Enlace del Tablero",dashboard_link_label:"Nombre del Enlace del Tablero",decimals:"Decimales",disable_dots:"Desactivar Puntos",display_state:"Mostrar Estado",display_zero:"Mostrar Cero",display_zero_lines:"Mostrar Líneas de Cero",display_zero_state:"Mostrar Estado Cero",display_zero_tolerance:"Tolerancia de Cero",double_tap_action:"Acción de Doble Toque",entity_generator:"Generador",fossil_fuel_percentage:"Combustible Fósil",grey_color:"Color Gris",grey_out:"Gris",grid:"Red eléctrica",hide:"Ocultar",hold_action:"Acción al Mantener",home:"Casa",icon_alert:"Ícono para Alerta",individual:"Individuales",invert_state:"Invertir Estado",inverted_animation:"Animación Invertida",kw_decimals:"Decimales de Kilovatio",kwh_decimals:"Decimales de kWh",kwh_threshold:"Umbral de kWh a MWh",label_alert:"Etiqueta para Alerta",max_expected_power:"Potencia Máxima Esperada",max_flow_rate:"Tasa de Flujo Máxima",min_expected_power:"Potencia Mínima Esperada",min_flow_rate:"Tasa de Flujo Mínima",mode:"Modo",mwh_decimals:"Decimales de MWh",mwh_threshold:"Umbral de MWh a TWh",navigation_path:"Ruta de Navegación",no_color:"Sin color",no_labels:"Sin etiquetas",override_state:"Sobrescribir Estado",power_outage:"Corte de energía",production:"Producción",secondary_info:"Información secundaria",separated:"Entidades separadas (una entidad de consumo y otra de producción)",show:"Mostrar",show_direction:"Mostrar Dirección",show_state_of_charge:"Mostrar Estado de Carga",solar:"Energía solar",sort_individual_devices:"Ordenar dispositivos individuales",state_alert:"Estado de Alerta",state_of_charge:"Estado de Carga",state_of_charge_decimals:"Decimales",state_of_charge_icon:"Ícono",state_of_charge_unit:"Unidad",state_of_charge_unit_white_space:"Espacio en Blanco",state_type:"Tipo de Estado",subtract_individual:"Restar Individualmente",sum_total:"Sumar solar y secundario",tap_action:"Acción de Toque",template:"Plantilla",transparency:"Transparencia",unit_of_measurement:"Unidad",unit_white_space:"Espacio en Blanco de la Unidad",use_metadata:"Utilizar Metadatos",use_new_flow_rate_model:"Utilizar Nuevo Modelo de Tasa de Flujo",w_decimals:"Decimales de Vatio",watt_threshold:"Umbral de Vatio a Kilovatio",wh_decimals:"Decimales de Wh",wh_threshold:"Umbral de Wh a kWh"},yo={card:_o,editor:mo},fo=Object.freeze({__proto__:null,card:_o,default:yo,editor:mo}),go={label:{car:"Auto",motorbike:"Moottoripyörä"}},vo={accept_negative:"Hyväksy negatiiviset arvot",action:"Toiminto",advanced:"Lisäasetukset",allow_layout_break:"Salli asettelun rivitys",battery:"Akku",calculate_flow_rate:"Laske virtausnopeus",circle_animation:"Ympyräanimaatio",clickable_entities:"Napautettavat kohteet",color:"Väri",color_circle:"Ympyrän väri",color_dynamically:"Väri dynaamisesti",color_icon:"Ikonin väri",color_state_of_charge_value:"Väri",color_value:"Arvon väri",combined:"Yhdistetty kokonaisuus (yksi kokonaisuus positiivisilla ja negatiivisilla arvoilla)",consumption:"Kulutus",custom:"Mukautettu",custom_colors:"Mukautetut värit",dashboard_link:"Ohjauspaneelin linkki",dashboard_link_label:"Ohjauspaneelin linkin nimi",decimals:"Desimaalit",disable_dots:"Poista pisteet",display_state:"Näytä tila",display_zero:"Näytä nolla",display_zero_lines:"Näytä nolla-viivat",display_zero_state:"Näytä nolla-tila",display_zero_tolerance:"Näytä nolla-toleranssi",double_tap_action:"Kaksoisnapautustoiminto",entity_generator:"Generaattori",fossil_fuel_percentage:"Fossiilinen polttoaine",grey_color:"Harmaa väri",grey_out:"Harmaa",grid:"Sähköverkko",hide:"Piilota",hold_action:"Pidä painettuna -toiminto",home:"Koti",icon_alert:"Hälytyksen kuvake",individual:"Yksittäinen",invert_state:"Käänteinen tila",inverted_animation:"Käänteinen animaatio",kw_decimals:"Kilowattien desimaalit",kwh_decimals:"kWhien desimaalit",kwh_threshold:"kWhin ja MWhin kynnysarvo",label_alert:"Hälytyksen teksti",max_expected_power:"Ennustettu maksimiteho",max_flow_rate:"Maksimivirtausnopeus",min_expected_power:"Ennustettu minimiteho",min_flow_rate:"Minimivirtausnopeus",mode:"Tila",mwh_decimals:"MWhien desimaalit",mwh_threshold:"MWhin ja TWhin kynnysarvo",navigation_path:"Navigointipolku",no_color:"Ei väriä",no_labels:"Ei nimiöitä",override_state:"Korvaa tila",power_outage:"Sähkökatkos",production:"Tuotanto",secondary_info:"Toissijaiset tiedot",separated:"Erotetut kokonaisuudet (yksi kulutukseen ja yksi tuotantoon)",show:"Näytä",show_direction:"Näytä suunta",show_state_of_charge:"Näytä varauksen tila",solar:"Aurinko",sort_individual_devices:"Lajittele yksittäiset laitteet",state_alert:"Hälytyksen tila",state_of_charge:"Varauksen tila",state_of_charge_decimals:"Desimaalit",state_of_charge_icon:"Kuvake",state_of_charge_unit:"Yksikkö",state_of_charge_unit_white_space:"Välilyönti",state_type:"Tilan tyyppi",subtract_individual:"Vähennä yksittäinen",sum_total:"Summaa aurinko ja toissijainen",tap_action:"Napauta toimintoa",template:"Malli",transparency:"Läpinäkyvyys",unit_of_measurement:"Yksikkö",unit_white_space:"Yksikön välilyönti",use_metadata:"Käytä metatietoja",use_new_flow_rate_model:"Uusi virtausnopeusmalli",w_decimals:"Wattien desimaalit",watt_threshold:"Wattin ja kilowatin kynnysarvo",wh_decimals:"Whien desimaalit",wh_threshold:"Whin ja kWhin kynnysarvo"},bo={card:go,editor:vo},wo=Object.freeze({__proto__:null,card:go,default:bo,editor:vo}),ko={label:{car:"Voiture",motorbike:"Moto"}},$o={accept_negative:"Accepter les valeurs négatives",action:"Action",advanced:"Options avancées",allow_layout_break:"Autoriser la rupture de mise en page",battery:"Batterie",calculate_flow_rate:"Calculer le débit",circle_animation:"Animation de cercle",clickable_entities:"Entités cliquables",color:"Couleur",color_circle:"Couleur du cercle",color_dynamically:"Couleur dynamique",color_icon:"Couleur de l'icône",color_state_of_charge_value:"Couleur",color_value:"Couleur de la valeur",combined:"Entité combinée (une entité avec des valeurs positives et négatives)",consumption:"Consommation",custom:"Personnalisé",custom_colors:"Couleurs personnalisées",dashboard_link:"Lien du tableau de bord",dashboard_link_label:"Nom du lien du tableau de bord",decimals:"Décimales",disable_dots:"Désactiver les points",display_state:"Afficher l'état",display_zero:"Afficher zéro",display_zero_lines:"Afficher les lignes zéro",display_zero_state:"Afficher l'état zéro",display_zero_tolerance:"Tolérance de l'affichage zéro",double_tap_action:"Action de double tap",entity_generator:"Générateur",fossil_fuel_percentage:"Carburant fossile",grey_color:"Couleur grise",grey_out:"Griser",grid:"Réseau Électrique",hide:"Masquer",hold_action:"Action d'appui long",home:"Domicile",icon_alert:"Icône de l'alerte",individual:"Individuel",invert_state:"Inverser l'état",inverted_animation:"Animation inversée",kw_decimals:"Décimales de kilowatt",kwh_decimals:"Décimales de kWh",kwh_threshold:"Seuil de kWh vers MWh",label_alert:"Libellé de l'alerte",max_expected_power:"Puissance maximale attendue",max_flow_rate:"Débit maximal",min_expected_power:"Puissance minimale attendue",min_flow_rate:"Débit minimal",mode:"Mode",mwh_decimals:"Décimales de MWh",mwh_threshold:"Seuil de MWh vers TWh",navigation_path:"Chemin de navigation",no_color:"Aucune couleur",no_labels:"Sans libellés",override_state:"Remplacer l'état",power_outage:"Panne de courant",production:"Production",secondary_info:"Informations secondaires",separated:"Entités séparées (une entité pour la consommation et une pour la production)",show:"Afficher",show_direction:"Afficher la direction",show_state_of_charge:"Afficher l'état de charge",solar:"Solaire",sort_individual_devices:"Trier les appareils individuels",state_alert:"État de l'alerte",state_of_charge:"État de charge",state_of_charge_decimals:"Décimales",state_of_charge_icon:"Icône",state_of_charge_unit:"Unité",state_of_charge_unit_white_space:"Espace blanc de l'unité",state_type:"Type d'état",subtract_individual:"Soustraire l'individuel",sum_total:"Somme solaire et secondaire",tap_action:"Action de tap",template:"Modèle",transparency:"Transparence",unit_of_measurement:"Unité",unit_white_space:"Espace blanc de l'unité",use_metadata:"Utiliser les métadonnées",use_new_flow_rate_model:"Nouveau modèle de débit",w_decimals:"Décimales de watt",watt_threshold:"Seuil de watt vers kilowatt",wh_decimals:"Décimales de Wh",wh_threshold:"Seuil de Wh vers kWh"},xo={card:ko,editor:$o},So=Object.freeze({__proto__:null,card:ko,default:xo,editor:$o}),Eo={label:{car:"कार",motorbike:"मोटरसाइकिल"}},Co={accept_negative:"नकारात्मक स्वीकार करें",action:"क्रिया",advanced:"उन्नत विकल्प",allow_layout_break:"लेआउट तोड़ने की अनुमति दें",battery:"बैटरी",calculate_flow_rate:"प्रवाह दर की गणना करें",circle_animation:"सर्कल एनिमेशन",clickable_entities:"क्लिक करने योग्य इकाइयाँ",color:"रंग",color_circle:"सर्कल का रंग",color_dynamically:"गतिशील रंग",color_icon:"आइकन का रंग",color_state_of_charge_value:"रंग",color_value:"मान का रंग",combined:"संयुक्त इकाई (सकारात्मक और नकारात्मक मानों के साथ)",consumption:"उपभोग",custom:"कस्टम",custom_colors:"कस्टम रंग",dashboard_link:"डैशबोर्ड लिंक",dashboard_link_label:"डैशबोर्ड लिंक नाम",decimals:"दशमलव",disable_dots:"डॉट्स अक्षम करें",display_state:"स्थिति दिखाएँ",display_zero:"शून्य दिखाएँ",display_zero_lines:"शून्य रेखाएँ दिखाएँ",display_zero_state:"शून्य स्थिति दिखाएँ",display_zero_tolerance:"शून्य सहिष्णुता दिखाएँ",double_tap_action:"डबल टैप क्रिया",entity_generator:"जनरेटर",fossil_fuel_percentage:"जीवाश्म ईंधन",grey_color:"धूसर रंग",grey_out:"धूसर करें",grid:"ग्रिड",hide:"छुपाएँ",hold_action:"होल्ड क्रिया",home:"घर",icon_alert:"अलर्ट के लिए आइकन",individual:"व्यक्तिगत",invert_state:"स्थिति उलटें",inverted_animation:"एनिमेशन उलटें",kw_decimals:"किलोवाट दशमलव",kwh_decimals:"kWh दशमलव",kwh_threshold:"kWh से MWh सीमा",label_alert:"अलर्ट के लिए लेबल",max_expected_power:"अधिकतम अपेक्षित शक्ति",max_flow_rate:"अधिकतम प्रवाह दर",min_expected_power:"न्यूनतम अपेक्षित शक्ति",min_flow_rate:"न्यूनतम प्रवाह दर",mode:"मोड",mwh_decimals:"MWh दशमलव",mwh_threshold:"MWh से TWh सीमा",navigation_path:"नेविगेशन पथ",no_color:"कोई रंग नहीं",no_labels:"कोई लेबल नहीं",override_state:"स्थिति ओवरराइड करें",power_outage:"बिजली गुल",production:"उत्पादन",secondary_info:"द्वितीयक जानकारी",separated:"अलग-अलग इकाइयाँ (उपभोग और उत्पादन के लिए)",show:"दिखाएँ",show_direction:"दिशा दिखाएँ",show_state_of_charge:"चार्ज की स्थिति दिखाएँ",solar:"सौर ऊर्जा",sort_individual_devices:"व्यक्तिगत डिवाइस क्रमबद्ध करें",state_alert:"अलर्ट की स्थिति",state_of_charge:"चार्ज की स्थिति",state_of_charge_decimals:"दशमलव",state_of_charge_icon:"आइकन",state_of_charge_unit:"इकाई",state_of_charge_unit_white_space:"स्पेस",state_type:"स्थिति प्रकार",subtract_individual:"व्यक्तिगत घटाएँ",sum_total:"सौर और द्वितीयक का योग",tap_action:"टैप क्रिया",template:"टेम्पलेट",transparency:"पारदर्शिता",unit_of_measurement:"माप की इकाई",unit_white_space:"यूनिट स्पेस",use_metadata:"मेटाडेटा का उपयोग करें",use_new_flow_rate_model:"नया प्रवाह दर मॉडल",w_decimals:"वाट दशमलव",watt_threshold:"वाट से किलोवाट सीमा",wh_decimals:"Wh दशमलव",wh_threshold:"Wh से kWh सीमा"},Ao={card:Eo,editor:Co},Mo=Object.freeze({__proto__:null,card:Eo,default:Ao,editor:Co}),Po={label:{car:"Auto",motorbike:"Motocicletta"}},Do={accept_negative:"Accetta Valori Negativi",action:"Azione",advanced:"Opzioni Avanzate",allow_layout_break:"Consenti interruzione del layout",battery:"Batteria",calculate_flow_rate:"Calcola Tasso di Flusso",circle_animation:"Animazione Cerchio",clickable_entities:"Entità Cliccabili",color:"Colore",color_circle:"Colore del Cerchio",color_dynamically:"Colore dinamico",color_icon:"Colore dell'Icona",color_state_of_charge_value:"Colore",color_value:"Colore del Valore",combined:"Entità combinata (un'entità con valori positivi e negativi)",consumption:"Consumo",custom:"Personalizzato",custom_colors:"Colori personalizzati",dashboard_link:"Collegamento Dashboard",dashboard_link_label:"Nome Collegamento Dashboard",decimals:"Decimali",disable_dots:"Disabilita Punti",display_state:"Mostra Stato",display_zero:"Mostra Zero",display_zero_lines:"Mostra Linee Zero",display_zero_state:"Mostra Stato Zero",display_zero_tolerance:"Tolleranza dello Zero",double_tap_action:"Azione al doppio tocco",entity_generator:"Generatore",fossil_fuel_percentage:"Carburante Fossile",grey_color:"Colore Sfumato",grey_out:"Sfuma",grid:"Rete Elettrica",hide:"Nascondi",hold_action:"Azione alla pressione prolungata",home:"Casa",icon_alert:"Icona per l'Allarme",individual:"Individuale",invert_state:"Inverti Stato",inverted_animation:"Animazione Invertita",kw_decimals:"Decimali Kilowatt",kwh_decimals:"Decimali kWh",kwh_threshold:"Soglia kWh per MWh",label_alert:"Etichetta per l'Allarme",max_expected_power:"Potenza Massima Prevista",max_flow_rate:"Tasso di Flusso Massimo",min_expected_power:"Potenza Minima Prevista",min_flow_rate:"Tasso di Flusso Minimo",mode:"Modalità",mwh_decimals:"Decimali MWh",mwh_threshold:"Soglia MWh per TWh",navigation_path:"Percorso di navigazione",no_color:"Nessun colore",no_labels:"Senza etichette",override_state:"Sovrascrivi Stato",power_outage:"Interruzione di corrente",production:"Produzione",secondary_info:"Informazioni secondarie",separated:"Entità separate (Un'entità per il consumo e una per la produzione)",show:"Mostra",show_direction:"Mostra Direzione",show_state_of_charge:"Mostra Stato di Carica",solar:"Solare",sort_individual_devices:"Ordina i singoli individuale",state_alert:"Stato dell'Allarme",state_of_charge:"Stato di Carica",state_of_charge_decimals:"Decimali",state_of_charge_icon:"Icona",state_of_charge_unit:"Unità",state_of_charge_unit_white_space:"Spazio Bianco",state_type:"Tipo di Stato",subtract_individual:"Sottrai Individualmente",sum_total:"Somma solare e secondaria",tap_action:"Azione al tocco",template:"Modello",transparency:"Trasparenza",unit_of_measurement:"Unità",unit_white_space:"Spazio Bianco Unità",use_metadata:"Utilizza Metadati",use_new_flow_rate_model:"Utilizza Nuovo Modello di Tasso di Flusso",w_decimals:"Decimali Watt",watt_threshold:"Soglia Watt per Kilowatt",wh_decimals:"Decimali Wh",wh_threshold:"Soglia Wh per kWh"},zo={card:Po,editor:Do},To=Object.freeze({__proto__:null,card:Po,default:zo,editor:Do}),Oo={label:{car:"Auto",motorbike:"Motorfiets"}},No={accept_negative:"Negatieve waarden accepteren",action:"Actie",advanced:"Geavanceerde Opties",allow_layout_break:"Lay-out doorbreken toestaan",battery:"Batterij",calculate_flow_rate:"Stroomsnelheid Berekenen",circle_animation:"Cirkel Animatie",clickable_entities:"Klikbare Entiteiten",color:"Kleur",color_circle:"Kleur van Cirkel",color_dynamically:"Kleur dynamisch",color_icon:"Kleur van Pictogram",color_state_of_charge_value:"Kleur",color_value:"Kleur van Waarde",combined:"Gecombineerde entiteit (één entiteit met positieve en negatieve waarden)",consumption:"Verbruik",custom:"Aangepast",custom_colors:"Aangepaste kleuren",dashboard_link:"Dashboard-link",dashboard_link_label:"Naam van Dashboard Link",decimals:"Decimalen",disable_dots:"Punten Uitschakelen",display_state:"Toestand Weergeven",display_zero:"Nul Weergeven",display_zero_lines:"Nullijnen Weergeven",display_zero_state:"Nul Toestand Weergeven",display_zero_tolerance:"Nultolerantie Weergeven",double_tap_action:"Dubbel tik actie",entity_generator:"Generator",fossil_fuel_percentage:"Fossiele Brandstof",grey_color:"Grijstint",grey_out:"Grijstint",grid:"Elektriciteitsnet",hide:"Verbergen",hold_action:"Ingedrukt houden actie",home:"Thuis",icon_alert:"Pictogram voor Alarm",individual:"Individueel",invert_state:"Toestand Omkeren",inverted_animation:"Animatie Omkeren",kw_decimals:"Kilowatt Decimalen",kwh_decimals:"kWh Decimalen",kwh_threshold:"kWh naar MWh Drempelwaarde",label_alert:"Label voor Alarm",max_expected_power:"Maximaal Verwacht Vermogen",max_flow_rate:"Maximale Stroomsnelheid",min_expected_power:"Minimaal Verwacht Vermogen",min_flow_rate:"Minimale Stroomsnelheid",mode:"Modus",mwh_decimals:"MWh Decimalen",mwh_threshold:"MWh naar TWh Drempelwaarde",navigation_path:"Navigatiepad",no_color:"Geen kleur",no_labels:"Geen labels",override_state:"Toestand Overschrijven",power_outage:"Stroomuitval",production:"Productie",secondary_info:"Secundaire informatie",separated:"Gescheiden entiteiten (één entiteit voor consumptie en één voor productie)",show:"Weergeven",show_direction:"Richting Weergeven",show_state_of_charge:"Laadstatus Weergeven",solar:"Zonne-energie",sort_individual_devices:"Sorteer individuele apparaten",state_alert:"Toestand van Alarm",state_of_charge:"Laadstatus",state_of_charge_decimals:"Decimalen",state_of_charge_icon:"Pictogram",state_of_charge_unit:"Eenheid",state_of_charge_unit_white_space:"Spaties",state_type:"Type Toestand",subtract_individual:"Individueel Aftrekken",sum_total:"Som van zon en secundair",tap_action:"Tik Actie",template:"Sjabloon",transparency:"Transparantie",unit_of_measurement:"Eenheid",unit_white_space:"Eenheid Spaties",use_metadata:"Metadata Gebruiken",use_new_flow_rate_model:"Nieuw Stroomsnelheid Model Gebruiken",w_decimals:"Watt Decimalen",watt_threshold:"Watt naar Kilowatt Drempelwaarde",wh_decimals:"Wh Decimalen",wh_threshold:"Wh naar kWh Drempelwaarde"},Wo={card:Oo,editor:No},jo=Object.freeze({__proto__:null,card:Oo,default:Wo,editor:No}),Bo={label:{car:"Samochód",motorbike:"Motocykl"}},Uo={accept_negative:"Akceptuj wartości ujemne",action:"Akcja",advanced:"Zaawansowane opcje",allow_layout_break:"Zezwól na łamanie układu",battery:"Bateria",calculate_flow_rate:"Oblicz wskaźnik przepływu",circle_animation:"Animacja okręgu",clickable_entities:"Klikalne jednostki",color:"Kolor",color_circle:"Kolor okręgu",color_dynamically:"Kolor dynamicznie",color_icon:"Kolor ikony",color_state_of_charge_value:"Kolor",color_value:"Kolor wartości",combined:"Jednostka połączona (jedna jednostka z wartościami dodatnimi i ujemnymi)",consumption:"Zużycie",custom:"Niestandardowy",custom_colors:"Kolory niestandardowe",dashboard_link:"Link do panelu",dashboard_link_label:"Nazwa linku do panelu",decimals:"Miejsca po przecinku",disable_dots:"Wyłącz kropki",display_state:"Wyświetl stan",display_zero:"Wyświetl zero",display_zero_lines:"Wyświetl linie zera",display_zero_state:"Wyświetl stan zera",display_zero_tolerance:"Wyświetl tolerancję zera",double_tap_action:"Akcja podwójnego dotknięcia",entity_generator:"Generator",fossil_fuel_percentage:"Paliwo kopalne",grey_color:"Kolor szary",grey_out:"Szary",grid:"Sieć elektryczna",hide:"Ukryj",hold_action:"Akcja przytrzymania",home:"Dom",icon_alert:"Ikona alertu",individual:"Indywidualne",invert_state:"Odwróć stan",inverted_animation:"Odwróć animację",kw_decimals:"Miejsca po przecinku dla kilowatów",kwh_decimals:"Miejsca po przecinku dla kWh",kwh_threshold:"Próg kWh na MWh",label_alert:"Etykieta alertu",max_expected_power:"Maksymalna oczekiwana moc",max_flow_rate:"Maksymalna szybkość przepływu",min_expected_power:"Minimalna oczekiwana moc",min_flow_rate:"Minimalna szybkość przepływu",mode:"Tryb",mwh_decimals:"Miejsca po przecinku dla MWh",mwh_threshold:"Próg MWh na TWh",navigation_path:"Ścieżka nawigacji",no_color:"Bez koloru",no_labels:"Bez etykiet",override_state:"Nadpisanie stanu",power_outage:"Brak prądu",production:"Produkcja",secondary_info:"Informacje dodatkowe",separated:"Oddzielne podmioty (jeden podmiot do konsumpcji i jeden do produkcji)",show:"Pokaż",show_direction:"Pokaż kierunek",show_state_of_charge:"Pokaż stan naładowania",solar:"Energia słoneczna",sort_individual_devices:"Sortuj poszczególne urządzenia",state_alert:"Stan alertu",state_of_charge:"Stan naładowania",state_of_charge_decimals:"Miejsca po przecinku",state_of_charge_icon:"Ikona",state_of_charge_unit:"Jednostka",state_of_charge_unit_white_space:"Spacja jednostki",state_type:"Typ stanu",subtract_individual:"Odjęcie indywidualne",sum_total:"Zsumuj słoneczne i dodatkowe",tap_action:"Akcja dotknięcia",template:"Szablon",transparency:"Przezroczystość",unit_of_measurement:"Jednostka",unit_white_space:"Spacja jednostki",use_metadata:"Użyj metadanych",use_new_flow_rate_model:"Nowy model wskaźnika przepływu",w_decimals:"Miejsca po przecinku dla watów",watt_threshold:"Próg watów na kilowaty",wh_decimals:"Miejsca po przecinku dla Wh",wh_threshold:"Próg Wh na kWh"},Ho={card:Bo,editor:Uo},Lo=Object.freeze({__proto__:null,card:Bo,default:Ho,editor:Uo}),Io={label:{car:"Carro",motorbike:"Mota"}},Ro={accept_negative:"Aceitar Valores Negativos",action:"Ação",advanced:"Opções Avançadas",allow_layout_break:"Permitir quebra de layout",battery:"Bateria",calculate_flow_rate:"Calcular Taxa de Fluxo",circle_animation:"Animação de Círculo",clickable_entities:"Entidades Clicáveis",color:"Cor",color_circle:"Cor do Círculo",color_dynamically:"Cor dinâmica",color_icon:"Cor do Ícone",color_state_of_charge_value:"Cor",color_value:"Cor do Valor",combined:"Entidade combinada (uma entidade com valores positivos e negativos)",consumption:"Consumo",custom:"Personalizado",custom_colors:"Cores personalizadas",dashboard_link:"Link do Painel",dashboard_link_label:"Nome do Link do Painel",decimals:"Casas Decimais",disable_dots:"Desativar Pontos",display_state:"Exibir Estado",display_zero:"Exibir Zero",display_zero_lines:"Exibir Linhas Zero",display_zero_state:"Exibir Estado Zero",display_zero_tolerance:"Tolerância de Zero",double_tap_action:"Ação de Toque Duplo",entity_generator:"Gerador",fossil_fuel_percentage:"Combustíveis Fósseis",grey_color:"Cor do Cinza",grey_out:"Cinza",grid:"Rede",hide:"Esconder",hold_action:"Ação ao Segurar",home:"Casa",icon_alert:"Ícone para Alerta",individual:"Individuais",invert_state:"Inverter Estado",inverted_animation:"Animação Invertida",kw_decimals:"Casas Decimais de Quilowatts",kwh_decimals:"Casas Decimais de kWh",kwh_threshold:"Limiar de kWh para MWh",label_alert:"Rótulo para Alerta",max_expected_power:"Potência Máxima Esperada",max_flow_rate:"Taxa de Fluxo Máxima",min_expected_power:"Potência Mínima Esperada",min_flow_rate:"Taxa de Fluxo Mínima",mode:"Modo",mwh_decimals:"Casas Decimais de MWh",mwh_threshold:"Limiar de MWh para TWh",navigation_path:"Caminho de Navegação",no_color:"Sem cor",no_labels:"Sem rótulos",override_state:"Substituir Estado",power_outage:"Falta de energia",production:"Produção",secondary_info:"Informação Secundária",separated:"Entidades Separadas (Uma entidade para consumo e outra para produção)",show:"Mostrar",show_direction:"Mostrar Direção",show_state_of_charge:"Exibir Estado de Carga",solar:"Energia solar",sort_individual_devices:"Classifique dispositivos individuais",state_alert:"Estado do Alerta",state_of_charge:"Estado de Carga",state_of_charge_decimals:"Casas Decimais",state_of_charge_icon:"Ícone",state_of_charge_unit:"Unidade",state_of_charge_unit_white_space:"Espaçamento",state_type:"Tipo de Estado",subtract_individual:"Subtrair Individualmente",sum_total:"Somar solar e secundário",tap_action:"Ação de Toque",template:"Modelo",transparency:"Transparência",unit_of_measurement:"Unidade",unit_white_space:"Espaçamento da Unidade",use_metadata:"Utilizar Metadados",use_new_flow_rate_model:"Utilizar Novo Modelo de Velocidade",w_decimals:"Casas Decimais de Watts",watt_threshold:"Limiar de Watts para Quilowatts",wh_decimals:"Casas Decimais de Wh",wh_threshold:"Limiar de Wh para kWh"},Fo={card:Io,editor:Ro},Go=Object.freeze({__proto__:null,card:Io,default:Fo,editor:Ro}),Vo={label:{car:"Carro",motorbike:"Mota"}},Zo={accept_negative:"Aceitar Valores Negativos",action:"Ação",advanced:"Opções Avançadas",allow_layout_break:"Permitir quebra de layout",battery:"Bateria",calculate_flow_rate:"Calcular Taxa de Fluxo",circle_animation:"Animação de Círculo",clickable_entities:"Entidades Clicáveis",color:"Cor",color_circle:"Cor do Círculo",color_dynamically:"Cor dinâmica",color_icon:"Cor do Ícone",color_state_of_charge_value:"Cor",color_value:"Cor do Valor",combined:"Entidade combinada (uma entidade com valores positivos e negativos)",consumption:"Consumo",custom:"Personalizado",custom_colors:"Cores personalizadas",dashboard_link:"Link do Painel de Controlo",dashboard_link_label:"Nome do Link do Painel de Controlo",decimals:"Casas Decimais",disable_dots:"Desativar Pontos",display_state:"Mostrar Estado",display_zero:"Mostrar Zero",display_zero_lines:"Mostrar Linhas Zero",display_zero_state:"Mostrar Estado Zero",display_zero_tolerance:"Tolerância do Zero",double_tap_action:"Ação de Toque Duplo",entity_generator:"Gerador",fossil_fuel_percentage:"Combustíveis Fósseis",grey_color:"Cor Cinzenta",grey_out:"Cinzento",grid:"Rede",hide:"Esconder",hold_action:"Ação ao Segurar",home:"Casa",icon_alert:"Ícone para Alerta",individual:"Individuais",invert_state:"Inverter Estado",inverted_animation:"Animação Invertida",kw_decimals:"Casas Decimais de Quilowatt",kwh_decimals:"Casas Decimais de kWh",kwh_threshold:"Limiar de kWh para MWh",label_alert:"Nome para Alerta",max_expected_power:"Potência Máxima Esperada",max_flow_rate:"Taxa de Fluxo Máxima",min_expected_power:"Potência Mínima Esperada",min_flow_rate:"Taxa de Fluxo Mínima",mode:"Modo",mwh_decimals:"Casas Decimais de MWh",mwh_threshold:"Limiar de MWh para TWh",navigation_path:"Caminho de Navegação",no_color:"Sem cor",no_labels:"Sem etiquetas",override_state:"Substituir Estado",power_outage:"Falta de energia",production:"Produção",secondary_info:"Informação Secundária",separated:"Entidades Separadas (Uma entidade para consumo e outra para produção)",show:"Mostrar",show_direction:"Mostrar Direção",show_state_of_charge:"Mostrar Estado de Carga",solar:"Energia solar",sort_individual_devices:"Classifique dispositivos individuais",state_alert:"Estado do Alerta",state_of_charge:"Estado de Carga",state_of_charge_decimals:"Casas Decimais",state_of_charge_icon:"Ícone",state_of_charge_unit:"Unidade",state_of_charge_unit_white_space:"Espaçamento",state_type:"Tipo de Estado",subtract_individual:"Subtrair Individualmente",sum_total:"Somar solar e secundário",tap_action:"Ação de Toque",template:"Modelo",transparency:"Transparência",unit_of_measurement:"Unidade",unit_white_space:"Espaçamento da Unidade",use_metadata:"Utilizar Metadados",use_new_flow_rate_model:"Utilizar Novo Modelo de Velocidade",w_decimals:"Casas Decimais de Watt",watt_threshold:"Limiar de Watt para Quilowatt",wh_decimals:"Casas Decimais de Wh",wh_threshold:"Limiar de Wh para kWh"},Ko={card:Vo,editor:Zo},qo={label:{car:"Автомобиль",motorbike:"Мотоцикл"}},Yo={accept_negative:"Принять отрицательные значения",action:"Действие",advanced:"Расширенные настройки",allow_layout_break:"Разрешить разрыв макета",battery:"Батарея",calculate_flow_rate:"Рассчитать скорость потока",circle_animation:"Анимация круга",clickable_entities:"Кликабельные сущности",color:"Цвет",color_circle:"Цвет круга",color_dynamically:"Цвет динамически",color_icon:"Цвет иконки",color_state_of_charge_value:"Цвет",color_value:"Цвет значения",combined:"Комбинированный объект (один объект с положительными и отрицательными значениями)",consumption:"Потребление",custom:"Пользовательский",custom_colors:"Пользовательские цвета",dashboard_link:"Ссылка на панель управления",dashboard_link_label:"Название ссылки на панель управления",decimals:"Десятичные",disable_dots:"Отключить точки",display_state:"Отображать состояние",display_zero:"Отображать ноль",display_zero_lines:"Отображать нулевые линии",display_zero_state:"Отображать состояние нуля",display_zero_tolerance:"Допустимая погрешность нуля",double_tap_action:"действие двойного касания",entity_generator:"Генератор",fossil_fuel_percentage:"Полный объем ископаемого топлива",grey_color:"Серый цвет",grey_out:"Серый",grid:"Электрическая сеть",hide:"Скрыть",hold_action:"действие удержания",home:"Домашняя",icon_alert:"Иконка для предупреждения",individual:"Индивидуальная",invert_state:"Инвертировать состояние",inverted_animation:"Инвертированная анимация",kw_decimals:"Десятичные киловатт",kwh_decimals:"Десятичные kWh",kwh_threshold:"Пороговое значение kWh в MWh",label_alert:"Метка для предупреждения",max_expected_power:"Максимальная ожидаемая мощность",max_flow_rate:"Максимальная скорость потока",min_expected_power:"Минимальная ожидаемая мощность",min_flow_rate:"Минимальная скорость потока",mode:"Режим",mwh_decimals:"Десятичные MWh",mwh_threshold:"Пороговое значение MWh в TWh",navigation_path:"путь навигации",no_color:"Без цвета",no_labels:"Без подписей",override_state:"Переопределить состояние",power_outage:"Отключение электричества",production:"Производство",secondary_info:"Вторичная информация",separated:"Отдельные объекты (один объект для потребления и один для производства)",show:"Показать",show_direction:"Показать направление",show_state_of_charge:"Показать уровень заряда",solar:"Солнечная",sort_individual_devices:"Сортировка отдельных устройств",state_alert:"Состояние предупреждения",state_of_charge:"Уровень заряда",state_of_charge_decimals:"Десятичные",state_of_charge_icon:"Иконка",state_of_charge_unit:"Единица измерения",state_of_charge_unit_white_space:"Пробел",state_type:"Тип состояния",subtract_individual:"Вычесть индивидуально",sum_total:"Суммировать солнечную и вторичную",tap_action:"действие касания",template:"Шаблон",transparency:"Прозрачность",unit_of_measurement:"Единица измерения",unit_white_space:"Пробел единицы измерения",use_metadata:"Использовать метаданные",use_new_flow_rate_model:"Использовать новую модель скорости потока",w_decimals:"Десятичные ватт",watt_threshold:"Пороговое значение ватт в киловатты",wh_decimals:"Десятичные Wh",wh_threshold:"Пороговое значение Wh в kWh"},Xo={card:qo,editor:Yo},Jo={label:{car:"Auto",motorbike:"Motorka"}},Qo={accept_negative:"Povoliť záporné hodnoty",action:"Akcia",advanced:"Pokročilé nastavenia",allow_layout_break:"Povoliť zalomenie rozloženia",battery:"Batéria",calculate_flow_rate:"Počítať prietok",circle_animation:"Kruhová animácia",clickable_entities:"Entity, na ktoré sa dá kliknúť",color:"Farba",color_circle:"Farba kruhu",color_dynamically:"Farba dynamicky",color_icon:"Farba ikony",color_state_of_charge_value:"Farba",color_value:"Farba hodnoty",combined:"Kombinovaná entita (jedna entita s kladnými a zápornými hodnotami)",consumption:"Spotreba",custom:"Voliteľné",custom_colors:"Vlastné farby",dashboard_link:"Odkaz na informačný panel",dashboard_link_label:"Názov odkazu na informačný panel",decimals:"Desatinné",disable_dots:"Vypnúť bodky",display_state:"Zobraziť stav",display_zero:"Zobraziť nulu",display_zero_lines:"Zobraziť nulové riadky",display_zero_state:"Zobrazenie nulového stavu",display_zero_tolerance:"Zobraziť nulovú toleranciu",double_tap_action:"Akcia pri dvojitom klepnutí",entity_generator:"Generátor",fossil_fuel_percentage:"Fosílne palivo",grey_color:"Šedá farba",grey_out:"Zosiviť",grid:"Sieť",hide:"Skryť",hold_action:"Akcia pri podržaní",home:"Doma",icon_alert:"Ikona pre upozornenie",individual:"Individuálne",invert_state:"Invertovať stav",inverted_animation:"Invertovať animáciu",kw_decimals:"Kilowattové desatinné miesta",kwh_decimals:"Desatinné miesta kWh",kwh_threshold:"Prah kWh na MWh",label_alert:"Štítok pre upozornenie",max_expected_power:"Max očakávaný výkon",max_flow_rate:"Max prietok",min_expected_power:"Min očakávaný výkon",min_flow_rate:"Min prietok",mode:"Mód",mwh_decimals:"Desatinné miesta MWh",mwh_threshold:"Prah MWh na TWh",navigation_path:"Navigačná cesta",no_color:"Bez farby",no_labels:"Bez popisov",override_state:"Prepísať stav",power_outage:"Výpadok",production:"Výroba",secondary_info:"Sekundárne informácie",separated:"Oddelené subjekty (jeden subjekt pre spotrebu a jeden pre výrobu)",show:"Zobraziť",show_direction:"Zobraziť smer",show_state_of_charge:"Zobraziť stav nabitia",solar:"Solárne",sort_individual_devices:"Zoraďte jednotlivé zariadenia",state_alert:"Stav upozornenia",state_of_charge:"Stav nabitia",state_of_charge_decimals:"Desatinné",state_of_charge_icon:"Ikona",state_of_charge_unit:"Jednotky",state_of_charge_unit_white_space:"Biela plocha",state_type:"Typ stavu",subtract_individual:"Odčítať individuálne",sum_total:"Sčítať solárne a sekundárne",tap_action:"Akcia po klepnutí",template:"Šablóna",transparency:"Transparentnosť",unit_of_measurement:"Jednotka",unit_white_space:"Jednotka bielej plochy",use_metadata:"Použiť Metadata",use_new_flow_rate_model:"Nový model prietoku",w_decimals:"Wattové desatinné miesta",watt_threshold:"Prah wattov na kilowatty",wh_decimals:"Desatinné miesta Wh",wh_threshold:"Prah Wh na kWh"},ea={card:Jo,editor:Qo},ta={label:{car:"Bil",motorbike:"Motorcykel"}},ia={accept_negative:"Acceptera negativa värden",action:"Åtgärd",advanced:"Avancerade inställningar",allow_layout_break:"Tillåt layoutbrytning",battery:"Batteri",calculate_flow_rate:"Beräkna flöde",circle_animation:"Cirkelanimation",clickable_entities:"Klickbara entiteter",color:"Färg",color_circle:"Cirkelfärg",color_dynamically:"Färg dynamiskt",color_icon:"Ikonfärg",color_state_of_charge_value:"Färg",color_value:"Färg på värde",combined:"Sammansatt entitet (en entitet med postitiva och negativa värden)",consumption:"Konsumtion",custom:"Anpassad",custom_colors:"Anpassade färger",dashboard_link:"Länk till kontrollpanel",dashboard_link_label:"Länknamn till kontrollpanel",decimals:"Decimaler",disable_dots:"Avaktivera punkter",display_state:"Visningsläge",display_zero:"Visa vid nollvärde",display_zero_lines:"Vising av inaktiva linjer",display_zero_state:"Visning vid noll",display_zero_tolerance:"Tolerans för nollvärde",double_tap_action:"Dubbeltrycksåtgärd",entity_generator:"Generator",fossil_fuel_percentage:"Fossilt bränsle",grey_color:"Grå färg",grey_out:"Utgråad",grid:"Nät",hide:"Dölj",hold_action:"Hålltrycksåtgärd",home:"Hem",icon_alert:"Varningsikon",individual:"Individuell",invert_state:"Invertera status",inverted_animation:"Reversera animation",kw_decimals:"Decimaler kilowatt",kwh_decimals:"Decimaler kWh",kwh_threshold:"Tröskelvärde för MWh",label_alert:"Varningsetikett",max_expected_power:"Maximal förväntad effekt",max_flow_rate:"Maximalt flöde",min_expected_power:"Minimal förväntad effekt",min_flow_rate:"Minimalt flöde",mode:"Läge",mwh_decimals:"Decimaler MWh",mwh_threshold:"Tröskelvärde för TWh",navigation_path:"Navigationsväg",no_color:"Ingen färg",no_labels:"Inga etiketter",override_state:"Använd entitetsvärde",power_outage:"Strömavbrott",production:"Produktion",secondary_info:"Sekundär information",separated:"Separata entiteter (en entitet för konsumtion och en för produktion)",show:"Visa",show_direction:"Visa riktning",show_state_of_charge:"Visa laddningsnivå",solar:"Sol",sort_individual_devices:"Sortera enskilda enheter",state_alert:"Status vid strömavbrott",state_of_charge:"Laddningsnivå",state_of_charge_decimals:"Decimaler",state_of_charge_icon:"Ikon",state_of_charge_unit:"Enhet",state_of_charge_unit_white_space:"Mellanrum före enhet",state_type:"Statustyp",subtract_individual:"Individuell avräkning",sum_total:"Summera sol och sekundär",tap_action:"Tryckåtgärd",template:"Mall",transparency:"Transparens",unit_of_measurement:"Enhet",unit_white_space:"Mellanrum före enhet",use_metadata:"Använd metadata",use_new_flow_rate_model:"Ny flödesmodell",w_decimals:"Decimaler watt",watt_threshold:"Tröskelvärde för kiloprefix",wh_decimals:"Decimaler Wh",wh_threshold:"Tröskelvärde för kWh"},oa={card:ta,editor:ia},aa={label:{car:"Автомобіль",motorbike:"Мотоцикл"}},na={accept_negative:"Дозволити від’ємні значення",action:"Дія",advanced:"Розширені параметри",allow_layout_break:"Дозволити розрив макета",battery:"Акумулятор",calculate_flow_rate:"Розраховувати швидкість потоку",circle_animation:"Анімація кола",clickable_entities:"Клікабельні сутності",color:"Колір",color_circle:"Колір кола",color_dynamically:"Колір динамічно",color_icon:"Колір іконки",color_state_of_charge_value:"Колір заряду",color_value:"Колір значення",combined:"Об’єднана сутність (одна сутність із позитивними та негативними значеннями)",consumption:"Споживання",custom:"Користувацький",custom_colors:"Власні кольори",dashboard_link:"Посилання на дашборд",dashboard_link_label:"Назва посилання на дашборд",decimals:"Кількість десяткових знаків",disable_dots:"Вимкнути точки",display_state:"Показувати стан",display_zero:"Показувати нульові значення",display_zero_lines:"Показувати лінії з нульовим значенням",display_zero_state:"Показувати стан при нулі",display_zero_tolerance:"Допуск для нульових значень",double_tap_action:"Дія при подвійному натисканні",entity_generator:"Генератор сутностей",fossil_fuel_percentage:"Частка викопного палива",grey_color:"Колір затемнення",grey_out:"Затемнити неактивні",grid:"Мережа",hide:"Приховати",hold_action:"Дія при утриманні",home:"Дім",icon_alert:"Іконка сповіщення",individual:"Окремо",invert_state:"Інвертувати стан",inverted_animation:"Інвертована анімація",kw_decimals:"Десяткові знаки для кіловатів",kwh_decimals:"Десяткові знаки для kWh",kwh_threshold:"Поріг переходу kWh → MWh",label_alert:"Мітка сповіщення",max_expected_power:"Максимальна очікувана потужність",max_flow_rate:"Максимальна швидкість потоку",min_expected_power:"Мінімальна очікувана потужність",min_flow_rate:"Мінімальна швидкість потоку",mode:"Режим",mwh_decimals:"Десяткові знаки для MWh",mwh_threshold:"Поріг переходу MWh → TWh",navigation_path:"Шлях переходу",no_color:"Без кольору",no_labels:"Без підписів",override_state:"Перевизначити стан",power_outage:"Відключення живлення",production:"Виробництво",secondary_info:"Додаткова інформація",separated:"Розділені сутності (окрема для споживання та окрема для виробництва)",show:"Показати",show_direction:"Показувати напрямок",show_state_of_charge:"Показувати рівень заряду",solar:"Сонячна енергія",sort_individual_devices:"Сортувати окремі пристрої",state_alert:"Стан сповіщення",state_of_charge:"Рівень заряду",state_of_charge_decimals:"Десяткові знаки заряду",state_of_charge_icon:"Іконка заряду",state_of_charge_unit:"Одиниця виміру заряду",state_of_charge_unit_white_space:"Пробіл одиниці виміру заряду",state_type:"Тип стану",subtract_individual:"Віднімати індивідуальні значення",sum_total:"Сумувати сонячну та вторинну",tap_action:"Дія при натисканні",template:"Шаблон",transparency:"Прозорість",unit_of_measurement:"Одиниця виміру",unit_white_space:"Пробіл між числом і одиницею",use_metadata:"Використовувати метадані",use_new_flow_rate_model:"Новий алгоритм швидкості потоку",w_decimals:"Десяткові знаки для ватів",watt_threshold:"Поріг переходу ват → кіловат",wh_decimals:"Десяткові знаки для Wh",wh_threshold:"Поріг переходу Wh → kWh"},ra={card:aa,editor:na};const sa={ca:Yi,cs:eo,en:po,de:ao,dk:lo,pt:Object.freeze({__proto__:null,card:Vo,default:Ko,editor:Zo}),pt_BR:Go,es:fo,nl:jo,it:To,fr:So,ru:Object.freeze({__proto__:null,card:qo,default:Xo,editor:Yo}),fi:wo,pl:Lo,sk:Object.freeze({__proto__:null,card:Jo,default:ea,editor:Qo}),sv:Object.freeze({__proto__:null,card:ta,default:oa,editor:ia}),hi:Mo,ua:Object.freeze({__proto__:null,card:aa,default:ra,editor:na})};function la(e,t){try{return e.split(".").reduce((e,t)=>e[t],sa[t])}catch{return}}function ca(e){let t=la(e,(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"));return t||(t=la(e,"en")),t??e}class da extends TypeError{constructor(e,t){let i;const{message:o,explanation:a,...n}=e,{path:r}=e,s=0===r.length?o:`At path: ${r.join(".")} -- ${o}`;super(a??s),null!=a&&(this.cause=s),Object.assign(this,n),this.name=this.constructor.name,this.failures=()=>i??(i=[e,...t()])}}function ha(e){return"object"==typeof e&&null!=e}function ua(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function pa(e,t,i,o){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:a,branch:n}=t,{type:r}=i,{refinement:s,message:l=`Expected a value of type \`${r}\`${s?` with refinement \`${s}\``:""}, but received: \`${ua(o)}\``}=e;return{value:o,type:r,refinement:s,key:a[a.length-1],path:a,branch:n,...e,message:l}}function*_a(e,t,i,o){(function(e){return ha(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const a of e){const e=pa(a,t,i,o);e&&(yield e)}}function*ma(e,t,i={}){const{path:o=[],branch:a=[e],coerce:n=!1,mask:r=!1}=i,s={path:o,branch:a};if(n&&(e=t.coercer(e,s),r&&"type"!==t.type&&ha(t.schema)&&ha(e)&&!Array.isArray(e)))for(const i in e)void 0===t.schema[i]&&delete e[i];let l="valid";for(const o of t.validator(e,s))o.explanation=i.message,l="not_valid",yield[o,void 0];for(let[c,d,h]of t.entries(e,s)){const t=ma(d,h,{path:void 0===c?o:[...o,c],branch:void 0===c?a:[...a,d],coerce:n,mask:r,message:i.message});for(const i of t)i[0]?(l=null!=i[0].refinement?"not_refined":"not_valid",yield[i[0],void 0]):n&&(d=i[1],void 0===c?e=d:e instanceof Map?e.set(c,d):e instanceof Set?e.add(d):ha(e)&&(void 0!==d||c in e)&&(e[c]=d))}if("not_valid"!==l)for(const o of t.refiner(e,s))o.explanation=i.message,l="not_refined",yield[o,void 0];"valid"===l&&(yield[void 0,e])}class ya{constructor(e){const{type:t,schema:i,validator:o,refiner:a,coercer:n=e=>e,entries:r=function*(){}}=e;this.type=t,this.schema=i,this.entries=r,this.coercer=n,this.validator=o?(e,t)=>_a(o(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>_a(a(e,t),t,this,e):()=>[]}assert(e,t){return fa(e,this,t)}create(e,t){return function(e,t,i){const o=ga(e,t,{coerce:!0,message:i});if(o[0])throw o[0];return o[1]}(e,this,t)}is(e){return function(e,t){const i=ga(e,t);return!i[0]}(e,this)}mask(e,t){return function(e,t,i){const o=ga(e,t,{coerce:!0,mask:!0,message:i});if(o[0])throw o[0];return o[1]}(e,this,t)}validate(e,t={}){return ga(e,this,t)}}function fa(e,t,i){const o=ga(e,t,{message:i});if(o[0])throw o[0]}function ga(e,t,i={}){const o=ma(e,t,i),a=function(e){const{done:t,value:i}=e.next();return t?void 0:i}(o);if(a[0]){const e=new da(a[0],function*(){for(const e of o)e[0]&&(yield e[0])});return[e,void 0]}return[void 0,a[1]]}function va(e,t){return new ya({type:e,schema:null,validator:t})}function ba(){return va("any",()=>!0)}function wa(){return va("boolean",e=>"boolean"==typeof e)}function ka(){return va("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ua(e)}`)}function $a(){return va("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${ua(e)}`)}function xa(e){const t=e?Object.keys(e):[],i=va("never",()=>!1);return new ya({type:"object",schema:e||null,*entries(o){if(e&&ha(o)){const a=new Set(Object.keys(o));for(const i of t)a.delete(i),yield[i,o[i],e[i]];for(const e of a)yield[e,o[e],i]}},validator:e=>ha(e)||`Expected an object, but received: ${ua(e)}`,coercer:e=>ha(e)?{...e}:e})}function Sa(e){return new ya({...e,validator:(t,i)=>void 0===t||e.validator(t,i),refiner:(t,i)=>void 0===t||e.refiner(t,i)})}function Ea(){return va("string",e=>"string"==typeof e||`Expected a string, but received: ${ua(e)}`)}const Ca="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,Aa=(e,t,i=null)=>{for(;t!==i;){const i=t.nextSibling;e.removeChild(t),t=i}},Ma=`{{lit-${String(Math.random()).slice(2)}}}`,Pa=`\x3c!--${Ma}--\x3e`,Da=new RegExp(`${Ma}|${Pa}`),za="$lit$";class Ta{constructor(e,t){this.parts=[],this.element=t;const i=[],o=[],a=document.createTreeWalker(t.content,133,null,!1);let n=0,r=-1,s=0;const{strings:l,values:{length:c}}=e;for(;s<c;){const e=a.nextNode();if(null!==e){if(r++,1===e.nodeType){if(e.hasAttributes()){const t=e.attributes,{length:i}=t;let o=0;for(let e=0;e<i;e++)Oa(t[e].name,za)&&o++;for(;o-- >0;){const t=l[s],i=ja.exec(t)[2],o=i.toLowerCase()+za,a=e.getAttribute(o);e.removeAttribute(o);const n=a.split(Da);this.parts.push({type:"attribute",index:r,name:i,strings:n}),s+=n.length-1}}"TEMPLATE"===e.tagName&&(o.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(Ma)>=0){const o=e.parentNode,a=t.split(Da),n=a.length-1;for(let t=0;t<n;t++){let i,n=a[t];if(""===n)i=Wa();else{const e=ja.exec(n);null!==e&&Oa(e[2],za)&&(n=n.slice(0,e.index)+e[1]+e[2].slice(0,-5)+e[3]),i=document.createTextNode(n)}o.insertBefore(i,e),this.parts.push({type:"node",index:++r})}""===a[n]?(o.insertBefore(Wa(),e),i.push(e)):e.data=a[n],s+=n}}else if(8===e.nodeType)if(e.data===Ma){const t=e.parentNode;null!==e.previousSibling&&r!==n||(r++,t.insertBefore(Wa(),e)),n=r,this.parts.push({type:"node",index:r}),null===e.nextSibling?e.data="":(i.push(e),r--),s++}else{let t=-1;for(;-1!==(t=e.data.indexOf(Ma,t+1));)this.parts.push({type:"node",index:-1}),s++}}else a.currentNode=o.pop()}for(const e of i)e.parentNode.removeChild(e)}}const Oa=(e,t)=>{const i=e.length-t.length;return i>=0&&e.slice(i)===t},Na=e=>-1!==e.index,Wa=()=>document.createComment(""),ja=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ba(e,t){const{element:{content:i},parts:o}=e,a=document.createTreeWalker(i,133,null,!1);let n=Ha(o),r=o[n],s=-1,l=0;const c=[];let d=null;for(;a.nextNode();){s++;const e=a.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(c.push(e),null===d&&(d=e)),null!==d&&l++;void 0!==r&&r.index===s;)r.index=null!==d?-1:r.index-l,n=Ha(o,n),r=o[n]}c.forEach(e=>e.parentNode.removeChild(e))}const Ua=e=>{let t=11===e.nodeType?0:1;const i=document.createTreeWalker(e,133,null,!1);for(;i.nextNode();)t++;return t},Ha=(e,t=-1)=>{for(let i=t+1;i<e.length;i++){const t=e[i];if(Na(t))return i}return-1};const La=new WeakMap,Ia=e=>"function"==typeof e&&La.has(e),Ra={},Fa={};class Ga{constructor(e,t,i){this.__parts=[],this.template=e,this.processor=t,this.options=i}update(e){let t=0;for(const i of this.__parts)void 0!==i&&i.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=Ca?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],i=this.template.parts,o=document.createTreeWalker(e,133,null,!1);let a,n=0,r=0,s=o.nextNode();for(;n<i.length;)if(a=i[n],Na(a)){for(;r<a.index;)r++,"TEMPLATE"===s.nodeName&&(t.push(s),o.currentNode=s.content),null===(s=o.nextNode())&&(o.currentNode=t.pop(),s=o.nextNode());if("node"===a.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(s.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(s,a.name,a.strings,this.options));n++}else this.__parts.push(void 0),n++;return Ca&&(document.adoptNode(e),customElements.upgrade(e)),e}}const Va=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),Za=` ${Ma} `;class Ka{constructor(e,t,i,o){this.strings=e,this.values=t,this.type=i,this.processor=o}getHTML(){const e=this.strings.length-1;let t="",i=!1;for(let o=0;o<e;o++){const e=this.strings[o],a=e.lastIndexOf("\x3c!--");i=(a>-1||i)&&-1===e.indexOf("--\x3e",a+1);const n=ja.exec(e);t+=null===n?e+(i?Za:Pa):e.substr(0,n.index)+n[1]+n[2]+za+n[3]+Ma}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==Va&&(t=Va.createHTML(t)),e.innerHTML=t,e}}class qa{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(Wa()),this.endNode=e.appendChild(Wa())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=Wa()),e.__insert(this.endNode=Wa())}insertAfterPart(e){e.__insert(this.startNode=Wa()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;Ia(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=Ra,e(this)}const e=this.__pendingValue;e!==Ra&&((e=>null===e||!("object"==typeof e||"function"==typeof e))(e)?e!==this.value&&this.__commitText(e):e instanceof Ka?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):(e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]))(e)?this.__commitIterable(e):e===Fa?(this.value=Fa,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,i="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=i:this.__commitNode(document.createTextNode(i)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof Ga&&this.value.template===t)this.value.update(e.values);else{const i=new Ga(t,e.processor,this.options),o=i._clone();i.update(e.values),this.__commitNode(o),this.value=i}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let i,o=0;for(const a of e)i=t[o],void 0===i&&(i=new qa(this.options),t.push(i),0===o?i.appendIntoPart(this):i.insertAfterPart(t[o-1])),i.setValue(a),i.commit(),o++;o<t.length&&(t.length=o,this.clear(i&&i.endNode))}clear(e=this.startNode){Aa(this.startNode.parentNode,e.nextSibling,this.endNode)}}let Ya=!1;function Xa(e){let t=Ja.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},Ja.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const o=e.strings.join(Ma);return i=t.keyString.get(o),void 0===i&&(i=new Ta(e,e.getTemplateElement()),t.keyString.set(o,i)),t.stringsArray.set(e.strings,i),i}(()=>{try{const e={get capture(){return Ya=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();const Ja=new Map,Qa=new WeakMap;"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const en=(e,t)=>`${e}--${t}`;let tn=!0;void 0===window.ShadyCSS?tn=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),tn=!1);const on=e=>t=>{const i=en(t.type,e);let o=Ja.get(i);void 0===o&&(o={stringsArray:new WeakMap,keyString:new Map},Ja.set(i,o));let a=o.stringsArray.get(t.strings);if(void 0!==a)return a;const n=t.strings.join(Ma);if(a=o.keyString.get(n),void 0===a){const i=t.getTemplateElement();tn&&window.ShadyCSS.prepareTemplateDom(i,e),a=new Ta(t,i),o.keyString.set(n,a)}return o.stringsArray.set(t.strings,a),a},an=["html","svg"],nn=new Set,rn=(e,t,i)=>{nn.add(e);const o=i?i.element:document.createElement("template"),a=t.querySelectorAll("style"),{length:n}=a;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(o,e);const r=document.createElement("style");for(let e=0;e<n;e++){const t=a[e];t.parentNode.removeChild(t),r.textContent+=t.textContent}(e=>{an.forEach(t=>{const i=Ja.get(en(t,e));void 0!==i&&i.keyString.forEach(e=>{const{element:{content:t}}=e,i=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{i.add(e)}),Ba(e,i)})})})(e);const s=o.content;i?function(e,t,i=null){const{element:{content:o},parts:a}=e;if(null==i)return void o.appendChild(t);const n=document.createTreeWalker(o,133,null,!1);let r=Ha(a),s=0,l=-1;for(;n.nextNode();)for(l++,n.currentNode===i&&(s=Ua(t),i.parentNode.insertBefore(t,i));-1!==r&&a[r].index===l;){if(s>0){for(;-1!==r;)a[r].index+=s,r=Ha(a,r);return}r=Ha(a,r)}}(i,r,s.firstChild):s.insertBefore(r,s.firstChild),window.ShadyCSS.prepareTemplateStyles(o,e);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(i){s.insertBefore(r,s.firstChild);const e=new Set;e.add(r),Ba(i,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const sn={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},ln=(e,t)=>t!==e&&(t==t||e==e),cn={attribute:!0,type:String,converter:sn,reflect:!1,hasChanged:ln},dn="finalized";class hn extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,i)=>{const o=this._attributeNameForProperty(i,t);void 0!==o&&(this._attributeToPropertyMap.set(o,i),e.push(o))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=cn){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const i="symbol"==typeof e?Symbol():`__${e}`,o=this.getPropertyDescriptor(e,i,t);void 0!==o&&Object.defineProperty(this.prototype,e,o)}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(o){const a=this[e];this[t]=o,this.requestUpdateInternal(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||cn}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty(dn)||e.finalize(),this[dn]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const i of t)this.createProperty(i,e[i])}}static _attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,i=ln){return i(e,t)}static _propertyValueFromAttribute(e,t){const i=t.type,o=t.converter||sn,a="function"==typeof o?o:o.fromAttribute;return a?a(e,i):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const i=t.type,o=t.converter;return(o&&o.toAttribute||sn.toAttribute)(e,i)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,i){t!==i&&this._attributeToProperty(e,i)}_propertyToAttribute(e,t,i=cn){const o=this.constructor,a=o._attributeNameForProperty(e,i);if(void 0!==a){const e=o._propertyValueToAttribute(t,i);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(a):this.setAttribute(a,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const i=this.constructor,o=i._attributeToPropertyMap.get(e);if(void 0!==o){const e=i.getPropertyOptions(o);this._updateState=16|this._updateState,this[o]=i._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,i){let o=!0;if(void 0!==e){const a=this.constructor;i=i||a.getPropertyOptions(e),a._valueHasChanged(this[e],t,i.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,i))):o=!1}!this._hasRequestedUpdate&&o&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}hn[dn]=!0;const un=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:o}=t;return{kind:i,elements:o,finisher(t){window.customElements.define(e,t)}}})(e,t),pn=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(i){i.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function _n(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):pn(e,t)}const mn=e=>_n({attribute:!1,hasChanged:void 0});const yn=(e,t,i)=>{Object.defineProperty(t,i,e)},fn=(e,t)=>({kind:"method",placement:"prototype",key:t.key,descriptor:e}),gn=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vn=Symbol();class bn{constructor(e,t){if(t!==vn)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(gn?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const wn={};class kn extends hn{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,i)=>e.reduceRight((e,i)=>Array.isArray(i)?t(i,e):(e.add(i),e),i),i=t(e,new Set),o=[];i.forEach(e=>o.unshift(e)),this._styles=o}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!gn){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new bn(String(t),vn)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?gn?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==wn&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return wn}}kn.finalized=!0,kn.render=(e,t,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const o=i.scopeName,a=Qa.has(t),n=tn&&11===t.nodeType&&!!t.host,r=n&&!nn.has(o),s=r?document.createDocumentFragment():t;if(((e,t,i)=>{let o=Qa.get(t);void 0===o&&(Aa(t,t.firstChild),Qa.set(t,o=new qa(Object.assign({templateFactory:Xa},i))),o.appendInto(t)),o.setValue(e),o.commit()})(e,s,Object.assign({templateFactory:on(o)},i)),r){const e=Qa.get(s);Qa.delete(s);const i=e.value instanceof Ga?e.value.template:void 0;rn(o,s,i),Aa(t,t.firstChild),t.appendChild(s),Qa.set(t,e)}!a&&n&&window.ShadyCSS.styleElement(t.host)},kn.shadowRootOptions={mode:"open"};var $n="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",xn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Sn(e,t){return e===t||!(!xn(e)||!xn(t))}function En(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!Sn(e[i],t[i]))return!1;return!0}function Cn(e,t){void 0===t&&(t=En);var i=null;function o(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(i&&i.lastThis===this&&t(o,i.lastArgs))return i.lastResult;var n=e.apply(this,o);return i={lastResult:n,lastArgs:o,lastThis:this},n}return o.clear=function(){i=null},o}function An(){return{type:"expandable",title:ca("editor.combined"),schema:[{name:"entity",selector:{entity:{}}}]}}function Mn(){return{type:"expandable",title:ca("editor.separated"),name:"entity",schema:[{name:"consumption",label:"Consumption Entity",selector:{entity:{}}},{name:"production",label:"Production Entity",selector:{entity:{}}}]}}const Pn={name:"color",title:ca("editor.custom_colors"),type:"expandable",schema:[{type:"grid",column_min_width:"200px",schema:[{name:"consumption",label:"Consumption",selector:{color_rgb:{}}},{name:"production",label:"Production",selector:{color_rgb:{}}}]}]},Dn=[{name:"tap_action",selector:{ui_action:{}}},{name:"hold_action",selector:{ui_action:{}}},{name:"double_tap_action",selector:{ui_action:{}}}],zn=[{name:"entity",selector:{entity:{}}},{name:"template",label:"Template (overrides entity, save to update)",selector:{template:{}}},{type:"grid",column_min_width:"200px",schema:[{name:"icon",selector:{icon:{}}},{name:"unit_of_measurement",label:"Unit of Measurement",selector:{text:{}}},{name:"decimals",label:"Decimals",selector:{number:{mode:"box",min:0,max:10,step:1}}},{name:"color_value",label:"Color Value",selector:{boolean:{}}},{name:"unit_white_space",label:"Unit White Space",default:!0,selector:{boolean:{}}},{name:"display_zero",label:"Display Zero",selector:{boolean:{}}},{name:"accept_negative",label:"Accept Negative",selector:{boolean:{}}},{name:"display_zero_tolerance",label:"Display Zero Tolerance",selector:{number:{mode:"box",min:0,max:1e6,step:.1}}}]},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Tn=[{name:"color_icon",label:"Color of Icon",selector:{select:{options:[{value:"no_color",label:ca("editor.no_color")},{value:"color_dynamically",label:ca("editor.color_dynamically")},{value:"production",label:ca("editor.production")},{value:"consumption",label:ca("editor.consumption")}],mode:"dropdown"}}},{name:"color_circle",label:"Color of Circle",selector:{select:{options:[{value:"color_dynamically",label:"Color dynamically"},{value:"consumption",label:"Consumption"},{value:"production",label:"Production"}],mode:"dropdown"}}},{name:"display_zero_tolerance",label:"Display Zero Tolerance",selector:{number:{min:0,max:1e6,step:1,mode:"box"}}},{name:"display_state",label:"Display State",selector:{select:{options:[{value:"two_way",label:"Two Way"},{value:"one_way_no_zero",label:"One Way"},{value:"one_way",label:"One Way (Show Zero)"}],mode:"dropdown"}}}];function On(e){const t={type:"grid",column_min_width:"200px",schema:[{name:"name",selector:{text:{}}},{name:"icon",selector:{icon:{}}}]};return"battery"!==e&&"grid"!==e||t.schema.push(...Tn),t}const Nn={...On("battery"),schema:[...On("battery").schema,{name:"invert_state",label:"Invert State",selector:{boolean:{}}},{name:"color_value",label:"Color of Value",selector:{boolean:{}}},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}}]},Wn=[{name:"state_of_charge",label:"State of Charge Entity",selector:{entity:{}}},{name:"",type:"grid",column_min_width:"200px",schema:[{name:"state_of_charge_unit",label:"Unit",selector:{text:{}}},{name:"state_of_charge_unit_white_space",label:"Unit White Space",default:!0,selector:{boolean:{}}},{name:"state_of_charge_decimals",label:"Decimals",selector:{number:{mode:"box",min:0,max:4,step:1}}},{name:"show_state_of_charge",label:"Show State of Charge",selector:{boolean:{}}},{name:"color_state_of_charge_value",label:"Color of Value",selector:{select:{options:[{value:"no_color",label:ca("editor.no_color")},{value:"color_dynamically",label:ca("editor.color_dynamically")},{value:"production",label:ca("editor.production")},{value:"consumption",label:ca("editor.consumption")}],mode:"dropdown"}}}]}],jn=[An(),Mn(),{title:ca("editor.state_of_charge"),name:"",type:"expandable",schema:Wn},Nn,Pn,{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Bn={name:"grey_color",selector:{color_rgb:{}}},Un={name:"transparency",selector:{number:{min:0,max:100,step:1,mode:"box"}}},Hn={name:"",type:"grid",column_min_width:"200px",schema:[Un,Bn]},Ln=e=>{switch(e){case"grey_out":return Bn;case"transparency":return Un;case"custom":return Hn;default:return[]}},In=Cn((e,t)=>[{name:"display_zero_lines",type:"grid",column_min_width:"400px",schema:[{name:"mode",selector:{select:{mode:"dropdown",options:[{value:"show",label:e("editor.show")},{value:"hide",label:e("editor.hide")},{value:"transparency",label:e("editor.transparency")},{value:"grey_out",label:e("editor.grey_out")},{value:"custom",label:e("editor.custom")}]}}},Ln(t)]}]),Rn=[{name:"entity",selector:{entity:{}}},{...On(),schema:[...On().schema,{name:"state_type",label:"State Type",selector:{select:{options:[{value:"power",label:"Power"},{value:"percentage",label:"Percentage"}],mode:"dropdown"}}},{name:"color_value",label:"Color Value",selector:{boolean:{}}},{name:"color_icon",label:"Color Icon",selector:{boolean:{}}},{name:"display_zero",label:"Display Zero",selector:{boolean:{}},default:!0},{name:"display_zero_tolerance",label:"Display Zero Tolerance",selector:{number:{mode:"box",min:0,max:1e6,step:.1}}},{name:"display_zero_state",label:"Display Zero State",selector:{boolean:{}},default:!0},{name:"unit_white_space",label:"Unit White Space",selector:{boolean:{}},default:!0},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}}]},{name:"color",label:"Color",selector:{color_rgb:{}}},{title:ca("editor.secondary_info"),name:"secondary_info",type:"expandable",schema:zn},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Fn={...On("grid"),schema:[...On("grid").schema,{name:"invert_state",label:"Invert State",selector:{boolean:{}}},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}},{name:"color_value",label:"Color of Value",selector:{boolean:{}},default:!0}]},Gn=[An(),Mn(),Fn,Pn,{title:ca("editor.secondary_info"),name:"secondary_info",type:"expandable",schema:zn},{title:ca("editor.power_outage"),name:"power_outage",type:"expandable",schema:[{type:"grid",column_min_width:"200px",schema:[{name:"entity",selector:{entity:{}}},{name:"entity_generator",label:"Generator Entity",selector:{entity:{}}},{name:"label_alert",label:"Outage Label",selector:{text:{}}},{name:"icon_alert",label:"Outage Icon",selector:{icon:{}}},{name:"state_alert",label:"Outage State",selector:{text:{}}}]}]},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Vn=[{name:"entity",selector:{entity:{}}},{...On(),schema:[...On().schema,{name:"color_value",label:"Color Value",selector:{select:{options:[{value:!0,label:"Color dynamically"},{value:!1,label:"Do Not Color"},{value:"solar",label:"Solar"},{value:"grid",label:"Grid"},{value:"battery",label:"Battery"}],mode:"dropdown"}}},{name:"color_icon",label:"Color Icon",selector:{select:{options:[{value:!0,label:"Color dynamically"},{value:!1,label:"Do Not Color"},{value:"solar",label:"Solar"},{value:"grid",label:"Grid"},{value:"battery",label:"Battery"}],mode:"dropdown"}}},{name:"circle_animation",label:"Circle Animation",default:!0,selector:{boolean:{}}},{name:"subtract_individual",label:"Subtract Individual",selector:{boolean:{}}},{name:"override_state",label:"Override State (With Home Entity)",selector:{boolean:{}}},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}},{name:"hide",label:"Hide Home",selector:{boolean:{}}}]},{title:ca("editor.secondary_info"),name:"secondary_info",type:"expandable",schema:zn},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Zn=[{name:"entity",selector:{entity:{}}},{...On(),schema:[...On().schema,{name:"color_value",label:"Color Value",selector:{boolean:{}},default:!0},{name:"color_icon",label:"Color Icon",selector:{boolean:{}},default:!0},{name:"display_zero",label:"Display Zero",selector:{boolean:{}},default:!0},{name:"display_zero_tolerance",label:"Display Zero Tolerance",selector:{number:{mode:"box",min:0,max:1e6,step:.1}}},{name:"display_zero_state",label:"Display Zero State",selector:{boolean:{}},default:!0},{name:"unit_of_measurement",label:"Unit of Measurement",selector:{text:{}}},{name:"calculate_flow_rate",label:"Calculate Flow Rate",selector:{boolean:{}}},{name:"decimals",label:"Decimals",selector:{number:{mode:"box",min:0,max:4,step:1}}},{name:"inverted_animation",label:"Invert Animation",selector:{boolean:{}}},{name:"show_direction",label:"Show Direction",selector:{boolean:{}}},{name:"unit_white_space",label:"Unit White Space",default:!0,selector:{boolean:{}}},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}}]},{name:"color",label:"Color",selector:{color_rgb:{}}},{title:ca("editor.secondary_info"),name:"secondary_info",type:"expandable",schema:zn},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],Kn=[{name:"entity",selector:{entity:{}}},{...On(),schema:[...On().schema,{name:"color_value",label:"Color Value",selector:{boolean:{}}},{name:"color_icon",label:"Color Icon",selector:{boolean:{}}},{name:"display_zero",label:"Display Zero",selector:{boolean:{}},default:!0},{name:"display_zero_state",label:"Display State When Zero?",selector:{boolean:{}},default:!0},{name:"display_zero_tolerance",label:"Display Zero Tolerance",selector:{number:{mode:"box",min:0,max:1e6,step:.1}}},{name:"invert_state",label:"Invert State",selector:{boolean:{}}},{name:"use_metadata",label:"Use Metadata",selector:{boolean:{}}}]},{name:"color",label:"Color",selector:{color_rgb:{}}},{title:ca("editor.secondary_info"),name:"secondary_info",type:"expandable",schema:[...zn,{name:"sum_total",label:"Sum Total",selector:{boolean:{}}}]},{title:ca("editor.action"),name:"",type:"expandable",schema:Dn}],qn=function(...e){const t="type"===e[0].type,i=e.map(e=>e.schema),o=Object.assign({},...i);return t?function(e){const t=Object.keys(e);return new ya({type:"type",schema:e,*entries(i){if(ha(i))for(const o of t)yield[o,i[o],e[o]]},validator:e=>ha(e)||`Expected an object, but received: ${ua(e)}`,coercer:e=>ha(e)?{...e}:e})}(o):xa(o)}(xa({type:Ea(),view_layout:ba(),layout_options:ba(),grid_options:ba(),visibility:ba(),disabled:Sa(wa())}),xa({title:Sa(Ea()),theme:Sa(Ea()),dashboard_link:Sa(Ea()),dashboard_link_label:Sa(Ea()),second_dashboard_link:Sa(Ea()),second_dashboard_link_label:Sa(Ea()),inverted_entities:Sa(ba()),w_decimals:Sa(ka()),kw_decimals:Sa(ka()),min_flow_rate:Sa($a()),max_flow_rate:Sa($a()),min_expected_power:Sa($a()),max_expected_power:Sa($a()),watt_threshold:Sa($a()),clickable_entities:Sa(wa()),transparency_zero_lines:Sa($a()),greyout_zero_lines:Sa(wa()),display_zero_lines:Sa(ba()),use_new_flow_rate_model:Sa(wa()),full_size:Sa(wa()),style_ha_card:Sa(ba()),style_card_content:Sa(ba()),disable_dots:Sa(wa()),no_labels:Sa(wa()),entities:xa({battery:Sa(ba()),grid:Sa(ba()),solar:Sa(ba()),home:Sa(ba()),fossil_fuel_percentage:Sa(ba()),individual:Sa(ba())}),sort_individual_devices:Sa(wa()),allow_layout_break:Sa(wa())})),Yn=[{name:"title",label:"Title",selector:{text:{}}}];Cn(e=>[{name:"entities",type:"grid",column_min_width:"400px",schema:[{title:e("editor.grid"),name:"grid",type:"expandable",iconPath:"M8.28,5.45L6.5,4.55L7.76,2H16.23L17.5,4.55L15.72,5.44L15,4H9L8.28,5.45M18.62,8H14.09L13.3,5H10.7L9.91,8H5.38L4.1,10.55L5.89,11.44L6.62,10H17.38L18.1,11.45L19.89,10.56L18.62,8M17.77,22H15.7L15.46,21.1L12,15.9L8.53,21.1L8.3,22H6.23L9.12,11H11.19L10.83,12.35L12,14.1L13.16,12.35L12.81,11H14.88L17.77,22M11.4,15L10.5,13.65L9.32,18.13L11.4,15M14.68,18.12L13.5,13.64L12.6,15L14.68,18.12Z",schema:Gn},{title:e("editor.solar"),name:"solar",type:"expandable",iconPath:"M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",schema:Kn},{title:e("editor.battery"),name:"battery",type:"expandable",iconPath:"M16 20H8V6H16M16.67 4H15V2H9V4H7.33C6.6 4 6 4.6 6 5.33V20.67C6 21.4 6.6 22 7.33 22H16.67C17.41 22 18 21.41 18 20.67V5.33C18 4.6 17.4 4 16.67 4M15 16H9V19H15V16M15 7H9V10H15V7M15 11.5H9V14.5H15V11.5Z",schema:jn},{title:e("editor.fossil_fuel_percentage"),name:"fossil_fuel_percentage",type:"expandable",iconPath:"M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z",schema:Rn},{title:e("editor.home"),name:"home",type:"expandable",iconPath:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",schema:Vn}]}]);const Xn=Cn(e=>[{name:"entities",type:"grid",column_min_width:"400px",schema:[{title:`${e("editor.individual")} 1`,name:"individual1",type:"expandable",schema:Zn},{title:`${e("editor.individual")} 2`,name:"individual2",type:"expandable",schema:Zn}]}]),Jn=Cn((e,t)=>[{type:"grid",column_min_width:"200px",schema:[{name:"dashboard_link",label:"Dashboard Link",selector:{navigation:{}}},{name:"dashboard_link_label",label:"Dashboard Link Label",selector:{text:{}}},{name:"w_decimals",label:"Watt Decimals",selector:{number:{mode:"box",min:0,max:5,step:1}}},{name:"kw_decimals",label:"kW Decimals",selector:{number:{mode:"box",min:0,max:5,step:1}}},{name:"max_flow_rate",label:"Max Flow Rate (Sec/Dot)",selector:{number:{mode:"box",min:0,max:1e6,step:.01}}},{name:"min_flow_rate",label:"Min Flow Rate (Sec/Dot)",selector:{number:{mode:"box",min:0,max:1e6,step:.01}}},{name:"max_expected_power",label:"Max Expected Power (in Watts)",selector:{number:{mode:"box",min:0,max:1e6,step:.01}}},{name:"min_expected_power",label:"Min Expected Power (in Watts)",selector:{number:{mode:"box",min:0,max:1e6,step:.01}}},{name:"watt_threshold",label:"Watt to Kilowatt Threshold",selector:{number:{mode:"box",min:0,max:1e6,step:1}}},{name:"clickable_entities",label:"Clickable Entities",selector:{boolean:{}},default:!0},{name:"disable_dots",label:"Disable Moving Dots",selector:{boolean:{}}},{name:"no_labels",label:e("editor.no_labels"),selector:{boolean:{}}},{name:"use_new_flow_rate_model",label:"New Flow Model?",selector:{boolean:{}},default:!0},{name:"sort_individual_devices",label:"Sort individual devices by usage",selector:{boolean:{}},default:!0},{name:"allow_layout_break",label:"Allow Layout Break",selector:{boolean:{}}}]},{type:"expandable",title:e("editor.display_zero_lines"),schema:[...In(e,t)]}]),Qn=(e,t,i,o)=>{o=o||{},i=null==i?{}:i;const a=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});return a.detail=i,e.dispatchEvent(a),a},er=async()=>{if(customElements.get("ha-form")||customElements.get("hui-button-card")?.getConfigElement(),customElements.get("ha-entity-picker")||customElements.get("hui-entities-card")?.getConfigElement(),customElements.get("ha-form"))return;await(window.loadCardHelpers?.())},tr=Ut`#sortable a:nth-of-type(2n) paper-icon-item{animation-name:keyframes1;animation-iteration-count:infinite;transform-origin:50% 10%;animation-delay:-.75s;animation-duration:.25s}#sortable a:nth-of-type(2n-1) paper-icon-item{animation-name:keyframes2;animation-iteration-count:infinite;animation-direction:alternate;transform-origin:30% 5%;animation-delay:-.5s;animation-duration:.33s}#sortable a{height:48px;display:flex}#sortable{outline:0;display:block!important}.hidden-panel{display:flex!important}.sortable-fallback{display:none}.sortable-ghost{opacity:.4}.sortable-fallback{opacity:0}@keyframes keyframes1{0%{transform:rotate(-1deg);animation-timing-function:ease-in}50%{transform:rotate(1.5deg);animation-timing-function:ease-out}}@keyframes keyframes2{0%{transform:rotate(1deg);animation-timing-function:ease-in}50%{transform:rotate(-1.5deg);animation-timing-function:ease-out}}.hide-panel,.show-panel{display:none;position:absolute;top:0;right:4px;--mdc-icon-button-size:40px}:host([rtl]) .show-panel{right:initial;left:4px}.hide-panel{top:4px;right:8px}:host([rtl]) .hide-panel{right:initial;left:8px}:host([expanded]) .hide-panel{display:block}:host([expanded]) .show-panel{display:inline-flex}paper-icon-item.hidden-panel,paper-icon-item.hidden-panel ha-icon[slot=item-icon],paper-icon-item.hidden-panel span{color:var(--secondary-text-color);cursor:pointer}`;let ir;const or=2;class ar{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const{I:nr}=Oi,rr=()=>document.createComment(""),sr=(e,t,i)=>{var o;const a=e._$AA.parentNode,n=void 0===t?e._$AB:t._$AA;if(void 0===i){const t=a.insertBefore(rr(),n),o=a.insertBefore(rr(),n);i=new nr(t,o,e,e.options)}else{const t=i._$AB.nextSibling,r=i._$AM,s=r!==e;if(s){let t;null===(o=i._$AQ)||void 0===o||o.call(i,e),i._$AM=e,void 0!==i._$AP&&(t=e._$AU)!==r._$AU&&i._$AP(t)}if(t!==n||s){let e=i._$AA;for(;e!==t;){const t=e.nextSibling;a.insertBefore(e,n),e=t}}}return i},lr=(e,t,i=e)=>(e._$AI(t,i),e),cr={},dr=(e,t=cr)=>e._$AH=t,hr=e=>{var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);let i=e._$AA;const o=e._$AB.nextSibling;for(;i!==o;){const e=i.nextSibling;i.remove(),i=e}},ur=(e,t,i)=>{const o=new Map;for(let a=t;a<=i;a++)o.set(e[a],a);return o},pr=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends ar{constructor(e){if(super(e),e.type!==or)throw Error("repeat() can only be used in text expressions")}ct(e,t,i){let o;void 0===i?i=t:void 0!==t&&(o=t);const a=[],n=[];let r=0;for(const t of e)a[r]=o?o(t,r):r,n[r]=i(t,r),r++;return{values:n,keys:a}}render(e,t,i){return this.ct(e,t,i).values}update(e,[t,i,o]){var a;const n=(e=>e._$AH)(e),{values:r,keys:s}=this.ct(t,i,o);if(!Array.isArray(n))return this.ut=s,r;const l=null!==(a=this.ut)&&void 0!==a?a:this.ut=[],c=[];let d,h,u=0,p=n.length-1,_=0,m=r.length-1;for(;u<=p&&_<=m;)if(null===n[u])u++;else if(null===n[p])p--;else if(l[u]===s[_])c[_]=lr(n[u],r[_]),u++,_++;else if(l[p]===s[m])c[m]=lr(n[p],r[m]),p--,m--;else if(l[u]===s[m])c[m]=lr(n[u],r[m]),sr(e,c[m+1],n[u]),u++,m--;else if(l[p]===s[_])c[_]=lr(n[p],r[_]),sr(e,n[u],n[p]),p--,_++;else if(void 0===d&&(d=ur(s,_,m),h=ur(l,u,p)),d.has(l[u]))if(d.has(l[p])){const t=h.get(s[_]),i=void 0!==t?n[t]:null;if(null===i){const t=sr(e,n[u]);lr(t,r[_]),c[_]=t}else c[_]=lr(i,r[_]),sr(e,n[u],i),n[t]=null;_++}else hr(n[p]),p--;else hr(n[u]),u++;for(;_<=m;){const t=sr(e,c[m+1]);lr(t,r[_]),c[_++]=t}for(;u<=p;){const e=n[u++];null!==e&&hr(e)}return this.ut=s,dr(e,c),gi}});let _r=class extends Bi{constructor(){super(...arguments),this._indexBeingEdited=-1,this._entityKeys=new WeakMap,this._computeLabelCallback=e=>this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e?.name}`)||ca(`editor.${e?.name}`)}connectedCallback(){super.connectedCallback(),er()}disconnectedCallback(){super.disconnectedCallback(),this._destroySortable()}_editRowElement(e){this._indexBeingEdited=e}_getKey(e){return this._entityKeys.has(e)||this._entityKeys.set(e,Math.random().toString()),this._entityKeys.get(e)}render(){return this.entities&&this.hass?-1!==this._indexBeingEdited?fi`<div class="individual-header"><h4>${this._indexBeingEdited+1} / ${this.entities.length} ${ca("editor.individual")}</h4><ha-icon-button .label="${this.hass.localize("ui.components.entity.entity-picker.clear")}" .path="${$n}" class="remove-icon" @click="${()=>this._indexBeingEdited=-1}"></ha-icon-button></div><ha-form .hass="${this.hass}" .data="${this.entities[this._indexBeingEdited]}" .schema="${Zn}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._configChanged}"></ha-form>`:fi`<div class="entities">${pr(this.entities,e=>this._getKey(e),(e,t)=>fi`<div class="entity"><div class="handle"><ha-svg-icon .path="${"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z"}"></ha-svg-icon></div>${e.type?fi`<div class="special-row"><div><span>${this.hass.localize(`ui.panel.lovelace.editor.card.entities.entity_row.${e.type}`)} </span><span class="secondary">${this.hass.localize("ui.panel.lovelace.editor.card.entities.edit_special_row")}</span></div></div>`:fi`<ha-entity-picker allow-custom-entity hideClearIcon .hass="${this.hass}" .value="${e.entity}" .index="${t}" @value-changed="${this._valueChanged}"></ha-entity-picker>`}<ha-icon-button .label="${this.hass.localize("ui.components.entity.entity-picker.clear")}" .path="${$n}" class="remove-icon" .index="${t}" @click="${this._removeRow}"></ha-icon-button><ha-icon-button .label="${this.hass.localize("ui.components.entity.entity-picker.edit")}" .path="${"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}" class="edit-icon" .index="${t}" @click="${()=>this._editRowElement(t)}"></ha-icon-button></div>`)}</div><ha-entity-picker class="add-entity" .hass="${this.hass}" @value-changed="${this._addEntity}"></ha-entity-picker>`:fi`<p>No entities configured.</p>`}_configChanged(e){const t=e.detail.value||"";if(!this.config||!this.hass)return;Array.isArray(this.config.entities.individual)||(this.config.entities.individual=[]);const i=[...this.config.entities.individual];if(!i)return;i[this._indexBeingEdited]=t;const o={...this.config,entities:{...this.config.entities,individual:i}};Qn(this,"config-changed",{config:o})}firstUpdated(){this._createSortable()}async _createSortable(){const e=await(async()=>(ir||(ir=(await Promise.resolve().then(function(){return Sl})).default),ir))();this._sortable=new e(this.shadowRoot.querySelector(".entities"),{animation:150,fallbackClass:"sortable-fallback",handle:".handle",onChoose:e=>{e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder)},onEnd:e=>{e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder),this._rowMoved(e)}})}_destroySortable(){this._sortable?.destroy(),this._sortable=void 0}async _addEntity(e){const t=e.detail.value;if(""===t)return;const i=this.entities.concat({entity:t});e.target.value="",Qn(this,"entities-changed",{entities:i})}_rowMoved(e){if(e.oldIndex===e.newIndex)return;if(null==e.oldIndex||null==e.newIndex)return;const t=this.entities.concat(),[i]=t.splice(e.oldIndex,1);i&&(t.splice(e.newIndex,0,i),Qn(this,"entities-changed",{entities:t}))}_removeRow(e){const t=e.currentTarget.index,i=this.entities.concat();i.splice(t,1),Qn(this,"entities-changed",{entities:i})}_valueChanged(e){const t=e.detail.value,i=e.target.index,o=this.entities.concat();""===t||void 0===t?o.splice(i,1):o[i]={...o[i],entity:t},Qn(this,"entities-changed",{entities:o})}_editRow(e){const t=e.currentTarget.index;Qn(this,"edit-detail-element",{subElementConfig:{index:t,type:"row",elementConfig:this.entities[t]}})}static get styles(){return[tr,Ut`ha-entity-picker{margin-top:8px}.individual-header{display:flex;justify-content:space-between;align-items:center;margin-inline:.2rem;margin-bottom:1rem}.add-entity{display:block;margin-left:31px;margin-right:71px;margin-inline-start:31px;margin-inline-end:71px;direction:var(--direction)}.entity{display:flex;align-items:center}.entity .handle{padding-right:8px;cursor:move;padding-inline-end:8px;padding-inline-start:initial;direction:var(--direction)}.entity .handle>*{pointer-events:none}.entity ha-entity-picker{flex-grow:1;min-width:0}.special-row{height:60px;font-size:16px;display:flex;align-items:center;justify-content:space-between;flex-grow:1}.special-row div{display:flex;flex-direction:column}.edit-icon,.remove-icon{--mdc-icon-button-size:36px;color:var(--secondary-text-color)}.secondary{font-size:12px;color:var(--secondary-text-color)}`]}};e([Ii({attribute:!1}),t("design:type",Object)],_r.prototype,"hass",void 0),e([Ii({attribute:!1}),t("design:type",Object)],_r.prototype,"config",void 0),e([Ii({attribute:!1}),t("design:type",Array)],_r.prototype,"entities",void 0),e([Ii(),t("design:type",String)],_r.prototype,"label",void 0),e([Ri(),t("design:type",Number)],_r.prototype,"_indexBeingEdited",void 0),_r=e([Hi("individual-row-editor")],_r);let mr=class extends Bi{constructor(){super(...arguments),this._computeLabelCallback=e=>this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e?.name}`)||ca(`editor.${e?.name}`)}render(){return this.config&&this.hass?(this._configEntities=this.config.entities.individual,this._subElementEditorConfig?fi`<ha-form .hass="${this.hass}" @value-changed="${this._valueChanged}" .data="${this.config}" .schema="${Xn(this.hass)}" .computeLabel="${this._computeLabelCallback}"></ha-form>`:fi`<individual-row-editor .hass="${this.hass}" .config="${this.config}" .entities="${this._configEntities||[]}" @open-sub-element-editor="${this._editDetailElement}" @entities-changed="${this._entitiesChanged}" style="width:100%"></individual-row-editor>`):fi`<div>no config</div>`}_valueChanged(e){const t=e.detail.value||"";this.config&&this.hass&&s(this,"config-changed",{config:t})}_entitiesChanged(e){let t=this.config;t={...t,entities:{...t.entities,individual:e.detail.entities}},this._configEntities=(t.entities.individual??[]).map(e=>"string"==typeof e?{entity:e}:e),s(this,"config-changed",{config:t})}_editDetailElement(e){this._subElementEditorConfig=e.detail.subElementConfig}static get styles(){return Ut``}};e([_n({attribute:!1}),t("design:type",Object)],mr.prototype,"config",void 0),e([mn(),t("design:type",Object)],mr.prototype,"_subElementEditorConfig",void 0),e([mn(),t("design:type",Array)],mr.prototype,"_configEntities",void 0),mr=e([un("individual-devices-editor")],mr);let yr=class extends Bi{constructor(){super(...arguments),this.outlined=!1,this.leftChevron=!1,this.icon="mdi:format-list-bulleted-type"}render(){return fi`<div class="link-subpage" @click="${this._openSubElementPage}" @keydown="${this._openSubElementPage}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button"><ha-icon icon="${this.icon}" class="summary-icon"></ha-icon><slot name="header"><div class="header">${this.header}<slot class="secondary" name="secondary">${this.secondary}</slot></div></slot><ha-svg-icon .path="${"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}" class="summary-icon-right"></ha-svg-icon></div>`}_focusChanged(e){this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}_openSubElementPage(){s(this,"open-sub-element-editor",{open:!0})}static get styles(){return Ut`:host{display:block}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));border-radius:var(--ha-card-border-radius,12px)}:host([leftchevron]) .summary-icon{margin-left:0;margin-right:8px}.link-subpage{width:100%;display:flex;gap:1rem;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}.summary-icon{transition:transform 150ms cubic-bezier(.4,0,.2,1);direction:var(--direction);color:var(--secondary-text-color)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1);height:0}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`}};var fr;e([_n({type:String}),t("design:type",String)],yr.prototype,"path",void 0),e([_n({type:Boolean,reflect:!0}),t("design:type",Object)],yr.prototype,"outlined",void 0),e([_n({type:Boolean,reflect:!0}),t("design:type",Object)],yr.prototype,"leftChevron",void 0),e([_n(),t("design:type",String)],yr.prototype,"header",void 0),e([_n({type:String}),t("design:type",Object)],yr.prototype,"icon",void 0),e([_n(),t("design:type",String)],yr.prototype,"secondary",void 0),e([(fr=".container",(e,t)=>{const i={get(){return this.renderRoot.querySelector(fr)},enumerable:!0,configurable:!0};return void 0!==t?yn(i,e,t):fn(i,e)}),t("design:type",HTMLDivElement)],yr.prototype,"_container",void 0),yr=e([un("link-subpage")],yr);let gr=class extends Bi{render(){return fi`<div class="header"><div class="back-title"><ha-icon-button .label="${"Go Back"}" .path="${"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}" @click="${this._goBack}"></ha-icon-button><span>${ca(`editor.${this.page}`)}</span></div></div>`}_goBack(){s(this,"go-back")}static get styles(){return Ut`.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.back-title{display:flex;align-items:center;font-size:18px}`}};e([_n({attribute:!1}),t("design:type",Object)],gr.prototype,"config",void 0),e([_n(),t("design:type",Object)],gr.prototype,"page",void 0),gr=e([un("subpage-header")],gr);const vr=[{page:"grid",icon:"mdi:transmission-tower",schema:Gn},{page:"solar",icon:"mdi:solar-power",schema:Kn},{page:"battery",icon:"mdi:battery-high",schema:jn},{page:"fossil_fuel_percentage",icon:"mdi:leaf",schema:Rn},{page:"home",icon:"mdi:home",schema:Vn},{page:"individual",icon:"mdi:dots-horizontal-circle-outline"},{page:"advanced",icon:"mdi:cog",schema:Jn}];let br=class extends Bi{constructor(){super(...arguments),this._configEntities=[],this._currentConfigPage=null,this._computeLabelCallback=e=>this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e?.name}`)||ca(`editor.${e?.name}`)||e?.label}async setConfig(e){fa(e,qn),this._config=e}connectedCallback(){super.connectedCallback(),er()}_editDetailElement(e){this._currentConfigPage=e}_goBack(){this._currentConfigPage=null}render(){if(!this.hass||!this._config)return vi;const e={...this._config,display_zero_lines:{mode:this._config.display_zero_lines?.mode??Tt.displayZeroLines.mode,transparency:this._config.display_zero_lines?.transparency??Tt.displayZeroLines.transparency,grey_color:this._config.display_zero_lines?.grey_color??Tt.displayZeroLines.grey_color}};if(null!==this._currentConfigPage){if("individual"===this._currentConfigPage)return fi`<subpage-header @go-back="${this._goBack}" page="${this._currentConfigPage}"></subpage-header><individual-devices-editor .hass="${this.hass}" .config="${this._config}" @config-changed="${this._valueChanged}"></individual-devices-editor>`;const t=this._currentConfigPage,i="advanced"===t?Jn(ca,this._config.display_zero_lines?.mode??Tt.displayZeroLines.mode):vr.find(e=>e.page===t)?.schema,o="advanced"===t?e:e.entities[t];return fi`<subpage-header @go-back="${this._goBack}" page="${this._currentConfigPage}"></subpage-header><ha-form .hass="${this.hass}" .data="${o}" .schema="${i}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form>`}const t=(e,t="mdi:dots-horizontal-circle-outline")=>{if(null===e)return vi;const i=(()=>"individual"===e||"advanced"===e?t:this?._config?.entities[e]?.icon||t)();return fi`<link-subpage path="${e}" header="${ca(`editor.${e}`)}" @open-sub-element-editor="${()=>this._editDetailElement(e)}" icon="${i}"></link-subpage>`};return fi`<div class="card-config"><ha-form .hass="${this.hass}" .data="${e}" .schema="${Yn}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form>${vr.map(e=>t(e.page,e.icon))}</div>`}_valueChanged(e){let t=e.detail.value||"";this._config&&this.hass&&(null!==this._currentConfigPage&&"advanced"!==this._currentConfigPage&&"individual"!==this._currentConfigPage&&(t={...this._config,entities:{...this._config.entities,[this._currentConfigPage]:t}}),s(this,"config-changed",{config:t}))}static get styles(){return Ut`ha-form{width:100%}ha-icon-button{align-self:center}.entities-section *{background-color:red}.card-config{display:flex;flex-direction:column;gap:1.5rem;margin-bottom:10px}.config-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:100%}.config-header.sub-header{margin-top:24px}ha-icon{padding-bottom:2px;position:relative;top:-4px;right:1px}`}};e([Ii({attribute:!1}),t("design:type",Object)],br.prototype,"hass",void 0),e([Ri(),t("design:type",Object)],br.prototype,"_config",void 0),e([Ri(),t("design:type",Array)],br.prototype,"_configEntities",void 0),e([Ri(),t("design:type",Object)],br.prototype,"_currentConfigPage",void 0),br=e([Hi("power-flow-card-plus-editor")],br);var wr=Object.freeze({__proto__:null,get PowerFlowCardPlusEditor(){return br}});function kr(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function $r(){return $r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},$r.apply(null,arguments)}function xr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,o)}return i}function Sr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(i),!0).forEach(function(t){kr(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):xr(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Er(e){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Er(e)}function Cr(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Ar=Cr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Mr=Cr(/Edge/i),Pr=Cr(/firefox/i),Dr=Cr(/safari/i)&&!Cr(/chrome/i)&&!Cr(/android/i),zr=Cr(/iP(ad|od|hone)/i),Tr=Cr(/chrome/i)&&Cr(/android/i),Or={capture:!1,passive:!1};function Nr(e,t,i){e.addEventListener(t,i,!Ar&&Or)}function Wr(e,t,i){e.removeEventListener(t,i,!Ar&&Or)}function jr(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Br(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function Ur(e,t,i,o){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&jr(e,t):jr(e,t))||o&&e===i)return e;if(e===i)break}while(e=Br(e))}return null}var Hr,Lr=/\s+/g;function Ir(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(Lr," ").replace(" "+t+" "," ");e.className=(o+(i?" "+t:"")).replace(Lr," ")}}function Rr(e,t,i){var o=e&&e.style;if(o){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=i+("string"==typeof i?"":"px")}}function Fr(e,t){var i="";if("string"==typeof e)i=e;else do{var o=Rr(e,"transform");o&&"none"!==o&&(i=o+" "+i)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(i)}function Gr(e,t,i){if(e){var o=e.getElementsByTagName(t),a=0,n=o.length;if(i)for(;a<n;a++)i(o[a],a);return o}return[]}function Vr(){var e=document.scrollingElement;return e||document.documentElement}function Zr(e,t,i,o,a){if(e.getBoundingClientRect||e===window){var n,r,s,l,c,d,h;if(e!==window&&e.parentNode&&e!==Vr()?(r=(n=e.getBoundingClientRect()).top,s=n.left,l=n.bottom,c=n.right,d=n.height,h=n.width):(r=0,s=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||i)&&e!==window&&(a=a||e.parentNode,!Ar))do{if(a&&a.getBoundingClientRect&&("none"!==Rr(a,"transform")||i&&"static"!==Rr(a,"position"))){var u=a.getBoundingClientRect();r-=u.top+parseInt(Rr(a,"border-top-width")),s-=u.left+parseInt(Rr(a,"border-left-width")),l=r+n.height,c=s+n.width;break}}while(a=a.parentNode);if(o&&e!==window){var p=Fr(a||e),_=p&&p.a,m=p&&p.d;p&&(l=(r/=m)+(d/=m),c=(s/=_)+(h/=_))}return{top:r,left:s,bottom:l,right:c,width:h,height:d}}}function Kr(e,t,i){for(var o=Qr(e,!0),a=Zr(e)[t];o;){if(!(a>=Zr(o)[i]))return o;if(o===Vr())break;o=Qr(o,!1)}return!1}function qr(e,t,i,o){for(var a=0,n=0,r=e.children;n<r.length;){if("none"!==r[n].style.display&&r[n]!==ol.ghost&&(o||r[n]!==ol.dragged)&&Ur(r[n],i.draggable,e,!1)){if(a===t)return r[n];a++}n++}return null}function Yr(e,t){for(var i=e.lastElementChild;i&&(i===ol.ghost||"none"===Rr(i,"display")||t&&!jr(i,t));)i=i.previousElementSibling;return i||null}function Xr(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===ol.clone||t&&!jr(e,t)||i++;return i}function Jr(e){var t=0,i=0,o=Vr();if(e)do{var a=Fr(e),n=a.a,r=a.d;t+=e.scrollLeft*n,i+=e.scrollTop*r}while(e!==o&&(e=e.parentNode));return[t,i]}function Qr(e,t){if(!e||!e.getBoundingClientRect)return Vr();var i=e,o=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var a=Rr(i);if(i.clientWidth<i.scrollWidth&&("auto"==a.overflowX||"scroll"==a.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==a.overflowY||"scroll"==a.overflowY)){if(!i.getBoundingClientRect||i===document.body)return Vr();if(o||t)return i;o=!0}}}while(i=i.parentNode);return Vr()}function es(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function ts(e,t){return function(){if(!Hr){var i=arguments;1===i.length?e.call(this,i[0]):e.apply(this,i),Hr=setTimeout(function(){Hr=void 0},t)}}}function is(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function os(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function as(e,t,i){var o={};return Array.from(e.children).forEach(function(a){var n,r,s,l;if(Ur(a,t.draggable,e,!1)&&!a.animated&&a!==i){var c=Zr(a);o.left=Math.min(null!==(n=o.left)&&void 0!==n?n:1/0,c.left),o.top=Math.min(null!==(r=o.top)&&void 0!==r?r:1/0,c.top),o.right=Math.max(null!==(s=o.right)&&void 0!==s?s:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var ns="Sortable"+(new Date).getTime();function rs(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==Rr(e,"display")&&e!==ol.ghost){t.push({target:e,rect:Zr(e)});var i=Sr({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=Fr(e,!0);o&&(i.top-=o.f,i.left-=o.e)}e.fromRect=i}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var i in e)if(e.hasOwnProperty(i))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[i][o])return Number(i);return-1}(t,{target:e}),1)},animateAll:function(i){var o=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof i&&i());var a=!1,n=0;t.forEach(function(e){var t=0,i=e.target,r=i.fromRect,s=Zr(i),l=i.prevFromRect,c=i.prevToRect,d=e.rect,h=Fr(i,!0);h&&(s.top-=h.f,s.left-=h.e),i.toRect=s,i.thisAnimationDuration&&es(l,s)&&!es(r,s)&&(d.top-s.top)/(d.left-s.left)===(r.top-s.top)/(r.left-s.left)&&(t=function(e,t,i,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*o.animation}(d,l,c,o.options)),es(s,r)||(i.prevFromRect=r,i.prevToRect=s,t||(t=o.options.animation),o.animate(i,d,s,t)),t&&(a=!0,n=Math.max(n,t),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},t),i.thisAnimationDuration=t)}),clearTimeout(e),a?e=setTimeout(function(){"function"==typeof i&&i()},n):"function"==typeof i&&i(),t=[]},animate:function(e,t,i,o){if(o){Rr(e,"transition",""),Rr(e,"transform","");var a=Fr(this.el),n=a&&a.a,r=a&&a.d,s=(t.left-i.left)/(n||1),l=(t.top-i.top)/(r||1);e.animatingX=!!s,e.animatingY=!!l,Rr(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),Rr(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Rr(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){Rr(e,"transition",""),Rr(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},o)}}}}var ss=[],ls={initializeByDefault:!0},cs={mount:function(e){for(var t in ls)ls.hasOwnProperty(t)&&!(t in e)&&(e[t]=ls[t]);ss.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ss.push(e)},pluginEvent:function(e,t,i){var o=this;this.eventCanceled=!1,i.cancel=function(){o.eventCanceled=!0};var a=e+"Global";ss.forEach(function(o){t[o.pluginName]&&(t[o.pluginName][a]&&t[o.pluginName][a](Sr({sortable:t},i)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](Sr({sortable:t},i)))})},initializePlugins:function(e,t,i,o){for(var a in ss.forEach(function(o){var a=o.pluginName;if(e.options[a]||o.initializeByDefault){var n=new o(e,t,e.options);n.sortable=e,n.options=e.options,e[a]=n,$r(i,n.defaults)}}),e.options)if(e.options.hasOwnProperty(a)){var n=this.modifyOption(e,a,e.options[a]);void 0!==n&&(e.options[a]=n)}},getEventProperties:function(e,t){var i={};return ss.forEach(function(o){"function"==typeof o.eventProperties&&$r(i,o.eventProperties.call(t[o.pluginName],e))}),i},modifyOption:function(e,t,i){var o;return ss.forEach(function(a){e[a.pluginName]&&a.optionListeners&&"function"==typeof a.optionListeners[t]&&(o=a.optionListeners[t].call(e[a.pluginName],i))}),o}};var ds=["evt"],hs=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.evt,a=function(e,t){if(null==e)return{};var i,o,a=function(e,t){if(null==e)return{};var i={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;i[o]=e[o]}return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)i=n[o],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}(i,ds);cs.pluginEvent.bind(ol)(e,t,Sr({dragEl:ps,parentEl:_s,ghostEl:ms,rootEl:ys,nextEl:fs,lastDownEl:gs,cloneEl:vs,cloneHidden:bs,dragStarted:Ts,putSortable:Es,activeSortable:ol.active,originalEvent:o,oldIndex:ws,oldDraggableIndex:$s,newIndex:ks,newDraggableIndex:xs,hideGhostForTarget:Qs,unhideGhostForTarget:el,cloneNowHidden:function(){bs=!0},cloneNowShown:function(){bs=!1},dispatchSortableEvent:function(e){us({sortable:t,name:e,originalEvent:o})}},a))};function us(e){!function(e){var t=e.sortable,i=e.rootEl,o=e.name,a=e.targetEl,n=e.cloneEl,r=e.toEl,s=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,h=e.newDraggableIndex,u=e.originalEvent,p=e.putSortable,_=e.extraEventProperties;if(t=t||i&&i[ns]){var m,y=t.options,f="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Ar||Mr?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=r||i,m.from=s||i,m.item=a||i,m.clone=n,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=h,m.originalEvent=u,m.pullMode=p?p.lastPutMode:void 0;var g=Sr(Sr({},_),cs.getEventProperties(o,t));for(var v in g)m[v]=g[v];i&&i.dispatchEvent(m),y[f]&&y[f].call(t,m)}}(Sr({putSortable:Es,cloneEl:vs,targetEl:ps,rootEl:ys,oldIndex:ws,oldDraggableIndex:$s,newIndex:ks,newDraggableIndex:xs},e))}var ps,_s,ms,ys,fs,gs,vs,bs,ws,ks,$s,xs,Ss,Es,Cs,As,Ms,Ps,Ds,zs,Ts,Os,Ns,Ws,js,Bs=!1,Us=!1,Hs=[],Ls=!1,Is=!1,Rs=[],Fs=!1,Gs=[],Vs="undefined"!=typeof document,Zs=zr,Ks=Mr||Ar?"cssFloat":"float",qs=Vs&&!Tr&&!zr&&"draggable"in document.createElement("div"),Ys=function(){if(Vs){if(Ar)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Xs=function(e,t){var i=Rr(e),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),a=qr(e,0,t),n=qr(e,1,t),r=a&&Rr(a),s=n&&Rr(n),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+Zr(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Zr(n).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&"none"!==r.float){var d="left"===r.float?"left":"right";return!n||"both"!==s.clear&&s.clear!==d?"horizontal":"vertical"}return a&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=o&&"none"===i[Ks]||n&&"none"===i[Ks]&&l+c>o)?"vertical":"horizontal"},Js=function(e){function t(e,i){return function(o,a,n,r){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==e&&(i||s))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"==typeof e)return t(e(o,a,n,r),i)(o,a,n,r);var l=(i?o:a).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},o=e.group;o&&"object"==Er(o)||(o={name:o}),i.name=o.name,i.checkPull=t(o.pull,!0),i.checkPut=t(o.put),i.revertClone=o.revertClone,e.group=i},Qs=function(){!Ys&&ms&&Rr(ms,"display","none")},el=function(){!Ys&&ms&&Rr(ms,"display","")};Vs&&!Tr&&document.addEventListener("click",function(e){if(Us)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Us=!1,!1},!0);var tl=function(e){if(ps){var t=function(e,t){var i;return Hs.some(function(o){var a=o[ns].options.emptyInsertThreshold;if(a&&!Yr(o)){var n=Zr(o),r=e>=n.left-a&&e<=n.right+a,s=t>=n.top-a&&t<=n.bottom+a;return r&&s?i=o:void 0}}),i}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var i={};for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[ns]._onDragOver(i)}}},il=function(e){ps&&ps.parentNode[ns]._isOutsideThisEl(e.target)};function ol(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$r({},t),e[ns]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xs(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==ol.supportPointer&&"PointerEvent"in window&&(!Dr||zr),emptyInsertThreshold:5};for(var o in cs.initializePlugins(this,e,i),i)!(o in t)&&(t[o]=i[o]);for(var a in Js(t),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!t.forceFallback&&qs,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Nr(e,"pointerdown",this._onTapStart):(Nr(e,"mousedown",this._onTapStart),Nr(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Nr(e,"dragover",this),Nr(e,"dragenter",this)),Hs.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$r(this,rs())}function al(e,t,i,o,a,n,r,s){var l,c,d=e[ns],h=d.options.onMove;return!window.CustomEvent||Ar||Mr?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=o,l.related=a||t,l.relatedRect=n||Zr(t),l.willInsertAfter=s,l.originalEvent=r,e.dispatchEvent(l),h&&(c=h.call(d,l,r)),c}function nl(e){e.draggable=!1}function rl(){Fs=!1}function sl(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,o=0;i--;)o+=t.charCodeAt(i);return o.toString(36)}function ll(e){return setTimeout(e,0)}function cl(e){return clearTimeout(e)}ol.prototype={constructor:ol,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Os=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,ps):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,o=this.options,a=o.preventOnFilter,n=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=o.filter;if(function(e){Gs.length=0;var t=e.getElementsByTagName("input"),i=t.length;for(;i--;){var o=t[i];o.checked&&Gs.push(o)}}(i),!ps&&!(/mousedown|pointerdown/.test(n)&&0!==e.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Dr||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=Ur(s,o.draggable,i,!1))&&s.animated||gs===s)){if(ws=Xr(s),$s=Xr(s,o.draggable),"function"==typeof c){if(c.call(this,e,s,this))return us({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:i,fromEl:i}),hs("filter",t,{evt:e}),void(a&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(o){if(o=Ur(l,o.trim(),i,!1))return us({sortable:t,rootEl:o,name:"filter",targetEl:s,fromEl:i,toEl:i}),hs("filter",t,{evt:e}),!0})))return void(a&&e.preventDefault());o.handle&&!Ur(l,o.handle,i,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,i){var o,a=this,n=a.el,r=a.options,s=n.ownerDocument;if(i&&!ps&&i.parentNode===n){var l=Zr(i);if(ys=n,_s=(ps=i).parentNode,fs=ps.nextSibling,gs=i,Ss=r.group,ol.dragged=ps,Cs={target:ps,clientX:(t||e).clientX,clientY:(t||e).clientY},Ds=Cs.clientX-l.left,zs=Cs.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ps.style["will-change"]="all",o=function(){hs("delayEnded",a,{evt:e}),ol.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!Pr&&a.nativeDraggable&&(ps.draggable=!0),a._triggerDragStart(e,t),us({sortable:a,name:"choose",originalEvent:e}),Ir(ps,r.chosenClass,!0))},r.ignore.split(",").forEach(function(e){Gr(ps,e.trim(),nl)}),Nr(s,"dragover",tl),Nr(s,"mousemove",tl),Nr(s,"touchmove",tl),r.supportPointer?(Nr(s,"pointerup",a._onDrop),!this.nativeDraggable&&Nr(s,"pointercancel",a._onDrop)):(Nr(s,"mouseup",a._onDrop),Nr(s,"touchend",a._onDrop),Nr(s,"touchcancel",a._onDrop)),Pr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ps.draggable=!0),hs("delayStart",this,{evt:e}),!r.delay||r.delayOnTouchOnly&&!t||this.nativeDraggable&&(Mr||Ar))o();else{if(ol.eventCanceled)return void this._onDrop();r.supportPointer?(Nr(s,"pointerup",a._disableDelayedDrag),Nr(s,"pointercancel",a._disableDelayedDrag)):(Nr(s,"mouseup",a._disableDelayedDrag),Nr(s,"touchend",a._disableDelayedDrag),Nr(s,"touchcancel",a._disableDelayedDrag)),Nr(s,"mousemove",a._delayedDragTouchMoveHandler),Nr(s,"touchmove",a._delayedDragTouchMoveHandler),r.supportPointer&&Nr(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,r.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ps&&nl(ps),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Wr(e,"mouseup",this._disableDelayedDrag),Wr(e,"touchend",this._disableDelayedDrag),Wr(e,"touchcancel",this._disableDelayedDrag),Wr(e,"pointerup",this._disableDelayedDrag),Wr(e,"pointercancel",this._disableDelayedDrag),Wr(e,"mousemove",this._delayedDragTouchMoveHandler),Wr(e,"touchmove",this._delayedDragTouchMoveHandler),Wr(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Nr(document,"pointermove",this._onTouchMove):Nr(document,t?"touchmove":"mousemove",this._onTouchMove):(Nr(ps,"dragend",this),Nr(ys,"dragstart",this._onDragStart));try{document.selection?ll(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Bs=!1,ys&&ps){hs("dragStarted",this,{evt:t}),this.nativeDraggable&&Nr(document,"dragover",il);var i=this.options;!e&&Ir(ps,i.dragClass,!1),Ir(ps,i.ghostClass,!0),ol.active=this,e&&this._appendGhost(),us({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(As){this._lastX=As.clientX,this._lastY=As.clientY,Qs();for(var e=document.elementFromPoint(As.clientX,As.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(As.clientX,As.clientY))!==t;)t=e;if(ps.parentNode[ns]._isOutsideThisEl(e),t)do{if(t[ns]){if(t[ns]._onDragOver({clientX:As.clientX,clientY:As.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=Br(t));el()}},_onTouchMove:function(e){if(Cs){var t=this.options,i=t.fallbackTolerance,o=t.fallbackOffset,a=e.touches?e.touches[0]:e,n=ms&&Fr(ms,!0),r=ms&&n&&n.a,s=ms&&n&&n.d,l=Zs&&js&&Jr(js),c=(a.clientX-Cs.clientX+o.x)/(r||1)+(l?l[0]-Rs[0]:0)/(r||1),d=(a.clientY-Cs.clientY+o.y)/(s||1)+(l?l[1]-Rs[1]:0)/(s||1);if(!ol.active&&!Bs){if(i&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(ms){n?(n.e+=c-(Ms||0),n.f+=d-(Ps||0)):n={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(n.a,",").concat(n.b,",").concat(n.c,",").concat(n.d,",").concat(n.e,",").concat(n.f,")");Rr(ms,"webkitTransform",h),Rr(ms,"mozTransform",h),Rr(ms,"msTransform",h),Rr(ms,"transform",h),Ms=c,Ps=d,As=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ms){var e=this.options.fallbackOnBody?document.body:ys,t=Zr(ps,!0,Zs,!0,e),i=this.options;if(Zs){for(js=e;"static"===Rr(js,"position")&&"none"===Rr(js,"transform")&&js!==document;)js=js.parentNode;js!==document.body&&js!==document.documentElement?(js===document&&(js=Vr()),t.top+=js.scrollTop,t.left+=js.scrollLeft):js=Vr(),Rs=Jr(js)}Ir(ms=ps.cloneNode(!0),i.ghostClass,!1),Ir(ms,i.fallbackClass,!0),Ir(ms,i.dragClass,!0),Rr(ms,"transition",""),Rr(ms,"transform",""),Rr(ms,"box-sizing","border-box"),Rr(ms,"margin",0),Rr(ms,"top",t.top),Rr(ms,"left",t.left),Rr(ms,"width",t.width),Rr(ms,"height",t.height),Rr(ms,"opacity","0.8"),Rr(ms,"position",Zs?"absolute":"fixed"),Rr(ms,"zIndex","100000"),Rr(ms,"pointerEvents","none"),ol.ghost=ms,e.appendChild(ms),Rr(ms,"transform-origin",Ds/parseInt(ms.style.width)*100+"% "+zs/parseInt(ms.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,o=e.dataTransfer,a=i.options;hs("dragStart",this,{evt:e}),ol.eventCanceled?this._onDrop():(hs("setupClone",this),ol.eventCanceled||((vs=os(ps)).removeAttribute("id"),vs.draggable=!1,vs.style["will-change"]="",this._hideClone(),Ir(vs,this.options.chosenClass,!1),ol.clone=vs),i.cloneId=ll(function(){hs("clone",i),ol.eventCanceled||(i.options.removeCloneOnHide||ys.insertBefore(vs,ps),i._hideClone(),us({sortable:i,name:"clone"}))}),!t&&Ir(ps,a.dragClass,!0),t?(Us=!0,i._loopId=setInterval(i._emulateDragOver,50)):(Wr(document,"mouseup",i._onDrop),Wr(document,"touchend",i._onDrop),Wr(document,"touchcancel",i._onDrop),o&&(o.effectAllowed="move",a.setData&&a.setData.call(i,o,ps)),Nr(document,"drop",i),Rr(ps,"transform","translateZ(0)")),Bs=!0,i._dragStartId=ll(i._dragStarted.bind(i,t,e)),Nr(document,"selectstart",i),Ts=!0,window.getSelection().removeAllRanges(),Dr&&Rr(document.body,"user-select","none"))},_onDragOver:function(e){var t,i,o,a,n=this.el,r=e.target,s=this.options,l=s.group,c=ol.active,d=Ss===l,h=s.sort,u=Es||c,p=this,_=!1;if(!Fs){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),r=Ur(r,s.draggable,n,!0),M("dragOver"),ol.eventCanceled)return _;if(ps.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||p._ignoreWhileAnimating===r)return D(!1);if(Us=!1,c&&!s.disabled&&(d?h||(o=_s!==ys):Es===this||(this.lastPutMode=Ss.checkPull(this,c,ps,e))&&l.checkPut(this,c,ps,e))){if(a="vertical"===this._getDirection(e,r),t=Zr(ps),M("dragOverValid"),ol.eventCanceled)return _;if(o)return _s=ys,P(),this._hideClone(),M("revert"),ol.eventCanceled||(fs?ys.insertBefore(ps,fs):ys.appendChild(ps)),D(!0);var m=Yr(n,s.draggable);if(!m||function(e,t,i){var o=Zr(Yr(i.el,i.options.draggable)),a=as(i.el,i.options,ms),n=10;return t?e.clientX>a.right+n||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>a.bottom+n||e.clientX>o.right&&e.clientY>o.top}(e,a,this)&&!m.animated){if(m===ps)return D(!1);if(m&&n===e.target&&(r=m),r&&(i=Zr(r)),!1!==al(ys,n,ps,t,r,i,e,!!r))return P(),m&&m.nextSibling?n.insertBefore(ps,m.nextSibling):n.appendChild(ps),_s=n,z(),D(!0)}else if(m&&function(e,t,i){var o=Zr(qr(i.el,0,i.options,!0)),a=as(i.el,i.options,ms),n=10;return t?e.clientX<a.left-n||e.clientY<o.top&&e.clientX<o.right:e.clientY<a.top-n||e.clientY<o.bottom&&e.clientX<o.left}(e,a,this)){var y=qr(n,0,s,!0);if(y===ps)return D(!1);if(i=Zr(r=y),!1!==al(ys,n,ps,t,r,i,e,!1))return P(),n.insertBefore(ps,y),_s=n,z(),D(!0)}else if(r.parentNode===n){i=Zr(r);var f,g,v,b=ps.parentNode!==n,w=!function(e,t,i){var o=i?e.left:e.top,a=i?e.right:e.bottom,n=i?e.width:e.height,r=i?t.left:t.top,s=i?t.right:t.bottom,l=i?t.width:t.height;return o===r||a===s||o+n/2===r+l/2}(ps.animated&&ps.toRect||t,r.animated&&r.toRect||i,a),k=a?"top":"left",$=Kr(r,"top","top")||Kr(ps,"top","top"),x=$?$.scrollTop:void 0;if(Os!==r&&(g=i[k],Ls=!1,Is=!w&&s.invertSwap||b),f=function(e,t,i,o,a,n,r,s){var l=o?e.clientY:e.clientX,c=o?i.height:i.width,d=o?i.top:i.left,h=o?i.bottom:i.right,u=!1;if(!r)if(s&&Ws<c*a){if(!Ls&&(1===Ns?l>d+c*n/2:l<h-c*n/2)&&(Ls=!0),Ls)u=!0;else if(1===Ns?l<d+Ws:l>h-Ws)return-Ns}else if(l>d+c*(1-a)/2&&l<h-c*(1-a)/2)return function(e){return Xr(ps)<Xr(e)?1:-1}(t);if((u=u||r)&&(l<d+c*n/2||l>h-c*n/2))return l>d+c/2?1:-1;return 0}(e,r,i,a,w?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Is,Os===r),0!==f){var S=Xr(ps);do{S-=f,v=_s.children[S]}while(v&&("none"===Rr(v,"display")||v===ms))}if(0===f||v===r)return D(!1);Os=r,Ns=f;var E=r.nextElementSibling,C=!1,A=al(ys,n,ps,t,r,i,e,C=1===f);if(!1!==A)return 1!==A&&-1!==A||(C=1===A),Fs=!0,setTimeout(rl,30),P(),C&&!E?n.appendChild(ps):r.parentNode.insertBefore(ps,C?E:r),$&&is($,0,x-$.scrollTop),_s=ps.parentNode,void 0===g||Is||(Ws=Math.abs(g-Zr(r)[k])),z(),D(!0)}if(n.contains(ps))return D(!1)}return!1}function M(s,l){hs(s,p,Sr({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:o,dragRect:t,targetRect:i,canSort:h,fromSortable:u,target:r,completed:D,onMove:function(i,o){return al(ys,n,ps,t,i,Zr(i),e,o)},changed:z},l))}function P(){M("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function D(t){return M("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==u&&(Ir(ps,Es?Es.options.ghostClass:c.options.ghostClass,!1),Ir(ps,s.ghostClass,!0)),Es!==p&&p!==ol.active?Es=p:p===ol.active&&Es&&(Es=null),u===p&&(p._ignoreWhileAnimating=r),p.animateAll(function(){M("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(r===ps&&!ps.animated||r===n&&!r.animated)&&(Os=null),s.dragoverBubble||e.rootEl||r===document||(ps.parentNode[ns]._isOutsideThisEl(e.target),!t&&tl(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),_=!0}function z(){ks=Xr(ps),xs=Xr(ps,s.draggable),us({sortable:p,name:"change",toEl:n,newIndex:ks,newDraggableIndex:xs,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Wr(document,"mousemove",this._onTouchMove),Wr(document,"touchmove",this._onTouchMove),Wr(document,"pointermove",this._onTouchMove),Wr(document,"dragover",tl),Wr(document,"mousemove",tl),Wr(document,"touchmove",tl)},_offUpEvents:function(){var e=this.el.ownerDocument;Wr(e,"mouseup",this._onDrop),Wr(e,"touchend",this._onDrop),Wr(e,"pointerup",this._onDrop),Wr(e,"pointercancel",this._onDrop),Wr(e,"touchcancel",this._onDrop),Wr(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;ks=Xr(ps),xs=Xr(ps,i.draggable),hs("drop",this,{evt:e}),_s=ps&&ps.parentNode,ks=Xr(ps),xs=Xr(ps,i.draggable),ol.eventCanceled||(Bs=!1,Is=!1,Ls=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),cl(this.cloneId),cl(this._dragStartId),this.nativeDraggable&&(Wr(document,"drop",this),Wr(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dr&&Rr(document.body,"user-select",""),Rr(ps,"transform",""),e&&(Ts&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),ms&&ms.parentNode&&ms.parentNode.removeChild(ms),(ys===_s||Es&&"clone"!==Es.lastPutMode)&&vs&&vs.parentNode&&vs.parentNode.removeChild(vs),ps&&(this.nativeDraggable&&Wr(ps,"dragend",this),nl(ps),ps.style["will-change"]="",Ts&&!Bs&&Ir(ps,Es?Es.options.ghostClass:this.options.ghostClass,!1),Ir(ps,this.options.chosenClass,!1),us({sortable:this,name:"unchoose",toEl:_s,newIndex:null,newDraggableIndex:null,originalEvent:e}),ys!==_s?(ks>=0&&(us({rootEl:_s,name:"add",toEl:_s,fromEl:ys,originalEvent:e}),us({sortable:this,name:"remove",toEl:_s,originalEvent:e}),us({rootEl:_s,name:"sort",toEl:_s,fromEl:ys,originalEvent:e}),us({sortable:this,name:"sort",toEl:_s,originalEvent:e})),Es&&Es.save()):ks!==ws&&ks>=0&&(us({sortable:this,name:"update",toEl:_s,originalEvent:e}),us({sortable:this,name:"sort",toEl:_s,originalEvent:e})),ol.active&&(null!=ks&&-1!==ks||(ks=ws,xs=$s),us({sortable:this,name:"end",toEl:_s,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){hs("nulling",this),ys=ps=_s=ms=fs=vs=gs=bs=Cs=As=Ts=ks=xs=ws=$s=Os=Ns=Es=Ss=ol.dragged=ol.ghost=ol.clone=ol.active=null;var e=this.el;Gs.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Gs.length=Ms=Ps=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ps&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],i=this.el.children,o=0,a=i.length,n=this.options;o<a;o++)Ur(e=i[o],n.draggable,this.el,!1)&&t.push(e.getAttribute(n.dataIdAttr)||sl(e));return t},sort:function(e,t){var i={},o=this.el;this.toArray().forEach(function(e,t){var a=o.children[t];Ur(a,this.options.draggable,o,!1)&&(i[e]=a)},this),t&&this.captureAnimationState(),e.forEach(function(e){i[e]&&(o.removeChild(i[e]),o.appendChild(i[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ur(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(void 0===t)return i[e];var o=cs.modifyOption(this,e,t);i[e]=void 0!==o?o:t,"group"===e&&Js(i)},destroy:function(){hs("destroy",this);var e=this.el;e[ns]=null,Wr(e,"mousedown",this._onTapStart),Wr(e,"touchstart",this._onTapStart),Wr(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Wr(e,"dragover",this),Wr(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Hs.splice(Hs.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!bs){if(hs("hideClone",this),ol.eventCanceled)return;Rr(vs,"display","none"),this.options.removeCloneOnHide&&vs.parentNode&&vs.parentNode.removeChild(vs),bs=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(bs){if(hs("showClone",this),ol.eventCanceled)return;ps.parentNode!=ys||this.options.group.revertClone?fs?ys.insertBefore(vs,fs):ys.appendChild(vs):ys.insertBefore(vs,ps),this.options.group.revertClone&&this.animate(ps,vs),Rr(vs,"display",""),bs=!1}}else this._hideClone()}},Vs&&Nr(document,"touchmove",function(e){(ol.active||Bs)&&e.cancelable&&e.preventDefault()}),ol.utils={on:Nr,off:Wr,css:Rr,find:Gr,is:function(e,t){return!!Ur(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},throttle:ts,closest:Ur,toggleClass:Ir,clone:os,index:Xr,nextTick:ll,cancelNextTick:cl,detectDirection:Xs,getChild:qr,expando:ns},ol.get=function(e){return e[ns]},ol.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(ol.utils=Sr(Sr({},ol.utils),e.utils)),cs.mount(e)})},ol.create=function(e,t){return new ol(e,t)},ol.version="1.15.7";var dl,hl,ul,pl,_l,ml,yl=[],fl=!1;function gl(){yl.forEach(function(e){clearInterval(e.pid)}),yl=[]}function vl(){clearInterval(ml)}var bl=ts(function(e,t,i,o){if(t.scroll){var a,n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=Vr(),d=!1;hl!==i&&(hl=i,gl(),dl=t.scroll,a=t.scrollFn,!0===dl&&(dl=Qr(i,!0)));var h=0,u=dl;do{var p=u,_=Zr(p),m=_.top,y=_.bottom,f=_.left,g=_.right,v=_.width,b=_.height,w=void 0,k=void 0,$=p.scrollWidth,x=p.scrollHeight,S=Rr(p),E=p.scrollLeft,C=p.scrollTop;p===c?(w=v<$&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),k=b<x&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(w=v<$&&("auto"===S.overflowX||"scroll"===S.overflowX),k=b<x&&("auto"===S.overflowY||"scroll"===S.overflowY));var A=w&&(Math.abs(g-n)<=s&&E+v<$)-(Math.abs(f-n)<=s&&!!E),M=k&&(Math.abs(y-r)<=s&&C+b<x)-(Math.abs(m-r)<=s&&!!C);if(!yl[h])for(var P=0;P<=h;P++)yl[P]||(yl[P]={});yl[h].vx==A&&yl[h].vy==M&&yl[h].el===p||(yl[h].el=p,yl[h].vx=A,yl[h].vy=M,clearInterval(yl[h].pid),0==A&&0==M||(d=!0,yl[h].pid=setInterval(function(){o&&0===this.layer&&ol.active._onTouchMove(_l);var t=yl[this.layer].vy?yl[this.layer].vy*l:0,i=yl[this.layer].vx?yl[this.layer].vx*l:0;"function"==typeof a&&"continue"!==a.call(ol.dragged.parentNode[ns],i,t,e,_l,yl[this.layer].el)||is(yl[this.layer].el,i,t)}.bind({layer:h}),24))),h++}while(t.bubbleScroll&&u!==c&&(u=Qr(u,!1)));fl=d}},30),wl=function(e){var t=e.originalEvent,i=e.putSortable,o=e.dragEl,a=e.activeSortable,n=e.dispatchSortableEvent,r=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=i||a;r();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(d)&&(n("spill"),this.onSpill({dragEl:o,putSortable:i}))}};function kl(){}function $l(){}kl.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var o=qr(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:wl},$r(kl,{pluginName:"revertOnSpill"}),$l.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:wl},$r($l,{pluginName:"removeOnSpill"});var xl=[$l,kl];ol.mount(xl,new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?Nr(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Nr(document,"pointermove",this._handleFallbackAutoScroll):t.touches?Nr(document,"touchmove",this._handleFallbackAutoScroll):Nr(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?Wr(document,"dragover",this._handleAutoScroll):(Wr(document,"pointermove",this._handleFallbackAutoScroll),Wr(document,"touchmove",this._handleFallbackAutoScroll),Wr(document,"mousemove",this._handleFallbackAutoScroll)),vl(),gl(),clearTimeout(Hr),Hr=void 0},nulling:function(){_l=hl=dl=fl=ml=ul=pl=null,yl.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var i=this,o=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,n=document.elementFromPoint(o,a);if(_l=e,t||this.options.forceAutoScrollFallback||Mr||Ar||Dr){bl(e,this.options,n,t);var r=Qr(n,!0);!fl||ml&&o===ul&&a===pl||(ml&&vl(),ml=setInterval(function(){var n=Qr(document.elementFromPoint(o,a),!0);n!==r&&(r=n,gl()),bl(e,i.options,n,t)},10),ul=o,pl=a)}else{if(!this.options.bubbleScroll||Qr(n,!0)===Vr())return void gl();bl(e,this.options,Qr(n,!1),!1)}}},$r(e,{pluginName:"scroll",initializeByDefault:!0})});var Sl=Object.freeze({__proto__:null,default:ol});export{Vi as PowerFlowCardPlus};