Files
Home-Assistant/www/community/lovelace-multiple-entity-row/multiple-entity-row.js
T
2026-07-08 10:43:39 -04:00

2 lines
36 KiB
JavaScript

/*! For license information please see multiple-entity-row.js.LICENSE.txt */
(()=>{"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),n=new WeakMap;class r{constructor(t,e,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=n.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(i,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const n=1===t.length?t[0]:e.reduce((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1],t[0]);return new r(n,t,i)},s=(i,n)=>{if(e)i.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),r=t.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=e.cssText,i.appendChild(n)}},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:c,defineProperty:u,getOwnPropertyDescriptor:l,getOwnPropertyNames:h,getOwnPropertySymbols:f,getPrototypeOf:d}=Object,p=globalThis,m=p.trustedTypes,y=m?m.emptyScript:"",b=p.reactiveElementPolyfillSupport,_=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},g=(t,e)=>!c(t,e),$={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class w extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&u(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=l(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const o=n?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...h(t),...f(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:v).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const o=r.fromAttribute(e,t.type);this[n]=o??this._$Ej?.get(n)??o,this._$Em=null}}requestUpdate(t,e,i,n=!1,r){if(void 0!==t){const o=this.constructor;if(!1===n&&(r=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??g)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:n,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,i,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[_("elementProperties")]=new Map,w[_("finalized")]=new Map,b?.({ReactiveElement:w}),(p.reactiveElementVersions??=[]).push("2.1.2");const A=globalThis,O=t=>t,S=A.trustedTypes,E=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",j=`lit$${Math.random().toFixed(9).slice(2)}$`,x="?"+j,k=`<${x}>`,C=document,D=()=>C.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,M="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H=/-->/g,R=/>/g,I=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,z=/"/g,L=/^(?:script|style|textarea|title)$/i,B=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),W=B(1),V=(B(2),B(3),Symbol.for("lit-noChange")),q=Symbol.for("lit-nothing"),Z=new WeakMap,J=C.createTreeWalker(C,129);function K(t,e){if(!T(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}const Y=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"<svg>":3===e?"<math>":"",s=U;for(let e=0;e<i;e++){const i=t[e];let a,c,u=-1,l=0;for(;l<i.length&&(s.lastIndex=l,c=s.exec(i),null!==c);)l=s.lastIndex,s===U?"!--"===c[1]?s=H:void 0!==c[1]?s=R:void 0!==c[2]?(L.test(c[2])&&(r=RegExp("</"+c[2],"g")),s=I):void 0!==c[3]&&(s=I):s===I?">"===c[0]?(s=r??U,u=-1):void 0===c[1]?u=-2:(u=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?I:'"'===c[3]?z:F):s===z||s===F?s=I:s===H||s===R?s=U:(s=I,r=void 0);const h=s===I&&t[e+1].startsWith("/>")?" ":"";o+=s===U?i+k:u>=0?(n.push(a),i.slice(0,u)+P+i.slice(u)+j+h):i+j+(-2===u?e:h)}return[K(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class G{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const s=t.length-1,a=this.parts,[c,u]=Y(t,e);if(this.el=G.createElement(c,i),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=J.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(P)){const e=u[o++],i=n.getAttribute(t).split(j),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:s[2],strings:i,ctor:"."===s[1]?it:"?"===s[1]?nt:"@"===s[1]?rt:et}),n.removeAttribute(t)}else t.startsWith(j)&&(a.push({type:6,index:r}),n.removeAttribute(t));if(L.test(n.tagName)){const t=n.textContent.split(j),e=t.length-1;if(e>0){n.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],D()),J.nextNode(),a.push({type:2,index:++r});n.append(t[e],D())}}}else if(8===n.nodeType)if(n.data===x)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(j,t+1));)a.push({type:7,index:r}),t+=j.length-1}r++}}static createElement(t,e){const i=C.createElement("template");return i.innerHTML=t,i}}function Q(t,e,i=t,n){if(e===V)return e;let r=void 0!==n?i._$Co?.[n]:i._$Cl;const o=N(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,n)),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(e=Q(t,r._$AS(t,e.values),r,n)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=(t?.creationScope??C).importNode(e,!0);J.currentNode=n;let r=J.nextNode(),o=0,s=0,a=i[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new tt(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new ot(r,this,t)),this._$AV.push(e),a=i[++s]}o!==a?.index&&(r=J.nextNode(),o++)}return J.currentNode=C,n}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),N(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==q&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(C.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new X(n,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new G(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new tt(this.O(D()),this.O(D()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=O(t).nextSibling;O(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=Q(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==V,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=Q(this,n[i+s],e,s),a===V&&(a=this._$AH[s]),o||=!N(a)||a!==this._$AH[s],a===q?t=q:t!==q&&(t+=(a??"")+r[s+1]),this._$AH[s]=a}o&&!n&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class nt extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class rt extends et{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??q)===V)return;const i=this._$AH,n=t===q&&i!==q||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==q&&(i===q||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const st=A.litHtmlPolyfillSupport;st?.(G,tt),(A.litHtmlVersions??=[]).push("3.3.3");const at=globalThis;class ct extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new tt(e.insertBefore(D(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}}ct._$litElement$=!0,ct.finalized=!0,at.litElementHydrateSupport?.({LitElement:ct});const ut=at.litElementPolyfillSupport;var lt,ht;ut?.({LitElement:ct}),(at.litElementVersions??=[]).push("4.2.2"),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(lt||(lt={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(ht||(ht={}));const ft=["closed","locked","off"],dt=(new Set(["fan","input_boolean","light","switch","group","automation"]),(t,e,i,n)=>{n=n||{},i=i??{};const r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r});new Set(["call-service","divider","section","weblink","cast","select"]);const pt=t=>{dt(window,"haptic",t)};var mt="unavailable",yt="unknown",bt=[mt,yt],_t="last-changed",vt="last-updated",gt=["relative","total","date","time","datetime"],$t=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],wt="language",At=function(t){return t<10?"0".concat(t):t};function Ot(t){var e=Math.floor(t/3600),i=Math.floor(t%3600/60),n=Math.floor(t%3600%60);return e>0?"".concat(e,":").concat(At(i),":").concat(At(n)):i>0?"".concat(i,":").concat(At(n)):n>0?""+n:null}function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function Et(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Pt(t,e,i){return(e=function(t){var e=function(t){if("object"!=St(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=St(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==St(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var jt=function(t,e,i){var n=e?function(t){switch(t.number_format){case"comma_decimal":return["en-US","en"];case"decimal_comma":return["de","es","it"];case"space_comma":return["fr","sv","cs"];case"system":return;default:return t.language}}(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},"none"!==(null==e?void 0:e.number_format)&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(n,xt(t,i)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,xt(t,i)).format(Number(t))}return"string"==typeof t?t:"".concat(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}(t,null==i?void 0:i.maximumFractionDigits).toString()).concat("currency"===(null==i?void 0:i.style)?" ".concat(i.currency):"")},xt=function(t,e){var i=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(i),!0).forEach(function(e){Pt(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Et(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||!e.minimumFractionDigits&&!e.maximumFractionDigits){var n=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},kt=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function Ct(t,e){return t===e||!(!kt(t)||!kt(e))}function Dt(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!Ct(t[i],e[i]))return!1;return!0}function Nt(t,e){void 0===e&&(e=Dt);var i=null;function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(i&&i.lastThis===this&&e(n,i.lastArgs))return i.lastResult;var o=t.apply(this,n);return i={lastResult:o,lastArgs:n,lastThis:this},o}return n.clear=function(){i=null},n}var Tt=function(t,e){return Mt(e).format(t)},Mt=Nt(function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"})}),Ut=Nt(function(t){if(t.time_format===wt||"system"===t.time_format){var e=t.time_format===wt?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return"12"===t.time_format}),Ht=function(t,e){return Rt(e).format(t)},Rt=Nt(function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:Ut(t)?"numeric":"2-digit",minute:"2-digit",hour12:Ut(t)})}),It=function(t,e){return Ft(e).format(t)},Ft=Nt(function(t){return new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hour12:Ut(t)})});function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}var Lt=function(t){return"object"===zt(t)&&!Array.isArray(t)&&!!t},Bt=function(t){return!t||bt.includes(t.state)},Wt=function(t,e){if(function(t,e){return e.hide_unavailable&&(Bt(t)||e.attribute&&![_t,vt].includes(e.attribute)&&void 0===t.attributes[e.attribute])}(t,e))return!0;if(void 0===e.hide_if)return!1;var i=e.attribute?t.attributes[e.attribute]:t.state,n=[];if(Lt(e.hide_if)){if(e.hide_if.below&&i<e.hide_if.below)return!0;if(e.hide_if.above&&i>e.hide_if.above)return!0;e.hide_if.value&&(n=n.concat(e.hide_if.value))}else n=n.concat(e.hide_if);return n.some(function(t){return"number"==typeof t?t===+i:t===i})},Vt=["formatEntityName","formatEntityState","formatEntityAttributeValue"];function qt(t){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(t)}function Zt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Jt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(i),!0).forEach(function(e){Kt(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zt(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function Kt(t,e,i){return(e=function(t){var e=function(t){if("object"!=qt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=qt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var Yt,Gt,Qt,Xt,te,ee,ie,ne,re,oe,se,ae,ce,ue,le=function(t){if(Lt(t)&&!(t.entity||t.attribute||t.icon))throw new Error("Entity object requires at least one 'entity', 'attribute' or 'icon'.");if("string"==typeof t&&""===t)throw new Error("Entity ID string must not be blank.");if("string"!=typeof t&&!Lt(t))throw new Error("Entity config must be a valid entity ID string or entity object.")},he=function(t){return"string"==typeof t&&t.includes(".")?t.split(".")[1].length:void 0},fe=function(t,e,i,n){if(""===i)return jt(t/e,n,{maximumFractionDigits:2});var r=parseInt(i,10);return jt(t/e,n,{minimumFractionDigits:r,maximumFractionDigits:r})},de=function(t,e){return!1===e.name?null:e.name||(e.entity?t.attributes.friendly_name||(i=t.entity_id).substr(i.indexOf(".")+1):null)||null;var i},pe=function(t){return Lt(null==t?void 0:t.styles)?Object.keys(t.styles).map(function(e){return"".concat(e,": ").concat(t.styles[e],";")}).join(""):""};function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ye(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function be(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function _e(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?be(Object(i),!0).forEach(function(e){ve(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):be(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function ve(t,e,i){return(e=$e(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ge(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$e(n.key),n)}}function $e(t){var e=function(t){if("object"!=me(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=me(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==me(e)?e:e+""}function we(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(we=function(){return!!t})()}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ae(t)}function Oe(t,e){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oe(t,e)}console.info("%c MULTIPLE-ENTITY-ROW %c ".concat("4.6.1"," (built ").concat("2026-07-02T17:14:32.338Z",", ").concat("554ea88",") "),"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;");var Se=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,i){return e=Ae(e),function(t,e){if(e&&("object"==me(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,we()?Reflect.construct(e,i||[],Ae(t).constructor):e.apply(t,i))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oe(t,e)}(e,t),function(t,e,i){return e&&ge(t.prototype,e),i&&ge(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"setConfig",value:function(t){var e;if(!t||!t.entity)throw new Error("Please define a main entity.");t.entities&&t.entities.forEach(function(t){return le(t)}),t.secondary_info&&le(t.secondary_info),this.entityIds=function(t){var e,i;return[t.entity,null===(e=t.secondary_info)||void 0===e?void 0:e.entity].concat(null===(i=t.entities)||void 0===i?void 0:i.map(function(t){return"string"==typeof t?t:t.entity})).filter(function(t){return t})}(t),this.onRowClick=this.clickHandler(t.entity,t.tap_action),this.config=_e(_e({},t),{},{name:!1===t.name?" ":t.name,format:null!==(e=t.format)&&void 0!==e?e:t.time_format})}},{key:"shouldUpdate",value:function(t){return function(t,e){if(e.has("config"))return!0;var i=e.get("_hass");return!!i&&(!!Vt.some(function(e){return i[e]!==t._hass[e]})||t.entityIds.some(function(e){return i.states[e]!==t._hass.states[e]}))}(this,t)}},{key:"hass",set:function(t){var e,i,n,r=this;(this._hass=t,t&&this.config)&&(this.stateObj=t.states[this.config.entity],Lt(this.config.secondary_info)&&(this.info=null!==(n=t.states[this.config.secondary_info.entity])&&void 0!==n?n:this.stateObj),this.entities=null!==(e=null===(i=this.config.entities)||void 0===i?void 0:i.map(function(e){var i="string"==typeof e?{entity:e}:e;return _e(_e({},i),{},{stateObj:i.entity?t.states[i.entity]:r.stateObj})}))&&void 0!==e?e:[])}},{key:"render",value:function(){var t=this;return this._hass&&this.config?this.stateObj?W(Qt||(Qt=ye(['<hui-generic-entity-row\n .hass="','"\n .config="','"\n .secondaryText="','"\n .catchInteraction=','\n >\n <div class="','">\n ',"","\n </div>\n </hui-generic-entity-row>"])),this._hass,this.config,this.renderSecondaryInfo(),!1,this.config.column?"entities-column":"entities-row",this.entities.map(function(e){return t.renderEntity(e.stateObj,e)}),this.renderMainEntity()):this.renderWarning():W(Gt||(Gt=ye([""])))}},{key:"renderSecondaryInfo",value:function(){if(!this.config.secondary_info||"string"==typeof(t=this.config.secondary_info)&&$t.includes(t)||Wt(this.info,this.config.secondary_info))return null;var t;if("string"==typeof this.config.secondary_info)return W(Xt||(Xt=ye(["",""])),this.config.secondary_info);var e=de(this.info,this.config.secondary_info);return W(te||(te=ye([""," ",""])),e,this.renderValue(this.info,this.config.secondary_info))}},{key:"renderMainEntity",value:function(){return!1===this.config.show_state?null:W(ee||(ee=ye(['<div class="state entity" style="','" @click="','">\n ',"\n <div>","</div>\n </div>"])),pe(this.config),this.onRowClick,this.config.state_header&&W(ie||(ie=ye(["<span>","</span>"])),this.config.state_header),this.renderValue(this.stateObj,this.config))}},{key:"renderEntity",value:function(t,e){if(!t||Wt(t,e))return e.default?W(ne||(ne=ye(['<div class="entity" style="','">\n <span>',"</span>\n <div>","</div>\n </div>"])),pe(e),e.name,e.default):null;var i=this.clickHandler(t.entity_id,e.tap_action);return W(re||(re=ye(['<div class="entity" style="','" @click="','">\n <span>',"</span>\n <div>","</div>\n </div>"])),pe(e),i,de(t,e),e.icon?this.renderIcon(t,e):this.renderValue(t,e))}},{key:"renderValue",value:function(t,e){if(!0===e.toggle)return W(oe||(oe=ye(['<ha-entity-toggle .stateObj="','" .hass="','"></ha-entity-toggle>'])),t,this._hass);var i;if(e.attribute&&[_t,vt].includes(e.attribute))return W(se||(se=ye(["<ha-relative-time\n .hass=","\n .datetime=","\n capitalize\n ></ha-relative-time>"])),this._hass,t[null===(i=e.attribute)||void 0===i?void 0:i.replace("-","_")]);if(e.format&&gt.includes(e.format)){var n,r=e.attribute?null!==(n=t.attributes[e.attribute])&&void 0!==n?n:t[e.attribute]:t.state,o=new Date(r);return o instanceof Date&&!isNaN(o.getTime())?W(ae||(ae=ye(["<hui-timestamp-display\n .hass=","\n .ts=","\n .format=","\n capitalize\n ></hui-timestamp-display>"])),this._hass,o,e.format):r}return function(t,e,i){var n="function"==typeof t.formatEntityState,r="function"==typeof t.formatEntityAttributeValue;if(Bt(e))return n?t.formatEntityState(e):t.localize("state.default.".concat(e.state));var o=i.attribute?e.attributes[i.attribute]:e.state,s=!1===i.unit?void 0:void 0!==i.attribute?i.unit:i.unit||e.attributes.unit_of_measurement;if(i.format){if(null==o&&(o=0),isNaN(parseFloat(o))||!isFinite(o));else if("brightness"===i.format)o=Math.round(o/255*100),s="%";else if("duration"===i.format){var a;o=null!==(a=Ot(o))&&void 0!==a?a:"0",s=void 0}else if("duration-m"===i.format){var c;o=null!==(c=Ot(o/1e3))&&void 0!==c?c:"0",s=void 0}else if("duration-h"===i.format){var u;o=null!==(u=Ot(3600*o))&&void 0!==u?u:"0",s=void 0}else if(i.format.startsWith("precision")){var l=parseInt(i.format.slice(-1),10);o=jt(parseFloat(o),t.locale,{minimumFractionDigits:l,maximumFractionDigits:l})}else if(i.format.startsWith("kilo"))o=fe(o,1e3,i.format.slice(4),t.locale);else if(i.format.startsWith("mega"))o=fe(o,1e6,i.format.slice(4),t.locale);else if(i.format.startsWith("milli"))o=fe(o,.001,i.format.slice(5),t.locale);else if("invert"===i.format){var h=he(o);o=jt(o-2*o,t.locale,void 0!==h?{minimumFractionDigits:h,maximumFractionDigits:h}:void 0)}else if("position"===i.format){var f=he(o);o=jt(100-o,t.locale,void 0!==f?{minimumFractionDigits:f,maximumFractionDigits:f}:void 0)}else"celsius_to_fahrenheit"===i.format?o=jt(1.8*o+32,t.locale,{maximumFractionDigits:0}):"fahrenheit_to_celsius"===i.format&&(o=jt(5*(o-32)/9,t.locale,{maximumFractionDigits:1}));return"".concat(o).concat(s?" ".concat(s):"")}var d=Jt(Jt({},e),{},{attributes:Jt(Jt({},e.attributes),{},{unit_of_measurement:s})});if(i.attribute){if(r)return t.formatEntityAttributeValue(d,i.attribute);var p=null==o?"":isNaN(o)?o:jt(o,t.locale);return"".concat(p).concat(s?" ".concat(s):"")}return n?t.formatEntityState(d):function(t,e,i,n){var r=e.state;if(r===yt||r===mt)return t("state.default.".concat(r));if(function(t){return!!t.attributes.unit_of_measurement||!!t.attributes.state_class}(e)){if("monetary"===e.attributes.device_class&&/^[A-Za-z]{3}$/.test(e.attributes.unit_of_measurement))try{return jt(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return"".concat(jt(r,i)).concat(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o,s=function(t){return t.entity_id.substr(0,t.entity_id.indexOf("."))}(e);if("input_datetime"===s)return e.attributes.has_date&&e.attributes.has_time?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),Ht(o,i)):e.attributes.has_date?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),Tt(o,i)):e.attributes.has_time?((o=new Date).setHours(e.attributes.hour,e.attributes.minute),It(o,i)):e.state;if("humidifier"===s&&"on"===r&&e.attributes.humidity)return"".concat(e.attributes.humidity," %");if("counter"===s||"number"===s||"input_number"===s)return jt(r,i);if("button"===s||"sensor"===s&&"timestamp"===e.attributes.device_class)return Ht(new Date(r),i);var a=n&&n[e.entity_id];return(null==a?void 0:a.translation_key)&&t("component.".concat(a.platform,".entity.").concat(s,".").concat(a.translation_key,".state.").concat(r))||e.attributes.device_class&&t("component.".concat(s,".entity_component.").concat(e.attributes.device_class,".state.").concat(r))||t("component.".concat(s,".entity_component._.state.").concat(r))||r}(t.localize,d,t.locale,t.entities)}(this._hass,t,e)}},{key:"renderIcon",value:function(t,e){return W(ce||(ce=ye(['<state-badge\n class="icon-small"\n .hass=','\n .stateObj="','"\n .overrideIcon="','"\n .stateColor="','"\n ></state-badge>'])),this._hass,t,!0===e.icon?t.attributes.icon||null:e.icon,e.state_color)}},{key:"renderWarning",value:function(){return W(ue||(ue=ye(["<hui-warning>\n ","\n </hui-warning>"])),this._hass.localize("ui.panel.lovelace.warning.entity_not_found","entity",this.config.entity))}},{key:"clickHandler",value:function(t,e){var i=this;return function(){return((t,e,i)=>{let n;if(i.tap_action&&(n=i.tap_action),n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some(t=>t.user===e.user.id)||confirm(n.confirmation.text||`Are you sure you want to ${n.action}?`))switch(n.action){case"more-info":(n.entity||i.entity||i.camera_image)&&(dt(t,"hass-more-info",{entityId:n.entity?n.entity:i.entity?i.entity:i.camera_image}),n.haptic&&pt(n.haptic));break;case"navigate":n.navigation_path&&(((t,e,i=!1)=>{i?history.replaceState(null,"",e):history.pushState(null,"",e),dt(window,"location-changed",{replace:i})})(0,n.navigation_path),n.haptic&&pt(n.haptic));break;case"url":n.url_path&&window.open(n.url_path),n.haptic&&pt(n.haptic);break;case"toggle":i.entity&&(((t,e)=>{((t,e,i=!0)=>{const n=function(t){return t.substr(0,t.indexOf("."))}(e),r="group"===n?"homeassistant":n;let o;switch(n){case"lock":o=i?"unlock":"lock";break;case"cover":o=i?"open_cover":"close_cover";break;default:o=i?"turn_on":"turn_off"}t.callService(r,o,{entity_id:e})})(t,e,ft.includes(t.states[e].state))})(e,i.entity),n.haptic&&pt(n.haptic));break;case"call-service":{if(!n.service)return;const[t,r]=n.service.split(".",2),o=Object.assign({},n.service_data);"entity"===o.entity_id&&(o.entity_id=i.entity),e.callService(t,r,o,n.target),n.haptic&&pt(n.haptic);break}case"fire-dom-event":dt(t,"ll-custom",n),n.haptic&&pt(n.haptic)}})(i,i._hass,{entity:t,tap_action:e})}}}],[{key:"properties",get:function(){return{_hass:Object,config:Object,stateObj:Object}}},{key:"styles",get:function(){return o(Yt||(Yt=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n .icon-small {\n width: auto;\n }\n .entity {\n text-align: center;\n cursor: pointer;\n }\n .entity span {\n font-size: 10px;\n color: var(--secondary-text-color);\n }\n .entities-row {\n flex-direction: row;\n display: inline-flex;\n justify-content: space-between;\n align-items: center;\n }\n .entities-row .entity {\n margin-right: 16px;\n }\n .entities-row .entity:last-of-type {\n margin-right: 0;\n }\n .entities-column {\n flex-direction: column;\n display: flex;\n align-items: flex-end;\n justify-content: space-evenly;\n }\n .entities-column .entity div {\n display: inline-block;\n vertical-align: middle;\n }\n"])))}}])}(ct);customElements.define("multiple-entity-row",Se)})();