UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

276 lines (252 loc) 32.7 kB
/*! For license information please see chunk.b24c217b2720dd2bd113.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9385],{54444:(t,e,i)=>{"use strict";i(43437);var n=i(9672),r=i(87156),o=i(50856);(0,n.k)({_template:o.d` <style> :host { display: block; position: absolute; outline: none; z-index: 1002; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; user-select: none; cursor: default; } #tooltip { display: block; outline: none; @apply --paper-font-common-base; font-size: 10px; line-height: 1; background-color: var(--paper-tooltip-background, #616161); color: var(--paper-tooltip-text-color, white); padding: 8px; border-radius: 2px; @apply --paper-tooltip; } @keyframes keyFrameScaleUp { 0% { transform: scale(0.0); } 100% { transform: scale(1.0); } } @keyframes keyFrameScaleDown { 0% { transform: scale(1.0); } 100% { transform: scale(0.0); } } @keyframes keyFrameFadeInOpacity { 0% { opacity: 0; } 100% { opacity: var(--paper-tooltip-opacity, 0.9); } } @keyframes keyFrameFadeOutOpacity { 0% { opacity: var(--paper-tooltip-opacity, 0.9); } 100% { opacity: 0; } } @keyframes keyFrameSlideDownIn { 0% { transform: translateY(-2000px); opacity: 0; } 10% { opacity: 0.2; } 100% { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); } } @keyframes keyFrameSlideDownOut { 0% { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); } 10% { opacity: 0.2; } 100% { transform: translateY(-2000px); opacity: 0; } } .fade-in-animation { opacity: 0; animation-delay: var(--paper-tooltip-delay-in, 500ms); animation-name: keyFrameFadeInOpacity; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-in, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .fade-out-animation { opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 0ms); animation-name: keyFrameFadeOutOpacity; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .scale-up-animation { transform: scale(0); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-in, 500ms); animation-name: keyFrameScaleUp; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-in, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .scale-down-animation { transform: scale(1); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameScaleDown; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .slide-down-animation { transform: translateY(-2000px); opacity: 0; animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameSlideDownIn; animation-iteration-count: 1; animation-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1); animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .slide-down-animation-out { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameSlideDownOut; animation-iteration-count: 1; animation-timing-function: cubic-bezier(0.4, 0.0, 1, 1); animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .cancel-animation { animation-delay: -30s !important; } /* Thanks IE 10. */ .hidden { display: none !important; } </style> <div id="tooltip" class="hidden"> <slot></slot> </div> `,is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object,value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var t=(0,r.vz)(this).parentNode,e=(0,r.vz)(this).getOwnerRoot();return this.for?(0,r.vz)(e).querySelector("#"+this.for):t.nodeType==Node.DOCUMENT_FRAGMENT_NODE?e.host:t},attached:function(){this._findTarget()},detached:function(){this.manualMode||this._removeListeners()},playAnimation:function(t){"entry"===t?this.show():"exit"===t&&this.hide()},cancelAnimation:function(){this.$.tooltip.classList.add("cancel-animation")},show:function(){if(!this._showing){if(""===(0,r.vz)(this).textContent.trim()){for(var t=!0,e=(0,r.vz)(this).getEffectiveChildNodes(),i=0;i<e.length;i++)if(""!==e[i].textContent.trim()){t=!1;break}if(t)return}this._showing=!0,this.$.tooltip.classList.remove("hidden"),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.updatePosition(),this._animationPlaying=!0,this.$.tooltip.classList.add(this._getAnimationType("entry"))}},hide:function(){if(this._showing){if(this._animationPlaying)return this._showing=!1,void this._cancelAnimation();this._onAnimationFinish(),this._showing=!1,this._animationPlaying=!0}},updatePosition:function(){if(this._target&&this.offsetParent){var t=this.offset;14!=this.marginTop&&14==this.offset&&(t=this.marginTop);var e,i,n=this.offsetParent.getBoundingClientRect(),r=this._target.getBoundingClientRect(),o=this.getBoundingClientRect(),a=(r.width-o.width)/2,s=(r.height-o.height)/2,l=r.left-n.left,c=r.top-n.top;switch(this.position){case"top":e=l+a,i=c-o.height-t;break;case"bottom":e=l+a,i=c+r.height+t;break;case"left":e=l-o.width-t,i=c+s;break;case"right":e=l+r.width+t,i=c+s}this.fitToVisibleBounds?(n.left+e+o.width>window.innerWidth?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,e)+"px",this.style.right="auto"),n.top+i+o.height>window.innerHeight?(this.style.bottom=n.height-c+t+"px",this.style.top="auto"):(this.style.top=Math.max(-n.top,i)+"px",this.style.bottom="auto")):(this.style.left=e+"px",this.style.top=i+"px")}},_addListeners:function(){this._target&&(this.listen(this._target,"mouseenter","show"),this.listen(this._target,"focus","show"),this.listen(this._target,"mouseleave","hide"),this.listen(this._target,"blur","hide"),this.listen(this._target,"tap","hide")),this.listen(this.$.tooltip,"animationend","_onAnimationEnd"),this.listen(this,"mouseenter","hide")},_findTarget:function(){this.manualMode||this._removeListeners(),this._target=this.target,this.manualMode||this._addListeners()},_delayChange:function(t){500!==t&&this.updateStyles({"--paper-tooltip-delay-in":t+"ms"})},_manualModeChanged:function(){this.manualMode?this._removeListeners():this._addListeners()},_cancelAnimation:function(){this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add("hidden")},_onAnimationFinish:function(){this._showing&&(this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add(this._getAnimationType("exit")))},_onAnimationEnd:function(){this._animationPlaying=!1,this._showing||(this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.add("hidden"))},_getAnimationType:function(t){if("entry"===t&&""!==this.animationEntry)return this.animationEntry;if("exit"===t&&""!==this.animationExit)return this.animationExit;if(this.animationConfig[t]&&"string"==typeof this.animationConfig[t][0].name){if(this.animationConfig[t][0].timing&&this.animationConfig[t][0].timing.delay&&0!==this.animationConfig[t][0].timing.delay){var e=this.animationConfig[t][0].timing.delay;"entry"===t?this.updateStyles({"--paper-tooltip-delay-in":e+"ms"}):"exit"===t&&this.updateStyles({"--paper-tooltip-delay-out":e+"ms"})}return this.animationConfig[t][0].name}},_removeListeners:function(){this._target&&(this.unlisten(this._target,"mouseenter","show"),this.unlisten(this._target,"focus","show"),this.unlisten(this._target,"mouseleave","hide"),this.unlisten(this._target,"blur","hide"),this.unlisten(this._target,"tap","hide")),this.unlisten(this.$.tooltip,"animationend","_onAnimationEnd"),this.unlisten(this,"mouseenter","hide")}})},5435:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});const n=[60,60,24,7],r=["second","minute","hour","day"];function o(t,e,i={}){let o=((i.compareTime||new Date).getTime()-t.getTime())/1e3;const a=o>=0?"past":"future";o=Math.abs(o);let s=Math.round(o);if(0===s)return e("ui.components.relative_time.just_now");let l="week";for(let c=0;c<n.length;c++){if(s<n[c]){l=r[c];break}o/=n[c],s=Math.round(o)}return e(!1===i.includeTense?"ui.components.relative_time.duration."+l:`ui.components.relative_time.${a}_duration.${l}`,"count",s)}},22311:(t,e,i)=>{"use strict";i.d(e,{N:()=>r});var n=i(58831);const r=t=>(0,n.M)(t.entity_id)},45485:(t,e,i)=>{"use strict";i.d(e,{E:()=>r,h:()=>o});var n=i(58831);const r=t=>t.include_domains.length+t.include_entities.length+t.exclude_domains.length+t.exclude_entities.length===0,o=(t,e,i,r)=>{const o=new Set(t),a=new Set(e),s=new Set(i),l=new Set(r),c=o.size>0||a.size>0,d=s.size>0||l.size>0;return c||d?c&&!d?t=>a.has(t)||o.has((0,n.M)(t)):!c&&d?t=>!l.has(t)&&!s.has((0,n.M)(t)):o.size?t=>o.has((0,n.M)(t))?!l.has(t):a.has(t):s.size?t=>s.has((0,n.M)(t))?a.has(t):!l.has(t):t=>a.has(t):()=>!0}},85415:(t,e,i)=>{"use strict";i.d(e,{q:()=>n,w:()=>r});const n=(t,e)=>t<e?-1:t>e?1:0,r=(t,e)=>n(t.toLowerCase(),e.toLowerCase())},76111:(t,e,i)=>{"use strict";var n=i(50856),r=(i(54444),i(1265)),o=i(28426),a=i(91741),s=i(87744);i(32075),i(3143);class l extends((0,r.Z)(o.H3)){static get template(){return n.d` ${this.styleTemplate} ${this.stateBadgeTemplate} ${this.infoTemplate} `}static get styleTemplate(){return n.d` <style> :host { @apply --paper-font-body1; min-width: 120px; white-space: nowrap; } state-badge { float: left; } :host([rtl]) state-badge { float: right; } .info { margin-left: 56px; } :host([rtl]) .info { margin-right: 56px; margin-left: 0; text-align: right; } .name { @apply --paper-font-common-nowrap; color: var(--primary-text-color); line-height: 40px; } .name[in-dialog], :host([secondary-line]) .name { line-height: 20px; } .time-ago, .extra-info, .extra-info > * { @apply --paper-font-common-nowrap; color: var(--secondary-text-color); } </style> `}static get stateBadgeTemplate(){return n.d` <state-badge state-obj="[[stateObj]]"></state-badge> `}static get infoTemplate(){return n.d` <div class="info"> <div class="name" in-dialog$="[[inDialog]]"> [[computeStateName(stateObj)]] </div> <template is="dom-if" if="[[inDialog]]"> <div class="time-ago"> <ha-relative-time id="last_changed" hass="[[hass]]" datetime="[[stateObj.last_changed]]" ></ha-relative-time> <paper-tooltip animation-delay="0" for="last_changed"> [[localize('ui.dialogs.more_info_control.last_updated')]]: <ha-relative-time hass="[[hass]]" datetime="[[stateObj.last_updated]]" ></ha-relative-time> </paper-tooltip> </div> </template> <template is="dom-if" if="[[!inDialog]]"> <div class="extra-info"><slot> </slot></div> </template> </div> `}static get properties(){return{hass:Object,stateObj:Object,inDialog:{type:Boolean,value:()=>!1},rtl:{type:Boolean,reflectToAttribute:!0,computed:"computeRTL(hass)"}}}computeStateName(t){return(0,a.C)(t)}computeRTL(t){return(0,s.HE)(t)}}customElements.define("state-info",l)},81545:(t,e,i)=>{"use strict";i(53918),i(83238);var n=i(15652);i(10983);function r(){r=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(i){e.forEach((function(e){e.kind===i&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var i=t.prototype;["method","field"].forEach((function(n){e.forEach((function(e){var r=e.placement;if(e.kind===n&&("static"===r||"prototype"===r)){var o="static"===r?t:i;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var i=e.descriptor;if("field"===e.kind){var n=e.initializer;i={enumerable:i.enumerable,writable:i.writable,configurable:i.configurable,value:void 0===n?void 0:n.call(t)}}Object.defineProperty(t,e.key,i)},decorateClass:function(t,e){var i=[],n=[],r={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,r)}),this),t.forEach((function(t){if(!s(t))return i.push(t);var e=this.decorateElement(t,r);i.push(e.element),i.push.apply(i,e.extras),n.push.apply(n,e.finishers)}),this),!e)return{elements:i,finishers:n};var o=this.decorateConstructor(i,e);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(t,e,i){var n=e[t.placement];if(!i&&-1!==n.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");n.push(t.key)},decorateElement:function(t,e){for(var i=[],n=[],r=t.decorators,o=r.length-1;o>=0;o--){var a=e[t.placement];a.splice(a.indexOf(t.key),1);var s=this.fromElementDescriptor(t),l=this.toElementFinisherExtras((0,r[o])(s)||s);t=l.element,this.addElementPlacement(t,e),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],e);i.push.apply(i,c)}}return{element:t,finishers:n,extras:i}},decorateConstructor:function(t,e){for(var i=[],n=e.length-1;n>=0;n--){var r=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[n])(r)||r);if(void 0!==o.finisher&&i.push(o.finisher),void 0!==o.elements){t=o.elements;for(var a=0;a<t.length-1;a++)for(var s=a+1;s<t.length;s++)if(t[a].key===t[s].key&&t[a].placement===t[s].placement)throw new TypeError("Duplicated element ("+t[a].key+")")}}return{elements:t,finishers:i}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){var e;if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e}),this)},toElementDescriptor:function(t){var e=String(t.kind);if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var i=d(t.key),n=String(t.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var r=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:i,placement:n,descriptor:Object.assign({},r)};return"field"!==e?this.disallowProperty(t,"initializer","A method descriptor"):(this.disallowProperty(r,"get","The property descriptor of a field descriptor"),this.disallowProperty(r,"set","The property descriptor of a field descriptor"),this.disallowProperty(r,"value","The property descriptor of a field descriptor"),o.initializer=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:c(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=String(t.kind);if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var i=c(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:i}},runClassFinishers:function(t,e){for(var i=0;i<e.length;i++){var n=(0,e[i])(t);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");t=n}}return t},disallowProperty:function(t,e,i){if(void 0!==t[e])throw new TypeError(i+" can't have a ."+e+" property.")}};return t}function o(t){var e,i=d(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===t.kind?"field":"method",key:i,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(n.decorators=t.decorators),"field"===t.kind&&(n.initializer=t.value),n}function a(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function s(t){return t.decorators&&t.decorators.length}function l(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function c(t,e){var i=t[e];if(void 0!==i&&"function"!=typeof i)throw new TypeError("Expected '"+e+"' to be a function");return i}function d(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}!function(t,e,i,n){var c=r();if(n)for(var d=0;d<n.length;d++)c=n[d](c);var p=e((function(t){c.initializeInstanceElements(t,m.elements)}),i),m=c.decorateClass(function(t){for(var e=[],i=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},n=0;n<t.length;n++){var r,o=t[n];if("method"===o.kind&&(r=e.find(i)))if(l(o.descriptor)||l(r.descriptor)){if(s(o)||s(r))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");r.descriptor=o.descriptor}else{if(s(o)){if(s(r))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");r.decorators=o.decorators}a(o,r)}else e.push(o)}return e}(p.d.map(o)),t);c.initializeClassElements(p.F,m.elements),c.runClassFinishers(p.F,m.finishers)}([(0,n.Mo)("ha-button-menu")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"corner",value:()=>"TOP_START"},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.items}},{kind:"get",key:"selected",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.selected}},{kind:"method",key:"render",value:function(){return n.dy` <div @click=${this._handleClick}> <slot name="trigger"></slot> </div> <mwc-menu .corner=${this.corner} .multi=${this.multi} .activatable=${this.activatable} > <slot></slot> </mwc-menu> `}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv` :host { display: inline-block; position: relative; } ::slotted([disabled]) { color: var(--disabled-text-color); } `}}]}}),n.oi)},83927:(t,e,i)=>{"use strict";i(83641);var n=i(8470),r=i(15652);function o(){o=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(i){e.forEach((function(e){e.kind===i&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var i=t.prototype;["method","field"].forEach((function(n){e.forEach((function(e){var r=e.placement;if(e.kind===n&&("static"===r||"prototype"===r)){var o="static"===r?t:i;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var i=e.descriptor;if("field"===e.kind){var n=e.initializer;i={enumerable:i.enumerable,writable:i.writable,configurable:i.configurable,value:void 0===n?void 0:n.call(t)}}Object.defineProperty(t,e.key,i)},decorateClass:function(t,e){var i=[],n=[],r={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,r)}),this),t.forEach((function(t){if(!l(t))return i.push(t);var e=this.decorateElement(t,r);i.push(e.element),i.push.apply(i,e.extras),n.push.apply(n,e.finishers)}),this),!e)return{elements:i,finishers:n};var o=this.decorateConstructor(i,e);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(t,e,i){var n=e[t.placement];if(!i&&-1!==n.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");n.push(t.key)},decorateElement:function(t,e){for(var i=[],n=[],r=t.decorators,o=r.length-1;o>=0;o--){var a=e[t.placement];a.splice(a.indexOf(t.key),1);var s=this.fromElementDescriptor(t),l=this.toElementFinisherExtras((0,r[o])(s)||s);t=l.element,this.addElementPlacement(t,e),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],e);i.push.apply(i,c)}}return{element:t,finishers:n,extras:i}},decorateConstructor:function(t,e){for(var i=[],n=e.length-1;n>=0;n--){var r=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[n])(r)||r);if(void 0!==o.finisher&&i.push(o.finisher),void 0!==o.elements){t=o.elements;for(var a=0;a<t.length-1;a++)for(var s=a+1;s<t.length;s++)if(t[a].key===t[s].key&&t[a].placement===t[s].placement)throw new TypeError("Duplicated element ("+t[a].key+")")}}return{elements:t,finishers:i}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){var e;if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?m(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e}),this)},toElementDescriptor:function(t){var e=String(t.kind);if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var i=p(t.key),n=String(t.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var r=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:i,placement:n,descriptor:Object.assign({},r)};return"field"!==e?this.disallowProperty(t,"initializer","A method descriptor"):(this.disallowProperty(r,"get","The property descriptor of a field descriptor"),this.disallowProperty(r,"set","The property descriptor of a field descriptor"),this.disallowProperty(r,"value","The property descriptor of a field descriptor"),o.initializer=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:d(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=String(t.kind);if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var i=d(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:i}},runClassFinishers:function(t,e){for(var i=0;i<e.length;i++){var n=(0,e[i])(t);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");t=n}}return t},disallowProperty:function(t,e,i){if(void 0!==t[e])throw new TypeError(i+" can't have a ."+e+" property.")}};return t}function a(t){var e,i=p(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===t.kind?"field":"method",key:i,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(n.decorators=t.decorators),"field"===t.kind&&(n.initializer=t.value),n}function s(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function l(t){return t.decorators&&t.decorators.length}function c(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function d(t,e){var i=t[e];if(void 0!==i&&"function"!=typeof i)throw new TypeError("Expected '"+e+"' to be a function");return i}function p(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}const h=customElements.get("mwc-formfield");!function(t,e,i,n){var r=o();if(n)for(var d=0;d<n.length;d++)r=n[d](r);var p=e((function(t){r.initializeInstanceElements(t,m.elements)}),i),m=r.decorateClass(function(t){for(var e=[],i=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},n=0;n<t.length;n++){var r,o=t[n];if("method"===o.kind&&(r=e.find(i)))if(c(o.descriptor)||c(r.descriptor)){if(l(o)||l(r))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");r.descriptor=o.descriptor}else{if(l(o)){if(l(r))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");r.decorators=o.decorators}s(o,r)}else e.push(o)}return e}(p.d.map(a)),t);r.initializeClassElements(p.F,m.elements),r.runClassFinishers(p.F,m.finishers)}([(0,r.Mo)("ha-formfield")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"get",static:!0,key:"styles",value:function(){return[n.o,r.iv` :host(:not([alignEnd])) ::slotted(ha-switch) { margin-right: 10px; } :host([dir="rtl"]:not([alignEnd])) ::slotted(ha-switch) { margin-left: 10px; margin-right: auto; } `]}}]}}),h)},32075:(t,e,i)=>{"use strict";var n=i(87156),r=i(28426),o=i(5435),a=i(1265);class s extends((0,a.Z)(r.H3)){static get properties(){return{hass:Object,datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:Object}}constructor(){super(),this.updateRelative=this.updateRelative.bind(this)}connectedCallback(){super.connectedCallback(),this.updateInterval=setInterval(this.updateRelative,6e4)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this.updateInterval)}datetimeChanged(t){this.parsedDateTime=t?new Date(t):null,this.updateRelative()}datetimeObjChanged(t){this.parsedDateTime=t,this.updateRelative()}updateRelative(){const t=(0,n.vz)(this);this.parsedDateTime?t.innerHTML=(0,o.Z)(this.parsedDateTime,this.localize):t.innerHTML=this.localize("ui.components.relative_time.never")}}customElements.define("ha-relative-time",s)},90363:(t,e,i)=>{"use strict";i.d(e,{_:()=>o});var n=i(47181);const r=()=>Promise.all([i.e(6372),i.e(2838)]).then(i.bind(i,98931)),o=(t,e)=>{(0,n.B)(t,"show-dialog",{dialogTag:"dialog-domain-toggler",dialogImport:r,dialogParams:e})}}}]); //# sourceMappingURL=chunk.b24c217b2720dd2bd113.js.map