UNPKG

iobroker.lovelace

Version:

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

10 lines 221 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[15862],{36091:function(t,e,i){i.d(e,{a:function(){return o}});i(72712),i(18111),i(61701),i(18237),i(62953);function o(t){return t.reduce((t,e)=>t.concat(t.map(t=>[...t,e])),[[]])}},87047:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{x:function(){return a}});i(44114),i(62953);var s=i(43574),n=t([s]);s=(n.then?(await n)():n)[0];class a{hostDisconnected(){this.clear()}setup(t,e,i,o){this.clear(),t.length&&(0,s.Ep)(t,e,t=>this._unsubs.push(t),()=>i(),o)}clear(){for(const t of this._unsubs)t();this._unsubs=[]}constructor(t){this._unsubs=[],t.addController(this)}}o()}catch(a){o(a)}})},22542:function(t,e,i){i.d(e,{F:function(){return a},j:function(){return n}});i(18111),i(81148),i(61701),i(13579),i(62953);var o=i(22675),s=i(69093);const n=t=>{if(!t.length)return o.Hh;if(t.every(t=>t.state===o.Hh))return o.Hh;if(!t.some(t=>t.state!==o.Hh&&t.state!==o.HV))return o.HV;if("cover"===(0,s.t)(t[0])){for(const e of["opening","closing","open"])if(t.some(t=>t.state===e))return e;return"closed"}return t.some(t=>"on"===t.state)?"on":"off"},a=(t,e)=>{if(!e.length)return;const i=(0,s.t)(e[0]),o=n(e),a="on"===o||"open"===o;let r=a?"turn_off":"turn_on";"cover"===i&&(r="opening"===o||"closing"===o?"stop_cover":a?"close_cover":"open_cover");const c=e.map(t=>t.entity_id);t.callService(i,r,{entity_id:c})}},19771:function(t,e,i){i.d(e,{D:function(){return r}});i(62953);var o=i(42017),s=i(63937),n=i(5055);class a extends o.WL{render(t,e){return this._key=t,e}update(t,e){const i=e[0],o=e[1];return i!==this._key&&((0,s.mY)(t),this._key=i),o}constructor(...t){super(...t),this._key=n.s6}}const r=(0,o.u$)(a)},3109:function(t,e,i){var o=i(40445),s=i(86137),n=i(67576);class a extends s.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeIn"}}(0,o.Cg)([(0,n.MZ)({type:Boolean})],a.prototype,"play",void 0),a=(0,o.Cg)([(0,n.EM)("ha-fade-in")],a)},14328:function(t,e,i){var o=i(40445),s=i(86137),n=i(67576);class a extends s.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeOut"}}(0,o.Cg)([(0,n.MZ)({type:Boolean})],a.prototype,"play",void 0),a=(0,o.Cg)([(0,n.EM)("ha-fade-out")],a)},7822:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var o=i(40445),s=(i(86137),i(5124)),n=i(67576),a=i(19771),r=(i(3109),i(14328),i(26300)),c=t([r]);r=(c.then?(await c)():c)[0];let l,h,d,u,_,p,v=t=>t;const g="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z";class f extends s.WF{willUpdate(t){t.has("show")&&(this._highlight=0,!this.show&&this.hasUpdated&&(this._hide=!0))}render(){if(!this.show&&!this._hide)return s.s6;let t=(0,s.qy)(l||(l=v`<div><slot></slot></div>`));return this.interactive&&(t=(0,s.qy)(h||(h=v`<button> <slot></slot> <ha-svg-icon .path="${0}"></ha-svg-icon> </button>`),g)),this.show&&this._highlight?(0,a.D)(this._highlight,(0,s.qy)(d||(d=v` <wa-animation fill="both" .iterations="${0}" name="headShake" play>${0}</wa-animation> `),1,t)):!this.show&&this._hide?(0,s.qy)(u||(u=v` <ha-fade-out @wa-finish="${0}">${0}</ha-fade-out> `),this._handleHideFinish,t):(0,s.qy)(_||(_=v`<ha-fade-in .duration="${0}">${0}</ha-fade-in>`),250,t)}highlight(){this._highlight+=1}_handleHideFinish(){this._hide=!1}constructor(...t){super(...t),this.variant="info",this.interactive=!1,this.show=!1,this._hide=!1,this._highlight=0}}f.styles=(0,s.AH)(p||(p=v`:host{--background-color:var(--ha-color-fill-primary-normal-resting);--background-color-hover:var(--ha-color-fill-primary-normal-hover);--text-color:var(--ha-color-on-primary-normal);border-radius:var(--ha-border-radius-pill)}:host([variant=warning]){--background-color:var(--ha-color-fill-warning-normal-resting);--background-color-hover:var(--ha-color-fill-warning-normal-hover);--text-color:var(--ha-color-on-warning-normal)}:host([variant=neutral]){--background-color:var(--ha-color-fill-neutral-normal-resting);--background-color-hover:var(--ha-color-fill-neutral-normal-hover);--text-color:var(--ha-color-on-neutral-normal)}:host([variant=success]){--background-color:var(--ha-color-fill-success-normal-resting);--background-color-hover:var(--ha-color-fill-success-normal-hover);--text-color:var(--ha-color-on-success-normal)}:host([variant=danger]){--background-color:var(--ha-color-fill-danger-normal-resting);--background-color-hover:var(--ha-color-fill-danger-normal-hover);--text-color:var(--ha-color-on-danger-normal)}button,div{background:var(--background-color);border-radius:var(--ha-border-radius-pill);color:var(--text-color);display:inline-flex;gap:var(--ha-space-2);padding:var(--ha-space-1) var(--ha-space-2);align-items:center;--mdc-icon-size:16px;line-height:1;box-shadow:var(--ha-box-shadow-s)}button{border:none;cursor:pointer}button:hover{background:var(--background-color-hover)}button:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}`)),(0,o.Cg)([(0,n.MZ)({reflect:!0})],f.prototype,"variant",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"interactive",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"show",void 0),(0,o.Cg)([(0,n.wk)()],f.prototype,"_hide",void 0),(0,o.Cg)([(0,n.wk)()],f.prototype,"_highlight",void 0),f=(0,o.Cg)([(0,n.EM)("ha-automation-row-event-chip")],f),e()}catch(l){e(l)}})},78486:function(t,e,i){i(62953);var o=i(40445),s=i(5124),n=i(67576);let a,r,c=t=>t;class l extends s.WF{render(){return(0,s.qy)(a||(a=c` <div id="indicator" role="status" tabindex="0" aria-label="${0}"></div> `),this.label)}constructor(...t){super(...t),this.state="unknown",this.label=""}}l.styles=(0,s.AH)(r||(r=c`:host{position:absolute;top:-5px;inset-inline-end:-6px;display:inline-block}#indicator{width:10px;height:10px;border-radius:var(--ha-border-radius-circle);border:var(--ha-border-width-md) solid;box-sizing:border-box;background-color:var(--card-background-color);box-shadow:0 0 0 2px var(--card-background-color);transition:all var(--ha-animation-duration-normal) ease-in-out}:host([state=pass]) #indicator{background-color:var(--ha-color-green-60);border-color:var(--ha-color-green-60)}:host([state=fail]) #indicator{border-color:var(--ha-color-orange-60)}:host([state=invalid]) #indicator{border-color:var(--ha-color-red-60)}:host([state=unknown]) #indicator{border-color:var(--ha-color-neutral-60)}`)),(0,o.Cg)([(0,n.MZ)({reflect:!0})],l.prototype,"state",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"label",void 0),l=(0,o.Cg)([(0,n.EM)("ha-automation-row-live-test")],l)},34218:function(t,e,i){i.d(e,{P:function(){return o}});i(44114),i(72712),i(18111),i(18237),i(45367),i(92731),i(62953);function o(t,e,i,o,n=!1){if(!t)return[];if(t.length<=e)return t;const a=null!=i?i:s(t[0])[0],r=null!=o?o:s(t[t.length-1])[0],c=Math.ceil((r-a)/Math.floor(e)),l=new Map;for(const d of t){const t=s(d);if(!Array.isArray(t))continue;const e=Number(t[0]),i=Number(t[1]);if(isNaN(e)||isNaN(i))continue;const o=Math.floor((e-a)/c),n=l.get(o);n?n.push({point:d,x:e,y:i}):l.set(o,[{point:d,x:e,y:i}])}const h=[];if(n)for(const[d,u]of l){const t=u.reduce((t,e)=>t+e.y,0)/u.length,e=u.reduce((t,e)=>t+e.x,0)/u.length,i=s(u[0].point),o=Array.isArray(i)?[e,t]:{value:[e,t]};h.push(o)}else for(const[s,d]of l){let t=d[0],e=d[0];for(const i of d)i.y<t.y&&(t=i),i.y>e.y&&(e=i);t.x>e.x&&h.push(e.point),h.push(t.point),t.x<e.x&&h.push(e.point)}return h}function s(t){return t&&"object"==typeof t&&"value"in t?t.value:t}},36248:function(t,e,i){i.a(t,async function(t,e){try{var o=i(40445),s=i(5124),n=i(67576),a=i(91450),r=i(85694),c=(i(47680),i(67094),t([r]));r=(c.then?(await c)():c)[0];let l,h,d,u=t=>t;class _ extends s.WF{render(){if(this.icon)return(0,s.qy)(l||(l=u`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.stateObj||!this.attribute)return s.s6;if(!this.hass)return s.s6;const t=(0,r.Gp)(this.hass,this.stateObj,this.attribute,this.attributeValue).then(t=>t?(0,s.qy)(h||(h=u`<ha-icon .icon="${0}"></ha-icon>`),t):s.s6);return(0,s.qy)(d||(d=u`${0}`),(0,a.T)(t))}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"stateObj",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"attribute",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"attributeValue",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"icon",void 0),_=(0,o.Cg)([(0,n.EM)("ha-attribute-icon")],_),e()}catch(l){e(l)}})},56048:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(20116),i(61701),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(6412),r=i(22786),c=i(29823),l=(i(70947),i(47680),i(67094),t([c]));c=(l.then?(await l)():l)[0];let h,d,u,_,p,v,g,f,b,y,m,C,w,x,$=t=>t;const M="M7,10L12,15L17,10H7Z";class O extends s.WF{render(){return this.disabled?this._renderTrigger():(0,s.qy)(h||(h=$` <ha-dropdown placement="bottom" @wa-show="${0}"> ${0} ${0} </ha-dropdown> `),this._showDropdown,this._renderTrigger(),this.options.map(this._renderOption))}_renderTrigger(){var t;const e=null===(t=this.getValueObject(this.options,this.value))||void 0===t?void 0:t.label,i={"select-disabled":this.disabled,"select-required":this.required,"select-no-value":!e};return(0,s.qy)(d||(d=$`<button ?disabled="${0}" slot="trigger" class="select-anchor ${0}"> ${0} <div class="content"> ${0} ${0} </div> ${0} </button>`),this.disabled,(0,a.H)(i),this._renderIcon(),this.hideLabel?s.s6:(0,s.qy)(u||(u=$`<p id="label" class="label">${0}</p>`),this.label),e?(0,s.qy)(_||(_=$`<p class="value">${0}</p>`),e):s.s6,this._renderArrow())}_renderArrow(){return this.showArrow?(0,s.qy)(p||(p=$` <div class="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> `),M):s.s6}_renderIcon(){const t=this.getValueObject(this.options,this.value),e=this.querySelector("[slot='icon']");return(0,s.qy)(v||(v=$` <div class="icon"> ${0} </div> `),null!=t&&t.iconPath?(0,s.qy)(g||(g=$`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):null!=t&&t.icon?(0,s.qy)(f||(f=$`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):this.renderIcon&&this.value?this.renderIcon(this.value):e?(0,s.qy)(b||(b=$`<slot name="icon"></slot>`)):s.s6)}_showDropdown(){this.style.setProperty("--control-select-menu-width",`${this._triggerButton.offsetWidth}px`)}constructor(...t){super(...t),this.showArrow=!1,this.hideLabel=!1,this.disabled=!1,this.required=!1,this.options=[],this._renderOption=t=>(0,s.qy)(y||(y=$`<ha-dropdown-item .value="${0}" .selected="${0}">${0} ${0}</ha-dropdown-item>`),t.value,this.value===t.value,t.iconPath?(0,s.qy)(m||(m=$`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):t.icon?(0,s.qy)(C||(C=$`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):this.renderIcon?(0,s.qy)(w||(w=$`<span slot="icon">${0}</span>`),this.renderIcon(t.value)):s.s6,t.label),this.getValueObject=(0,r.A)((t,e)=>t.find(t=>t.value===e))}}O.styles=[(0,s.AH)(x||(x=$`:host{display:inline-block;--control-select-menu-focus-color:var(--secondary-text-color);--control-select-menu-text-color:var(--primary-text-color);--control-select-menu-background-color:var(--disabled-color);--control-select-menu-background-opacity:0.2;--control-select-menu-border-radius:var(--ha-border-radius-lg);--control-select-menu-height:48px;--control-select-menu-padding:6px 10px;--mdc-icon-size:20px;--ha-ripple-color:var(--secondary-text-color);font-size:var(--ha-font-size-m);line-height:1.4;width:auto;-webkit-tap-highlight-color:transparent}.select-anchor{border:none;text-align:left;color:var(--primary-text-color);height:var(--control-select-menu-height);padding:var(--control-select-menu-padding);overflow:hidden;position:relative;cursor:pointer;display:flex;flex-direction:row;align-items:center;border-radius:var(--control-select-menu-border-radius);box-sizing:border-box;outline:0;overflow:hidden;background:0 0;z-index:0;transition:box-shadow 180ms ease-in-out,color 180ms ease-in-out;gap:10px;width:100%;user-select:none;font-style:normal;font-weight:var(--ha-font-weight-normal);letter-spacing:.25px}.select-anchor:hover{--control-select-menu-background-color:var(--ha-color-on-neutral-quiet)}.content{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex:1;overflow:hidden}.content p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;width:100%;margin:auto}.label{font-size:var(--ha-font-size-s);letter-spacing:.4px}.select-no-value .label{font-size:inherit;line-height:inherit;letter-spacing:inherit}.content .value{font-size:var(--ha-font-size-m)}.select-anchor:focus-visible{box-shadow:0 0 0 2px var(--control-select-menu-focus-color)}.select-anchor::before{content:"";position:absolute;top:0;left:0;height:100%;width:100%;background-color:var(--control-select-menu-background-color);transition:background-color 180ms ease-in-out,opacity 180ms ease-in-out;opacity:var(--control-select-menu-background-opacity)}.select-disabled.select-anchor{cursor:not-allowed;color:var(--disabled-color)}ha-dropdown::part(menu){min-width:var(--control-select-menu-width)}`))],(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"show-arrow"})],O.prototype,"showArrow",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"hide-label"})],O.prototype,"hideLabel",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],O.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],O.prototype,"required",void 0),(0,o.Cg)([(0,n.MZ)()],O.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],O.prototype,"value",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"options",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"renderIcon",void 0),(0,o.Cg)([(0,n.P)("button")],O.prototype,"_triggerButton",void 0),O=(0,o.Cg)([(0,n.EM)("ha-control-select-menu")],O),e()}catch(h){e(h)}})},25094:function(t,e,i){i(62953);var o=i(40445),s=i(26183),n=i(5124),a=i(67576),r=i(63672),c=i(1087),l=i(63091);i(67094);let h,d,u,_,p,v,g=t=>t;class f extends n.WF{firstUpdated(t){super.firstUpdated(t),this.setupSwipeListeners()}_toggle(){this.disabled||(this.checked=!this.checked,(0,c.r)(this,"change"))}connectedCallback(){super.connectedCallback(),this.setupSwipeListeners()}updated(t){super.updated(t),(t.has("disabled")||t.has("vertical")||t.has("reversed"))&&(this.destroyListeners(),this.setupSwipeListeners())}disconnectedCallback(){super.disconnectedCallback(),this.destroyListeners()}setupSwipeListeners(){var t;this.disabled||this.switch&&!this._mc&&(this._mc=new s.mS(this.switch,{touchAction:null!==(t=this.touchAction)&&void 0!==t?t:this.vertical?"pan-x":"pan-y"}),this._mc.add(new s.Hp({direction:this.vertical?s.EJ:s.fK})),this._mc.add(new s.Cx({event:"singletap"})),this._mc.add(new s.ac),this.vertical?(this._mc.on("swipeup",()=>{this.disabled||(this.checked=!!this.reversed,(0,c.r)(this,"change"))}),this._mc.on("swipedown",()=>{this.disabled||(this.checked=!this.reversed,(0,c.r)(this,"change"))})):(this._mc.on("swiperight",()=>{if(this.disabled)return;const t="rtl"===l.G.document.dir;this.checked=!this.reversed&&!t||this.reversed&&t,(0,c.r)(this,"change")}),this._mc.on("swipeleft",()=>{if(this.disabled)return;const t="rtl"===l.G.document.dir;this.checked=this.reversed&&!t||!this.reversed&&t,(0,c.r)(this,"change")})),this._mc.on("singletap pressup",()=>{this.disabled||this._toggle()}))}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0)}_keydown(t){if("Enter"===t.key||" "===t.key)return t.preventDefault(),void this._toggle();const e=!this.vertical&&"rtl"===l.G.document.dir,i=this.reversed!==e,[o,s]=this.vertical?["ArrowDown","ArrowUp"]:["ArrowRight","ArrowLeft"],n=i?s:o,a=i?o:s;if(t.key!==n&&t.key!==a)return;t.preventDefault();t.key===n!==this.checked&&this._toggle()}render(){return(0,n.qy)(h||(h=g` <div id="switch" class="switch" @keydown="${0}" aria-checked="${0}" aria-label="${0}" role="switch" tabindex="${0}" ?checked="${0}" ?disabled="${0}"> <div class="background"></div> <div class="button" aria-hidden="true"> ${0} </div> </div> `),this._keydown,this.checked?"true":"false",(0,r.J)(this.label),(0,r.J)(this.disabled?void 0:"0"),this.checked,this.disabled,this.checked?this.pathOn?(0,n.qy)(d||(d=g`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.pathOn):(0,n.qy)(u||(u=g`<slot name="icon-on"></slot>`)):this.pathOff?(0,n.qy)(_||(_=g`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.pathOff):(0,n.qy)(p||(p=g`<slot name="icon-off"></slot>`)))}constructor(...t){super(...t),this.disabled=!1,this.vertical=!1,this.reversed=!1,this.checked=!1}}f.styles=(0,n.AH)(v||(v=g`:host{display:block;--control-switch-on-color:var(--primary-color);--control-switch-off-color:var(--disabled-color);--control-switch-background-opacity:0.2;--control-switch-hover-background-opacity:0.4;--control-switch-thickness:40px;--control-switch-min-touch-size:40px;--control-switch-border-radius:var(--ha-border-radius-lg);--control-switch-padding:4px;--mdc-icon-size:20px;height:var(--control-switch-thickness);width:100%;box-sizing:border-box;user-select:none;transition:box-shadow 180ms ease-in-out;-webkit-tap-highlight-color:transparent}.switch:not([disabled]):focus-visible{box-shadow:0 0 0 2px var(--control-switch-off-color)}.switch[checked]:not([disabled]):focus-visible{box-shadow:0 0 0 2px var(--control-switch-on-color)}.switch{box-sizing:border-box;position:relative;height:100%;width:100%;border-radius:var(--control-switch-border-radius);outline:0;padding:var(--control-switch-padding);display:flex;cursor:pointer}.switch::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--control-switch-min-touch-size);min-height:var(--control-switch-min-touch-size)}.switch[disabled]{opacity:.5;cursor:not-allowed}.switch[disabled]::before{pointer-events:none}.switch .background{position:absolute;top:0;left:0;height:100%;width:100%;border-radius:inherit;background-color:var(--control-switch-off-color);transition:background-color 180ms ease-in-out;opacity:var(--control-switch-background-opacity)}.switch:not([disabled]):focus-visible .background,.switch:not([disabled]):hover .background{opacity:var(--control-switch-hover-background-opacity)}.switch .button{width:50%;height:100%;background:#d3d3d3;border-radius:calc(var(--control-switch-border-radius) - var(--control-switch-padding));transition:transform 180ms ease-in-out,background-color 180ms ease-in-out;background-color:var(--control-switch-off-color);color:#fff;display:flex;align-items:center;justify-content:center}.switch[checked] .background{background-color:var(--control-switch-on-color)}.switch[checked] .button{transform:translateX(100%);background-color:var(--control-switch-on-color)}.switch[checked] .button:dir(rtl){transform:translateX(-100%);background-color:var(--control-switch-on-color)}:host([reversed]) .switch{flex-direction:row-reverse}:host([reversed]) .switch[checked] .button{transform:translateX(-100%)}:host([reversed]) .switch[checked] .button:dir(rtl){transform:translateX(100%)}:host([vertical]){width:var(--control-switch-thickness);height:100%}:host([vertical]) .switch[checked] .button{transform:translateY(100%)}:host([vertical]) .switch .button{width:100%;height:50%}:host([vertical][reversed]) .switch{flex-direction:column-reverse}:host([vertical][reversed]) .switch[checked] .button{transform:translateY(-100%)}`)),(0,o.Cg)([(0,a.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],f.prototype,"vertical",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],f.prototype,"reversed",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],f.prototype,"checked",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"pathOn",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"pathOff",void 0),(0,o.Cg)([(0,a.MZ)({type:String})],f.prototype,"label",void 0),(0,o.Cg)([(0,a.MZ)({attribute:"touch-action"})],f.prototype,"touchAction",void 0),(0,o.Cg)([(0,a.P)("#switch")],f.prototype,"switch",void 0),f=(0,o.Cg)([(0,a.EM)("ha-control-switch")],f)},51336:function(t,e,i){i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63672);let r,c,l=t=>t;class h extends s.WF{render(){return(0,s.qy)(r||(r=l` <div class="heading-badge" role="${0}" tabindex="${0}"> <slot name="icon"></slot> <slot></slot> </div> `),(0,a.J)("button"===this.type?"button":void 0),(0,a.J)("button"===this.type?"0":void 0))}constructor(...t){super(...t),this.type="text"}}h.styles=(0,s.AH)(c||(c=l`[role=button]{cursor:pointer}.heading-badge{display:flex;flex-direction:row;white-space:nowrap;align-items:center;gap:3px;color:var(--ha-heading-badge-text-color,var(--secondary-text-color));font-size:var(--ha-heading-badge-font-size, var(--ha-font-size-m));font-weight:var(--ha-heading-badge-font-weight,400);line-height:var(--ha-heading-badge-line-height, 20px);letter-spacing:.1px;--mdc-icon-size:16px}::slotted([slot=icon]){--ha-icon-display:block;color:var(--icon-color,inherit)}`)),(0,o.Cg)([(0,n.MZ)()],h.prototype,"type",void 0),h=(0,o.Cg)([(0,n.EM)("ha-heading-badge")],h)},78673:function(t,e,i){i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(6412),r=i(89784),c=i(69093),l=i(28669);let h,d,u,_=t=>t;class p extends s.WF{willUpdate(t){if(super.willUpdate(t),t.has("user"))return void this._getPersonPicture();const e=t.get("hass");if(this._personEntityId&&e&&this.hass.states[this._personEntityId]!==e.states[this._personEntityId]){const t=this.hass.states[this._personEntityId];t?this._personPicture=t.attributes.entity_picture:this._getPersonPicture()}else!this._personEntityId&&e&&this._getPersonPicture()}render(){if(!this.hass||!this.user)return s.s6;const t=this._personPicture;if(t)return(0,s.qy)(h||(h=_`<div style="${0}" class="picture"></div>`),(0,r.W)({backgroundImage:`url(${this.hass.hassUrl(t)})`}));const e=(0,l._2)(this.user.name);return(0,s.qy)(d||(d=_`<div class="initials ${0}"> ${0} </div>`),(0,a.H)({long:e.length>2}),e)}_getPersonPicture(){if(this._personEntityId=void 0,this._personPicture=void 0,this.hass&&this.user)for(const t of Object.values(this.hass.states))if(t.attributes.user_id===this.user.id&&"person"===(0,c.t)(t)){this._personEntityId=t.entity_id,this._personPicture=t.attributes.entity_picture;break}}}p.styles=(0,s.AH)(u||(u=_`:host{display:block;width:40px;height:40px}.picture{width:100%;height:100%;background-size:cover;border-radius:var(--ha-border-radius-circle)}.initials{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:100%;height:100%;border-radius:var(--ha-border-radius-circle);background-color:var(--light-primary-color);text-decoration:none;color:var(--text-light-primary-color,var(--primary-text-color));overflow:hidden}.initials.long{font-size:var(--ha-font-size-s)}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"user",void 0),(0,o.Cg)([(0,n.wk)()],p.prototype,"_personPicture",void 0),p=(0,o.Cg)([(0,n.EM)("ha-user-badge")],p)},57488:function(t,e,i){i.d(e,{g:function(){return a},t:function(){return n}});i(74423),i(72712),i(18111),i(22489),i(18237);var o=i(4423);const s=t=>({filter:{domain:"cover",device_class:t}}),n={light:{filter:{domain:"light"}},fan:{filter:{domain:"fan"}},switch:{filter:{domain:"switch"}},"cover-blind":s("blind"),"cover-curtain":s("curtain"),"cover-damper":s("damper"),"cover-awning":s("awning"),"cover-door":s("door"),"cover-garage":s("garage"),"cover-gate":s("gate"),"cover-shade":s("shade"),"cover-shutter":s("shutter"),"cover-window":s("window")},a=(t,e,i,s)=>t.reduce((t,a)=>{const r=n[a],c=(0,o.r)(s,Object.assign({area:e,entity_category:"none"},r.filter));return t[a]=Object.keys(s.entities).filter(t=>c(t)&&!(null!=i&&i.includes(t))),t},{})},84337:function(t,e,i){i.d(e,{S:function(){return o}});i(44114),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const o=t=>{if(!t)return[];const e=new Set,i=[];for(const o of t){const t=Number(o);if(isNaN(t))continue;const s=Math.max(0,Math.min(100,t));e.has(s)||(e.add(s),i.push(s))}return i}},84610:function(t,e,i){i.d(e,{C6:function(){return s},i5:function(){return n},ye:function(){return o}});var o=function(t){return t[t.MODES=1]="MODES",t}({}),s=function(t){return t.HUMIDIFIER="humidifier",t.DEHUMIDIFIER="dehumidifier",t}({});const n={drying:"on",humidifying:"on",idle:"off",off:"off"}},22865:function(t,e,i){i.d(e,{IQ:function(){return n},gK:function(){return r},mB:function(){return s},yU:function(){return a}});var o=i(22675),s=function(t){return t[t.START_MOWING=1]="START_MOWING",t[t.PAUSE=2]="PAUSE",t[t.DOCK=4]="DOCK",t}({});function n(t){return"mowing"===t.state}function a(t){return t.state!==o.Hh&&"mowing"!==t.state}function r(t){return t.state!==o.Hh&&"docked"!==t.state}},24717:function(t,e,i){i.d(e,{Ak:function(){return n},Bd:function(){return a},Ri:function(){return s},lg:function(){return r},qT:function(){return l},uu:function(){return c}});i(74423);var o=i(22675),s=function(t){return t[t.TURN_ON=1]="TURN_ON",t[t.TURN_OFF=2]="TURN_OFF",t[t.PAUSE=4]="PAUSE",t[t.STOP=8]="STOP",t[t.RETURN_HOME=16]="RETURN_HOME",t[t.FAN_SPEED=32]="FAN_SPEED",t[t.BATTERY=64]="BATTERY",t[t.STATUS=128]="STATUS",t[t.SEND_COMMAND=256]="SEND_COMMAND",t[t.LOCATE=512]="LOCATE",t[t.CLEAN_SPOT=1024]="CLEAN_SPOT",t[t.MAP=2048]="MAP",t[t.STATE=4096]="STATE",t[t.START=8192]="START",t[t.CLEAN_AREA=16384]="CLEAN_AREA",t}({});function n(t){return["cleaning","on"].includes(t.state)}function a(t){return t.state!==o.Hh&&!n(t)}function r(t){return!["docked","off","idle"].includes(t.state)}function c(t){return t.state!==o.Hh&&"returning"!==t.state}const l=(t,e)=>t.callWS({type:"vacuum/get_segments",entity_id:e})},92326:function(t,e,i){i.d(e,{Cp:function(){return u},hJ:function(){return h},lg:function(){return d},pc:function(){return l},ph:function(){return r},qm:function(){return a},sA:function(){return c}});var o=i(47129),s=i(82286),n=i(22675),a=function(t){return t[t.OPEN=1]="OPEN",t[t.CLOSE=2]="CLOSE",t[t.SET_POSITION=4]="SET_POSITION",t[t.STOP=8]="STOP",t}({});const r=[0,25,75,100],c=t=>(0,s.$)(t,4);function l(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return void 0!==t.attributes.current_position&&null!==t.attributes.current_position?100===t.attributes.current_position:"open"===t.state}(t)&&!function(t){return"opening"===t.state}(t)}function h(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return void 0!==t.attributes.current_position&&null!==t.attributes.current_position?0===t.attributes.current_position:"closed"===t.state}(t)&&!function(t){return"closing"===t.state}(t)}function d(t){return t.state!==n.Hh}function u(t,e,i){const s=(0,o.a)(t)?t.attributes.current_position:void 0,n=null!=i?i:s;return n&&100!==n?e.formatEntityAttributeValue(t,"current_position",Math.round(n)):""}},1966:function(t,e,i){i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63672),r=i(89784),c=i(79468),l=i(16629),h=i(79622);let d,u,_=t=>t;class p extends s.WF{focus(){var t;null===(t=this._button)||void 0===t||t.focus()}get _rgbColor(){if(this.color){if("hs_color"in this.color)return(0,c.BA)([this.color.hs_color[0],this.color.hs_color[1]/100]);if("color_temp_kelvin"in this.color)return(0,l.Mn)(this.color.color_temp_kelvin);if("rgb_color"in this.color)return this.color.rgb_color;if("rgbw_color"in this.color)return(0,l.E7)(this.color.rgbw_color);var t,e;if("rgbww_color"in this.color)return(0,l.lf)(this.color.rgbww_color,null===(t=this.stateObj)||void 0===t?void 0:t.attributes.min_color_temp_kelvin,null===(e=this.stateObj)||void 0===e?void 0:e.attributes.max_color_temp_kelvin)}return[255,255,255]}render(){const t=(0,c.v2)(this._rgbColor),e=(0,h.EP)(this._rgbColor)>.8,i=e?"var(--divider-color)":"transparent";return(0,s.qy)(d||(d=_` <button .disabled="${0}" title="${0}" aria-label="${0}" style="${0}"></button> `),this.disabled,(0,a.J)(this.label),(0,a.J)(this.label),(0,r.W)({"background-color":t,"border-color":i,"--focus-color":e?i:t}))}constructor(...t){super(...t),this.disabled=!1}}p.styles=(0,s.AH)(u||(u=_`:host{display:block;width:var(--ha-favorite-color-button-size,40px);height:var(--ha-favorite-color-button-size,40px)}button{background-color:var(--color);position:relative;display:block;width:100%;height:100%;border:1px solid transparent;border-radius:var(--ha-favorite-color-button-border-radius,var(--ha-border-radius-pill));padding:0;margin:0;cursor:pointer;outline:0;transition:box-shadow 180ms ease-in-out,transform 180ms ease-in-out}button:focus-visible{box-shadow:0 0 0 2px var(--focus-color)}button:active{transform:scale(1.1)}:host([disabled]){pointer-events:none}button:disabled{filter:grayscale(1) opacity(.5)}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"stateObj",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"color",void 0),(0,o.Cg)([(0,n.P)("button",!0)],p.prototype,"_button",void 0),p=(0,o.Cg)([(0,n.EM)("ha-favorite-color-button")],p)},68737:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{J:function(){return w}});i(44114),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(22786),l=i(79468),h=i(16629),d=i(1087),u=i(52658),_=i(77796),p=i(10223),v=i(22675),g=i(88827),f=i(57264),b=t([p,g]);[p,g]=b.then?(await b)():b;let y,m,C=t=>t;const w=(t,e)=>{const i=[],o=(e-t)/10;for(let s=0;s<11;s++){const e=t+o*s,n=(0,l.v2)((0,h.Mn)(e));i.push([.1*s,n])}return i.map(([t,e])=>`${e} ${100*t}%`).join(", ")};class x extends n.WF{render(){var t,e;if(!this.stateObj)return n.s6;const i=null!==(t=this.stateObj.attributes.min_color_temp_kelvin)&&void 0!==t?t:2700,o=null!==(e=this.stateObj.attributes.max_color_temp_kelvin)&&void 0!==e?e:6500,s=this._generateTemperatureGradient(i,o),a=(0,u.Se)(this.stateObj);return(0,n.qy)(y||(y=C` <ha-control-slider touch-action="none" inverted vertical .value="${0}" .min="${0}" .max="${0}" mode="cursor" @value-changed="${0}" @slider-moved="${0}" .label="${0}" style="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"> </ha-control-slider> `),this._ctPickerValue,i,o,this._ctColorChanged,this._ctColorCursorMoved,this.hass.localize("ui.dialogs.more_info_control.light.color_temp"),(0,r.W)({"--control-slider-color":a,"--gradient":s}),this.stateObj.state===v.Hh,g.rM.light.color_temp_kelvin,this.hass.locale)}_updateSliderValues(){const t=this.stateObj;"on"===t.state?this._ctPickerValue=t.attributes.color_mode===f.NC.COLOR_TEMP?t.attributes.color_temp_kelvin:void 0:this._ctPickerValue=void 0}willUpdate(t){super.willUpdate(t),!this._isInteracting&&t.has("stateObj")&&this._updateSliderValues()}_ctColorCursorMoved(t){const e=t.detail.value;this._isInteracting=void 0!==e,isNaN(e)||this._ctPickerValue===e||(this._ctPickerValue=e,this._throttleUpdateColorTemp())}_ctColorChanged(t){const e=t.detail.value;isNaN(e)||this._ctPickerValue===e||(this._ctPickerValue=e,this._updateColorTemp())}_updateColorTemp(){const t=this._ctPickerValue;this._applyColor({color_temp_kelvin:t})}_applyColor(t,e){(0,d.r)(this,"color-changed",t),this.hass.callService("light","turn_on",Object.assign(Object.assign({entity_id:this.stateObj.entity_id},t),e))}static get styles(){return[(0,n.AH)(m||(m=C`:host{display:flex;flex-direction:column}ha-control-slider{height:45vh;max-height:320px;min-height:200px;--control-slider-thickness:130px;--control-slider-border-radius:var(--ha-border-radius-6xl);--control-slider-color:var(--primary-color);--control-slider-background:-webkit-linear-gradient(
            top,
            var(--gradient)
          );--control-slider-tooltip-font-size:var(--ha-font-size-xl);--control-slider-background-opacity:1}`))]}constructor(...t){super(...t),this._generateTemperatureGradient=(0,c.A)((t,e)=>w(t,e)),this._throttleUpdateColorTemp=(0,_.n)(()=>{this._updateColorTemp()},500)}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"stateObj",void 0),(0,s.Cg)([(0,a.wk)()],x.prototype,"_ctPickerValue",void 0),(0,s.Cg)([(0,a.wk)()],x.prototype,"_isInteracting",void 0),x=(0,s.Cg)([(0,a.EM)("light-color-temp-picker")],x),o()}catch(y){o(y)}})},15471:function(t,e,i){i.d(e,{X:function(){return s}});i(3362),i(62953);var o=i(1087);const s=(t,e)=>new Promise(s=>{const n=e.cancel,a=e.submit;(0,o.r)(t,"show-dialog",{dialogTag:"dialog-update-backup",dialogImport:()=>i.e(628).then(i.bind(i,94559)),dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{s(null),n&&n()},submit:t=>{s(t),a&&a(t)}})})})},70565:function(t,e,i){i.d(e,{C_:function(){return a},Sg:function(){return c},_W:function(){return r}});i(74423);var o=i(71727),s=i(82286),n=i(43248);const a=36e5,r=t=>!!t&&("weather"===(0,o.m)(t.entity_id)&&((0,s.$)(t,n.Or.FORECAST_DAILY)||(0,s.$)(t,n.Or.FORECAST_TWICE_DAILY)||(0,s.$)(t,n.Or.FORECAST_HOURLY))),c=(t,e)=>{if(!t)return;const i=(0,n.V7)(t);return e&&i.includes(e)?e:(0,n.JM)(t)}},18696:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{Is:function(){return C},KX:function(){return $},kd:function(){return w},qO:function(){return x}});i(44114);var s=i(74487),n=i(5124),a=i(89784),r=i(22786),c=i(69543),l=i(70565),h=t([s]);s=(h.then?(await h)():h)[0];let d,u,_,p,v,g,f,b=t=>t;const y=(0,r.A)(t=>new Intl.DateTimeFormat(t,{weekday:"narrow"})),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t,{hour:"numeric",hourCycle:e?"h12":"h23"})),C=(t,e,i)=>{const o=y(i.language),s=[];for(let n=0;n<t.length;n+=e)s.push(o.format(new Date(t[n].datetime)));return(0,n.qy)(d||(d=b` <div class="day-labels"> ${0} </div> `),s.map(t=>(0,n.qy)(u||(u=b`<div class="day-label">${0}</div>`),t)))},w=(t,e)=>{const i=m(e.language,(0,c.J)(e)),o=Date.now(),s=Math.floor((o+t*l.C_)/l.C_)*l.C_,a=Math.max(1,Math.round(t/4)),r=[];for(let n=0;n<=t;n+=a){const t=o+n*l.C_;if(t>s)break;r.push(i.format(new Date(t)))}return(0,n.qy)(_||(_=b` <div class="hour-labels"> ${0} </div> `),r.map(t=>(0,n.qy)(p||(p=b`<div class="hour-label">${0}</div>`),t)))},x=(t,e)=>{const i=m(e.language,(0,c.J)(e)),o=Math.ceil(Date.now()/l.C_)*l.C_,s=Math.max(1,Math.round(t/4));return(0,n.qy)(v||(v=b` <div class="hour-slot-labels" style="${0}"> ${0} </div> `),(0,a.W)({"grid-template-columns":`repeat(${t}, 1fr)`}),Array.from({length:t},(t,e)=>{if(e%s!==0)return n.s6;const r=o+e*l.C_;return(0,n.qy)(g||(g=b` <div class="hour-slot-label" style="${0}"> ${0} </div> `),(0,a.W)({"grid-column":String(e+1)}),i.format(new Date(r)))}))},$=(0,n.AH)(f||(f=b`.day-labels,.hour-labels,.hour-slot-labels{align-items:center;height:10px;color:var(--secondary-text-color);font-size:9px;line-height:1}.day-labels,.hour-labels{display:flex}.hour-labels{justify-content:space-between}.day-label{flex:1;text-align:center}.hour-slot-labels{display:grid}.hour-slot-label{text-align:center;min-width:0;white-space:nowrap}`));o()}catch(d){o(d)}})},22287:function(t,e,i){i.d(e,{U:function(){return l},d:function(){return h}});var o=i(5124),s=i(82286),n=(i(48374),i(67094),i(88360)),a=i(53072);let r,c=t=>t;const l=(t,e,i,n,l)=>{if(null!=i&&!i||!(0,s.$)(e,a.vj.VOLUME_MUTE))return o.s6;const h=e.attributes.is_volume_muted;return(0,o.qy)(r||(r=c` <ha-control-button class="mute" .label="${0}" .disabled="${0}" @click="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),t.localize("ui.card.media_player."+(h?"media_volume_unmute":"media_volume_mute")),n,l,h?"M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z":"M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z")},h=(t,e,i,o)=>{t.stopPropagation(),(0,n.j)(o,"light"),e.callService("media_player","volume_mute",{entity_id:i.entity_id,is_volume_muted:!i.attributes.is_volume_muted})}},2706:function(t,e,i){i.d(e,{R:function(){return d},U:function(){return h}});i(44114);var o=i(79468),s=i(63004);const n=["#249df2","#239dec","#239fec","#23a3eb","#23a6eb","#23a9e9","#22abe6","#22aee4","#22b1e0","#21b1dd","#23b6da","#28b8d6","#2abdd3","#2fbfcf","#34c4cc","#36c6c9","#43c9c0","#59c9b3","#6fc9a3","#82c992","#98c985","#a8c977","#b9c762","#c7c74d","#d1be31","#dbb921","#e6ba22","#ecc123","#ecba23","#eeb424","#ecaa23","#eca023","#ec9723","#ec8f23","#ec8523","#ec7c23","#ee7f24","#e67122","#df6321","#df5b21","#dd5421","#db4c21","#db4121","#db3721","#d62f20","#cc301f","#c22a1d","#ca2d1e","#c82c1d"],a=-6+n.length-1,r=n.map(t=>(0,o.xp)(t)),c=t=>{const e=Math.max(-6,Math.min(a,t))- -6,i=Math.floor(e),o=Math.min(i+1,r.length-1),s=e-i,n=r[i],c=r[o];return[n[0]+(c[0]-n[0])*s,n[1]+(c[1]-n[1])*s,n[2]+(c[2]-n[2])*s]},l=(t,e,i,s)=>{const n=[];for(let a=0;a<i;a++){const r=a/(i-1),l=e+r*(t-e);n.push({offset:r,color:(0,o.v2)(c(s(l)))})}return n},h=(t,e,i=5)=>l(t,e,i,t=>t),d=(t,e,i=5)=>{const o=(t+e)/2,n=(0,s.q)(.025*o-.15,.05,1);return l(t,e,i,t=>o+n*(t-o))}},32181:function(t,e,i){i.d(e,{C:function(){return o}});i(3362),i(62953);async function o(){return await i.e(47542).then(i.bind(i,53205)),document.createElement("hui-card-feature-more-info-hint-editor")}},7349:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{s:function(){return A}});i(16280),i(74423),i(18111),i(22489),i(61701),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(6412),c=i(89784),l=i(22786),h=i(44537),d=i(71727),u=i(22542),_=i(47129),p=i(52658),v=(i(48374),i(28624),i(59174)),g=i(93367),f=(i(67094),i(57488)),b=i(88360),y=i(86030),m=i(49908),C=i(37531),w=t([v,g]);[v,g]=w.then?(await w)():w;let x,$,M,O,H,k=t=>t;const A=(t,e)=>!!(e.area_id?t.areas[e.area_id]:void 0);class j extends n.WF{get _area(){if(this.hass&&this.context&&this.context.area_id)return this.hass.areas[this.context.area_id]}get _controls(){var t;return(null===(t=this._config)||void 0===t?void 0:t.controls)||[...C.Ut]}_normalizeControl(t){return"object"==typeof t&&"entity_id"in t?{type:"entity",value:t.entity_id}:C.Ut.includes(t)?{type:"domain",value:t}:{type:"entity",value:t}}static getStubConfig(){return{type:"area-controls"}}static async getConfigElement(){return await i.e(62800).then(i.bind(i,7027)),document.createElement("hui-area-controls-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_handleButtonTap(t){var e;if(t.stopPropagation(),!this.hass||!this._config)return;const i=t.currentTarget.control;if("entity"===i.type){const t=this.hass.states[i.value];return void(t&&((0,b.j)(this,"light"),(0,u.F)(this.hass,[t])))}if(null===(e=this.context)||void 0===e||!e.area_id)return;const o=this._domainControls(this._controls),s=this._controlEntities(o,this.context.area_id,this.context.exclude_entities,this.hass.entities,this.hass.devices,this.hass.areas)[i.value].map(t=>this.hass.states[t]).filter(t=>Boolean(t));(0,b.j)(this,"light"),(0,u.F)(this.hass,s)}render(){if(!(this._config&&this.hass&&this.context&&this._area&&A(this.hass,this.context)))return n.s6;const t=this._controls.map(t=>this._normalizeControl(t)),e=this._domainControls(this._controls),i=this._controlEntities(e,this.context.area_id,this.context.exclude_entities,this.hass.entities,this.hass.devices,this.hass.areas),o=t.filter(t=>{var e;return"domain"===t.type?i[t.value].length>0:this.hass.states[t.value]&&!(null!==(e=this.context)&&void 0!==e&&null!==(e=e.exclude_entities)&&void 0!==e&&e.includes(t.value))}),s=this._config.controls?o:o.slice(0,4);return s.length?(0,n.qy)(x||(x=k` <ha-control-button-group class="${0}"> ${0} </ha-control-button-group> `),(0,r.H)({"no-stretch":"inline"===this.position}),s.map(t=>{let e,o,s,a,r,l;if("domain"===t.type){const n=f.t[t.value],c=i[t.value].map(t=>this.hass.states[t]).filter(t=>Boolean(t)),l=(0,u.j)(c);e=!!c[0]&&(0,_.a)(c[0],l),o=this.hass.localize(`ui.card_features.area_controls.${t.value}.${e?"off":"on"}`),s=n.filter.domain,a=n.filter.device_class?(0,h.e)(n.filter.device_class)[0]:void 0,r=l}else{if("entity"!==t.type)return n.s6;if(l=this.hass.states[t.value],!l)return n.s6;e=(0,_.a)(l),o=this.hass.localize("ui.card.common.turn_"+(e?"off":"on")),s=(0,d.m)(l.entity_id),r=l.state}const v=(0,y.B)((0,p.ZK)(s,a,r,!0));return(0,n.qy)($||($=k` <ha-control-button style="${0}" .title="${0}" aria-label="${0}" class="${0}" .control="${0}" @click="${0}"> ${0} </ha-control-button> `),(0,c.W)({"--active-color":v}),o,o,e?"active":"",t,this._handleButtonTap,"domain"===t.type?(0,n.qy)(M||(M=k`<ha-domain-icon .domain="${0}" .deviceClass="${0}" .state="${0}"></ha-domain-icon>`),s,a,r):(0,n.qy)(O||(O=k`<ha-state-icon .stateObj="${0}"></ha-state-icon>`),l))})):n.s6}static get styles(){return[m.T,(0,n.AH)(H||(H=k`:host{pointer-events:none!important;display:flex;flex-direction:row;justify-content:flex-end}ha-control-button-group{pointer-events:auto;width:100%}ha-control-button-group.no-stretch{width:auto;max-width:100%}ha-control-button-group.no-stretch>ha-control-button{width:48px}ha-control-button{--active-color:var(--state-active-color);--control-button-focus-color:var(--state-active-color)}ha-control-button.active{--control-button-background-color:var(--active-color);--control-button-icon-color:var(--active-color)}`))]}constructor(...t){super(...t),this._domainControls=(0,l.A)(t=>t.map(t=>this._normalizeControl(t)).filter(t=>"domain"===t.type).map(t=>t.value)),this._controlEntities=(0,l.A)((t,e,i,o,s,n)=>(0,f.g)(t,e,i,this.hass))}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],j.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],j.prototype,"context",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],j.prototype,"position",void 0),(0,s.Cg)([(0,a.wk)()],j.prototype,"_config",void 0),j=(0,s.Cg)([(0,a.EM)("hui-area-controls-card-feature")],j),o()}catch(x){o(x)}})},38098:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{N:function(){return _}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(20058),l=t([c]);c=(l.then?(await l)():l)[0];let h,d,u=t=>t;const _=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"sensor"===(0,r.m)(i.entity_id)&&(0,c.ty)(i.attributes)};class p extends n.WF{static getStubConfig(){return{type:"bar-gauge"}}static async getConfigElement(){return await i.e(34667).then(i.bind(i,39046)),document.createElement("hui-bar-gauge-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t,e;if(!(this._config&&this.hass&&this.context&&this.context.entity_id&&this.hass.states[this.context.entity_id]&&_(this.hass,this.context)))return n.s6;const i=this.hass.states[this.context.entity_id],o=null!==(t=this._config.min)&&void 0!==t?t:0,s=null!==(e=this._config.max)&&void 0!==e?e:100,a=parseFloat(i.state);if(isNaN(a)||o>=s)return n.s6;const r=Math.max(0,Math.min(100,(a-o)/(s-o)*100));return(0,n.qy)(h||(h=u`<div style="width:${0}%"></div> <div class="bar-gauge-background"></div>`),r)}}p.styles=(0,n.AH)(d||(d=u`:host{display:flex;width:100%;height:var(--feature-height);border-radius:var(--feature-border-radius);overflow:hidden;pointer-events:none!important}:host>div{height:100%;background-color:var(--feature-color);transition:width 180ms ease-in-out}.bar-gauge-background{flex:1;opacity:.2}`)),(0,s.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],p.prototype,"_config",void 0),p=(0,s.Cg)([(0,a.EM)("hui-bar-gauge-card-feature")],p),o()}catch(h){o(h)}})},89807:function(t,e,i){i.d(e,{l:function(){return u}});i(16280),i(74423),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=(i(48374),i(28624),i(84025)),c=i(42269),l=i(49908);let h,d=t=>t;const u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;const o=(0,a.m)(i.entity_id);return["button","input_button","scene","script"].includes(o)};class _ extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}_pressButton(){var t;if(!this.hass||!this._stateObj)return;const e=(0,a.m)(this._stateObj.entity_id),i="button"===e||"input_button"===e?"press":"turn_on";if("script"===e){var o;const t=this._stateObj.entity_id;var s;if((0,r.GA)(this.hass,t)&&!(0,r.sW)(this.hass,t,null===(o=this._config)||void 0===o?void 0:o.data))return void(0,c.p)(this,{entityId:t,data:null===(s=this._config)||void 0===s?void 0:s.data})}const n=Object.assign({entity_id:this._stateObj.entity_id},null!==(t=this._config)&&void 0!==t&&t.data?{variables:this._config.data}:{});this.hass.callService(e,i,n)}static getStubConfig(){return{type:"button"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t;return this._config&&this.hass&&this.context&&this._stateObj&&u(this.hass,this.context)?(0,s.qy)(h||(h=d` <ha-control-button-group> <ha-control-button .disabled="${0}" class="press-button" @click="${0}"> ${0} </ha-control-button> </ha-control-button-group> `),"unavailable"===this._stateObj.state,this._pressButton,null!==(t=this._config.action_name)&&void 0!==t?t:this.hass.localize("ui.card.button.press")):s.s6}static async getConfigElement(){return await i.e(57218).then(i.bind(i,72281)),document.createElement("hui-button-card-feature-editor")}}_.styles=l.T,(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],_.prototype,"_config",void 0),_=(0,o.Cg)([(0,n.EM)("hui-button-card-feature")],_)},11865:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{f:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(38279),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"climate"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.$2.FAN_MODE)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.fan_modes}static getStubConfig(){return{type:"climate-fan-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(40852).then(i.bind(i,99743)),document.createElement("hui-climate-fan-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="fan_mode",this._modesAttribute="fan_modes",this._dropdownIconPath=d,this._serviceDomain="climate",this._serviceAction="set_fan_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-climate-fan-modes-card-feature")],_),o()}catch(d){o(d)}})},85032:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{E:function(){return g}});i(94490),i(26910),i(18111),i(61701),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(52658),l=i(38279),h=i(98071),d=i(48555),u=t([d]);d=(u.then?(await u)():u)[0];let _,p=t=>t;const v="M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",g=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"climate"===(0,r.m)(i.entity_id)};class f extends d.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.hvac_modes}get _label(){return this.hass.localize("ui.card.climate.mode")}get _controlSelectStyle(){if(this._stateObj)return{"--control-select-color":(0,c.Se)(this._stateObj)}}static getStubConfig(){return{type:"climate-hvac-modes"}}static async getConfigElement(){return await i.e(48465).then(i.bind(i,16072)),document.createElement("hui-climate-hvac-modes-card-feature-editor")}_getValue(t){return t.state}_getOptions(){var t;if(!this._stateObj||!this.hass)return[];const e=(this._stateObj.attributes.hvac_modes||[]).concat().sort(l.VV).reverse();return(0,h.P)(e,null===(t=this._config)||void 0===t?void 0:t.hvac_modes).map(t=>({value:t,label:this.hass.formatEntityState(this._stateObj,t),iconPath:(0,l.on)(t)}))}_renderOptionIcon(t){return(0,n.qy)(_||(_=p`<ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon>`),t.iconPath)}_isSupported(){return!!(this.hass&&this.context&&g(this.hass,this.context))}constructor(...t){super(...t),this._attribute="hvac_mode",this._modesAttribute="hvac_modes",this._dropdownIconPath=v,this._serviceDomain="climate",this._serviceAction="set_hvac_mode",this._showDropdownOptionIcons=!1,this._defaultStyle="icons"}}f=(0,s.Cg)([(0,a.EM)("hui-climate-hvac-modes-card-feature")],f),o()}catch(_){o(_)}})},47547:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{p:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(38279),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"climate"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.$2.PRESET_MODE)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.preset_modes}static getStubConfig(){return{type:"climate-preset-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(33862).then(i.bind(i,7205)),document.createElement("hui-climate-preset-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="preset_mode",this._modesAttribute="preset_modes",this._dropdownIconPath=d,this._serviceDomain="climate",this._serviceAction="set_preset_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-climate-preset-modes-card-feature")],_),o()}catch(d){o(d)}})},66102:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{S:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(38279),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M6 14H9L5 18L1 14H4C4 11.3 5.7 6.6 11 6.1V8.1C7.6 8.6 6 11.9 6 14M20 14C20 11.3 18.3 6.6 13 6.1V8.1C16.4 8.7 18 11.9 18 14H15L19 18L23 14H20Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"climate"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.$2.SWING_HORIZONTAL_MODE)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.swing_horizontal_modes}static getStubConfig(){return{type:"climate-swing-horizontal-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(8260).then(i.bind(i,4623)),document.createElement("hui-climate-swing-horizontal-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="swing_horizontal_mode",this._modesAttribute="swing_horizontal_modes",this._dropdownIconPath=d,this._serviceDomain="climate",this._serviceAction="set_swing_horizontal_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-climate-swing-horizontal-modes-card-feature")],_),o()}catch(d){o(d)}})},89156:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{W:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(38279),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M6 14H9L5 18L1 14H4C4 11.3 5.7 6.6 11 6.1V8.1C7.6 8.6 6 11.9 6 14M20 14C20 11.3 18.3 6.6 13 6.1V8.1C16.4 8.7 18 11.9 18 14H15L19 18L23 14H20Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"climate"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.$2.SWING_MODE)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.swing_modes}static getStubConfig(){return{type:"climate-swing-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(44621).then(i.bind(i,27420)),document.createElement("hui-climate-swing-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="swing_mode",this._modesAttribute="swing_modes",this._dropdownIconPath=d,this._serviceDomain="climate",this._serviceAction="set_swing_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-climate-swing-modes-card-feature")],_),o()}catch(d){o(d)}})},3453:function(t,e,i){i.d(e,{Q:function(){return _}});i(16280),i(74423),i(18111),i(22489),i(61701),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=(i(48374),i(28624),i(43958),i(22675)),c=i(49908),l=i(37531);let h,d,u=t=>t;const _=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"counter"===(0,a.m)(i.entity_id)},p={increment:t=>({translationKey:"increment",icon:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",serviceName:"increment",disabled:parseInt(t.state)===t.attributes.maximum}),reset:()=>({translationKey:"reset",icon:"M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",serviceName:"reset",disabled:!1}),decrement:t=>({translationKey:"decrement",icon:"M19,13H5V11H19V13Z",serviceName:"decrement",disabled:parseInt(t.state)===t.attributes.minimum})};class v extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static async getConfigElement(){return await i.e(13816).then(i.bind(i,42699)),document.createElement("hui-counter-actions-card-feature-editor")}static getStubConfig(){return{type:"counter-actions"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t,e;if(!(this._config&&this.hass&&this.context&&this._stateObj&&_(this.hass,this.context)))return null;const i=null!==(t=null===(e=this._config)||void 0===e?void 0:e.actions)&&void 0!==t?t:l.HA;return(0,s.qy)(h||(h=u` <ha-control-button-group> ${0} </ha-control-button-group> `),i.filter(t=>l.HA.includes(t)).map(t=>{var e;const i=p[t](this._stateObj);return(0,s.qy)(d||(d=u` <ha-control-button .entry="${0}" .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),i,this.hass.localize(`ui.card.counter.actions.${i.translationKey}`),this._onActionTap,i.disabled||(null===(e=this._stateObj)||void 0===e?void 0:e.state)===r.Hh,i.icon)}))}_onActionTap(t){t.stopPropagation();const e=t.target.entry;this.hass.callService("counter",e.serviceName,{entity_id:this._stateObj.entity_id})}}v.styles=c.T,(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],v.prototype,"_config",void 0),v=(0,o.Cg)([(0,n.EM)("hui-counter-actions-card-feature")],v)},1248:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{H:function(){return C}});i(16280);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(78870),l=i(53610),h=i(71727),d=i(47129),u=i(52658),_=i(10223),p=i(98079),v=i(22675),g=i(88827),f=i(49908),b=t([_,l,g]);[_,l,g]=b.then?(await b)():b;let y,m=t=>t;const C=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"cover"===(0,h.m)(i.entity_id)&&(0,p.dx)(i)};class w extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"cover-position"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&C(this.hass,this.context)))return n.s6;const e=(0,d.a)(this._stateObj)&&null!==(t=this._stateObj.attributes.current_position)&&void 0!==t?t:0,i=Math.max(Math.round(e),0),o=(0,u.Se)(this._stateObj,"open"),s={"--feature-color":this.color?(0,c.MP)(this.color):(0,u.Se)(this._stateObj),"--state-cover-inactive-color":o};return(0,n.qy)(y||(y=m` <ha-control-slider style="${0}" .value="${0}" min="0" max="100" step="1" inverted show-handle @value-changed="${0}" .label="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"></ha-control-slider> `),(0,r.W)(s),i,this._valueChanged,(0,l.computeAttributeNameDisplay)(this.hass.localize,this._stateObj,this.hass.entities,"current_position"),this._stateObj.state===v.Hh,g.rM.cover.current_position,this.hass.locale)}_valueChanged(t){const{value:e}=t.detail;"number"!=typeof e||isNaN(e)||this.hass.callService("cover","set_cover_position",{entity_id:this._stateObj.entity_id,position:e})}static get styles(){return f.T}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"context",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"color",void 0),(0,s.Cg)([(0,a.wk)()],w.prototype,"_config",void 0),w=(0,s.Cg)([(0,a.EM)("hui-cover-position-card-feature")],w),o()}catch(y){o(y)}})},31095:function(t,e,i){i.d(e,{B:function(){return h}});var o=i(40445),s=i(67576),n=i(98079),a=i(84337),r=i(55719),c=i(32181);const l={domain:"cover",supportsPosition:n.dx,getFavoritePositions:t=>{var e;return null==t||null===(e=t.options)||void 0===e||null===(e=e.cover)||void 0===e?void 0:e.favorite_positions},getCurrentValue:t=>t.attributes.current_position,normalizeFavoritePositions:a.S,defaultFavoritePositions:n.Et,setPositionService:"set_cover_position",serviceDataKey:"position",setPositionLabelKey:"ui.dialogs.more_info_control.cover.favorite_position.set",featureLabelKey:"ui.panel.lovelace.editor.features.types.cover-position-favorite.label"},h=(t,e)=>(0,r.s)(t,e,l);class d extends r.N{get _definition(){return l}static getStubConfig(){return{type:"cover-position-favorite"}}}d.getConfigElement=c.C,d=(0,o.Cg)([(0,s.EM)("hui-cover-position-favorite-card-feature")],d)},19300:function(t,e,i){i.d(e,{l:function(){return v}});i(16280);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=i(82286),c=(i(48374),i(28624),i(67094),i(98079)),l=i(49908);let h,d,u,_,p=t=>t;const v=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"cover"===(0,a.m)(i.entity_id)&&((0,r.$)(i,c.Jp.OPEN_TILT)||(0,r.$)(i,c.Jp.CLOSE_TILT))};class g extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"cover-tilt"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_onOpenTap(t){t.stopPropagation(),this.hass.callService("cover","open_cover_tilt",{entity_id:this._stateObj.entity_id})}_onCloseTap(t){t.stopPropagation(),this.hass.callService("cover","close_cover_tilt",{entity_id:this._stateObj.entity_id})}_onStopTap(t){t.stopPropagation(),this.hass.callService("cover","stop_cover_tilt",{entity_id:this._stateObj.entity_id})}render(){return this._config&&this.hass&&this.context&&this._stateObj&&v(this.hass,this.context)?(0,s.qy)(h||(h=p` <ha-control-button-group> ${0} ${0} ${0} </ha-control-button-group> `),(0,r.$)(this._stateObj,c.Jp.OPEN_TILT)?(0,s.qy)(d||(d=p` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.cover.open_tilt_cover"),this._onOpenTap,!(0,c.uB)(this._stateObj),"M5,17.59L15.59,7H9V5H19V15H17V8.41L6.41,19L5,17.59Z"):s.s6,(0,r.$)(this._stateObj,c.Jp.STOP_TILT)?(0,s.qy)(u||(u=p` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.cover.stop_cover"),this._onStopTap,!(0,c.UE)(this._stateObj),"M18,18H6V6H18V18Z"):s.s6,(0,r.$)(this._stateObj,c.Jp.CLOSE_TILT)?(0,s.qy)(_||(_=p` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.cover.close_tilt_cover"),this._onCloseTap,!(0,c.Yx)(this._stateObj),"M19,6.41L17.59,5L7,15.59V9H5V19H15V17H8.41L19,6.41Z"):s.s6):s.s6}static get styles(){return l.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),g=(0,o.Cg)([(0,n.EM)("hui-cover-tilt-card-feature")],g)},57251:function(t,e,i){i.d(e,{x:function(){return h}});var o=i(40445),s=i(67576),n=i(98079),a=i(84337),r=i(55719),c=i(32181);const l={domain:"cover",supportsPosition:n.Av,getFavoritePositions:t=>{var e;return null==t||null===(e=t.options)||void 0===e||null===(e=e.cover)||void 0===e?void 0:e.favorite_tilt_positions},getCurrentValue:t=>t.attributes.current_tilt_position,normalizeFavoritePositions:a.S,defaultFavoritePositions:n.Et,setPositionService:"set_cover_tilt_position",serviceDataKey:"tilt_position",setPositionLabelKey:"ui.dialogs.more_info_control.cover.favorite_tilt_position.set",featureLabelKey:"ui.panel.lovelace.editor.features.types.cover-tilt-favorite.label"},h=(t,e)=>(0,r.s)(t,e,l);class d extends r.N{get _definition(){return l}static getStubConfig(){return{type:"cover-tilt-favorite"}}}d.getConfigElement=c.C,d=(0,o.Cg)([(0,s.EM)("hui-cover-tilt-favorite-card-feature")],d)},35598:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{C:function(){return w}});i(16280);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(78870),l=i(53610),h=i(71727),d=i(52658),u=i(98079),_=i(22675),p=i(88827),v=i(20380),g=i(49908),f=t([v,l,p]);[v,l,p]=f.then?(await f)():f;let b,y,m=t=>t;const C=(0,v.X)(),w=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"cover"===(0,h.m)(i.entity_id)&&(0,u.Av)(i)};class x extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"cover-tilt-position"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&w(this.hass,this.context)))return n.s6;const e=null!==(t=this._stateObj.attributes.current_tilt_position)&&void 0!==t?t:0,i=Math.max(Math.round(e),0),o=(0,d.Se)(this._stateObj,"open"),s={"--feature-color":this.color?(0,c.MP)(this.color):(0,d.Se)(this._stateObj),"--state-cover-inactive-color":o};return(0,n.qy)(b||(b=m` <ha-control-slider style="${0}" .value="${0}" min="0" max="100" mode="cursor" inverted @value-changed="${0}" .label="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"> <div slot="background" class="gradient"></div></ha-control-slider> `),(0,r.W)(s),i,this._valueChanged,(0,l.computeAttributeNameDisplay)(this.hass.localize,this._stateObj,this.hass.entities,"current_tilt_position"),this._stateObj.state===_.Hh,p.rM.cover.current_tilt_position,this.hass.locale)}_valueChanged(t){const{value:e}=t.detail;"number"!=typeof e||isNaN(e)||this.hass.callService("cover","set_cover_tilt_position",{entity_id:this._stateObj.entity_id,tilt_position:e})}static get styles(){return[g.T,(0,n.AH)(y||(y=m`.gradient{background:-webkit-linear-gradient(left,${0});opacity:.6}`),C)]}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"context",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"color",void 0),(0,s.Cg)([(0,a.wk)()],x.prototype,"_config",void 0),x=(0,s.Cg)([(0,a.EM)("hui-cover-tilt-position-card-feature")],x),o()}catch(b){o(b)}})},58500:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{Z:function(){return g}});i(16280),i(74423),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(380),c=i(1087),l=i(71727),h=(i(48374),i(28624),i(10223)),d=i(49908),u=t([h,r]);[h,r]=u.then?(await u)():u;let _,p=t=>t;const v=()=>Promise.all([i.e(80827),i.e(17481)]).then(i.bind(i,64080)),g=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;const o=(0,l.m)(i.entity_id);return"input_datetime"===o&&i.attributes.has_date||["datetime","date"].includes(o)};class f extends n.WF{get _stateObj(){var t;if(this.hass&&this.context&&this.context.entity_id)return null!==(t=this.hass.states[this.context.entity_id])&&void 0!==t?t:void 0}_pressButton(t){this.hass&&this._stateObj&&(0,c.r)(this,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:v,dialogAnchor:t.currentTarget,dialogParams:{min:"1970-01-01",value:this._stateObj.state,onChange:t=>this._dateChanged(t),locale:this.hass.locale.language,firstWeekday:(0,r.P)(this.hass.locale)}})}_dateChanged(t){if(!this.hass||!this._stateObj||!t)return;const e=(0,l.m)(this._stateObj.entity_id),i="input_datetime"===e?"set_datetime":"set_value";if("datetime"===e){const o=new Date(this._stateObj.state),s=new Date(`${t}T00:00:00`);o.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),this.hass.callService(e,i,{entity_id:this._stateObj.entity_id,datetime:o.toISOString()})}else this.hass.callService(e,i,{entity_id:this._stateObj.entity_id,date:t})}static getStubConfig(){return{type:"date-set"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){return this._config&&this.hass&&this.context&&this._stateObj&&g(this.hass,this.context)?(0,n.qy)(_||(_=p` <ha-control-button-group> <ha-control-button .disabled="${0}" class="press-button" @click="${0}"> ${0} </ha-control-button> </ha-control-button-group> `),["unavailable","unknown"].includes(this._stateObj.state),this._pressButton,this.hass.localize("ui.card.date.set_date")):n.s6}}f.styles=d.T,(0,s.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"context",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"color",void 0),(0,s.Cg)([(0,a.wk)()],f.prototype,"_config",void 0),f=(0,s.Cg)([(0,a.EM)("hui-date-set-card-feature")],f),o()}catch(_){o(_)}})},44772:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{n:function(){return u}});i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(84097),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d=["forward","reverse"],u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"fan"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.ZS.DIRECTION)};class _ extends l.n{static getStubConfig(){return{type:"fan-direction"}}_getOptions(){return this.hass?d.map(t=>({value:t,label:this.hass.localize(`ui.card.fan.${t}`)})):[]}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="direction",this._modesAttribute="direction",this._serviceDomain="fan",this._serviceAction="set_direction",this._defaultStyle="icons"}}_=(0,s.Cg)([(0,n.EM)("hui-fan-direction-card-feature")],_),o()}catch(d){o(d)}})},44577:function(t,e,i){i.d(e,{G:function(){return v}});i(16280),i(3362);var o=i(40445),s=i(5124),n=i(67576),a=i(89784),r=i(71727),c=i(52658),l=i(82286),h=(i(43958),i(22675)),d=i(84097),u=i(49908);let _,p=t=>t;const v=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"fan"===(0,r.m)(i.entity_id)&&(0,l.$)(i,d.ZS.OSCILLATE)};class g extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"fan-oscillate"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){if((t.has("hass")||t.has("context"))&&this._stateObj){const e=t.get("hass");(null==e?void 0:e.states[this.context.entity_id])!==this._stateObj&&(this._oscillate=this._stateObj.attributes.oscillating)}}async _valueChanged(t){const e="yes"===t.detail.value;if(e===this._stateObj.attributes.oscillating)return;const i=this._stateObj.attributes.oscillating;this._oscillate=e;try{await this._updateOscillate(e)}catch(o){this._oscillate=i}}async _updateOscillate(t){await this.hass.callService("fan","oscillate",{entity_id:this._stateObj.entity_id,oscillating:t})}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&v(this.hass,this.context)))return null;const t=(0,c.Se)(this._stateObj),e=["no","yes"].map(t=>({value:t,label:this.hass.localize(`ui.common.${t}`),path:"yes"===t?"M6 14H9L5 18L1 14H4C4 11.3 5.7 6.6 11 6.1V8.1C7.6 8.6 6 11.9 6 14M20 14C20 11.3 18.3 6.6 13 6.1V8.1C16.4 8.7 18 11.9 18 14H15L19 18L23 14H20Z":"M13 8.1V6.1C18.3 6.6 20 11.4 20 14H23L20.1 16.9L17.2 14H18C18 11.9 16.4 8.6 13 8.1M7.8 7.1L2.4 1.7L1.1 3L6.3 8.2C4.7 10 4 12.4 4 14H1L5 18L9 14H6C6 12.7 6.6 11 7.9 9.7L20.9 22.7L22.2 21.4L9.3 8.7L7.8 7.1M11 6.1L9.5 6.4L11 7.8V6.1Z"}));return(0,s.qy)(_||(_=p` <ha-control-select .options="${0}" .value="${0}" @value-changed="${0}" hide-option-label .label="${0}" style="${0}" .disabled="${0}"> </ha-control-select> `),e,this._oscillate?"yes":"no",this._valueChanged,this.hass.localize("ui.card.fan.oscillate"),(0,a.W)({"--control-select-color":t}),this._stateObj.state===h.Hh)}static get styles(){return u.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_oscillate",void 0),g=(0,o.Cg)([(0,n.EM)("hui-fan-oscillate-card-feature")],g)},5817:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{r:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(84097),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"fan"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.ZS.PRESET_MODE)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.preset_modes}static getStubConfig(){return{type:"fan-preset-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(20196).then(i.bind(i,97999)),document.createElement("hui-fan-preset-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="preset_mode",this._modesAttribute="preset_modes",this._dropdownIconPath=d,this._serviceDomain="fan",this._serviceAction="set_preset_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-fan-preset-modes-card-feature")],_),o()}catch(d){o(d)}})},13028:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{J:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(84610),l=i(48555),h=t([l]);l=(h.then?(await h)():h)[0];const d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z",u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"humidifier"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.ye.MODES)};class _ extends l.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.modes}static getStubConfig(){return{type:"humidifier-modes",style:"dropdown"}}static async getConfigElement(){return await i.e(22893).then(i.bind(i,89148)),document.createElement("hui-humidifier-modes-card-feature-editor")}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="mode",this._modesAttribute="available_modes",this._dropdownIconPath=d,this._serviceDomain="humidifier",this._serviceAction="set_mode"}}_=(0,s.Cg)([(0,n.EM)("hui-humidifier-modes-card-feature")],_),o()}catch(d){o(d)}})},30277:function(t,e,i){i.d(e,{R:function(){return _}});i(16280),i(3362);var o=i(40445),s=i(5124),n=i(67576),a=i(89784),r=i(71727),c=i(52658),l=(i(43958),i(22675)),h=i(49908);let d,u=t=>t;const _=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"humidifier"===(0,r.m)(i.entity_id)};class p extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"humidifier-toggle"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){if(super.willUpdate(t),(t.has("hass")||t.has("context"))&&this._stateObj){const e=t.get("hass");(null==e?void 0:e.states[this.context.entity_id])!==this._stateObj&&(this._currentState=this._stateObj.state)}}async _valueChanged(t){const e=t.detail.value;if(e===this._stateObj.state)return;const i=this._stateObj.state;this._currentState=e;try{await this._setState(e)}catch(o){this._currentState=i}}async _setState(t){await this.hass.callService("humidifier","on"===t?"turn_on":"turn_off",{entity_id:this._stateObj.entity_id})}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&_(this.hass,this.context)))return null;const t=(0,c.Se)(this._stateObj),e=["off","on"].map(t=>({value:t,label:this.hass.formatEntityState(this._stateObj,t),path:"on"===t?"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z":"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13"}));return(0,s.qy)(d||(d=u` <ha-control-select .options="${0}" .value="${0}" @value-changed="${0}" hide-option-label .label="${0}" style="${0}" .disabled="${0}"> </ha-control-select> `),e,this._currentState,this._valueChanged,this.hass.localize("ui.card.humidifier.state"),(0,a.W)({"--control-select-color":t}),this._stateObj.state===l.Hh)}static get styles(){return h.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],p.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)()],p.prototype,"_currentState",void 0),p=(0,o.Cg)([(0,n.EM)("hui-humidifier-toggle-card-feature")],p)},38409:function(t,e,i){i.d(e,{ED:function(){return b},Gw:function(){return g}});i(16280),i(18111),i(22489),i(61701),i(13579),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=i(82286),c=(i(48374),i(28624),i(67094),i(22675)),l=i(22865),h=i(49908),d=i(37531);let u,_,p=t=>t;const v={start_pause:[l.mB.PAUSE,l.mB.START_MOWING],dock:[l.mB.DOCK]},g=(t,e)=>v[e].some(e=>(0,r.$)(t,e)),f={start_pause:t=>"mowing"===t.state&&(0,r.$)(t,l.mB.PAUSE)?{translationKey:"pause",icon:"M14,19H18V5H14M6,19H10V5H6V19Z",serviceName:"pause"}:{translationKey:"start",icon:"M8,5.14V19.14L19,12.14L8,5.14Z",serviceName:"start_mowing"},dock:t=>({translationKey:"dock",icon:"M15 13L11 17V14H2V12H11V9L15 13M5 20V16H7V18H17V10.19L12 5.69L7.21 10H4.22L12 3L22 12H19V20H5Z",serviceName:"dock",disabled:!(0,l.gK)(t)})},b=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"lawn_mower"===(0,a.m)(i.entity_id)&&d.Ry.some(t=>g(i,t))};class y extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"lawn-mower-commands"}}static async getConfigElement(){return await i.e(88532).then(i.bind(i,22303)),document.createElement("hui-lawn-mower-commands-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_onCommandTap(t){t.stopPropagation();const e=t.target.entry;this.hass.callService("lawn_mower",e.serviceName,{entity_id:this._stateObj.entity_id})}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&b(this.hass,this.context)))return s.s6;const e=this._stateObj,i=null!==(t=this._config.commands)&&void 0!==t?t:d.Ry;return(0,s.qy)(u||(u=p` <ha-control-button-group> ${0} </ha-control-button-group> `),i.filter(t=>g(e,t)).map(t=>{const i=f[t](e);return(0,s.qy)(_||(_=p` <ha-control-button .entry="${0}" .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),i,this.hass.localize(`ui.dialogs.more_info_control.lawn_mower.${i.translationKey}`),this._onCommandTap,i.disabled||e.state===c.Hh,i.icon)}))}static get styles(){return h.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],y.prototype,"_config",void 0),y=(0,o.Cg)([(0,n.EM)("hui-lawn-mower-commands-card-feature")],y)},74049:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{F:function(){return w}});i(16280),i(18111),i(20116),i(61701),i(62953);var s=i(40445),n=i(88696),a=i(5124),r=i(67576),c=i(71727),l=i(22675),h=i(57264),d=i(49908),u=i(59241),_=(i(1966),i(19037)),p=i(32181),v=t([n]);n=(v.then?(await v)():v)[0];let g,f,b,y=t=>t;const m=8,C=32,w=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"light"===(0,c.m)(i.entity_id)&&(0,h.n6)(i)};class x extends a.WF{connectedCallback(){super.connectedCallback(),this._subscribeEntityEntry()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeEntityRegistry()}_unsubscribeEntityRegistry(){this._unsubEntityRegistry&&(this._unsubEntityRegistry(),this._unsubEntityRegistry=void 0)}_subscribeEntityEntry(){var t;if(this.hass&&null!==(t=this.context)&&void 0!==t&&t.entity_id){const t=this.context.entity_id;try{this._unsubEntityRegistry=(0,u.Bz)(this.hass.connection,e=>{const i=e.find(e=>e.entity_id===t);i&&(this._entry=i)})}catch(e){this._entry=null}}}get _maxVisible(){var t;return null!==(t=this._resizeController.value)&&void 0!==t?t:0}get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}updated(t){var e;(t.has("context")&&(this._unsubscribeEntityRegistry(),this._subscribeEntityEntry()),t.has("_entry"))&&(null!==(e=this._entry)&&void 0!==e&&null!==(e=e.options)&&void 0!==e&&null!==(e=e.light)&&void 0!==e&&e.favorite_colors?this._favoriteColors=this._entry.options.light.favorite_colors:this._entry&&this._stateObj?this._favoriteColors=(0,h.F9)(this._stateObj):this._favoriteColors=[])}static getStubConfig(){return{type:"light-color-favorites"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&w(this.hass,this.context)))return a.s6;const t=this._favoriteColors.slice(0,this._maxVisible);return(0,a.qy)(g||(g=y` <div class="container"> ${0} </div> `),t.map((t,e)=>(0,a.qy)(f||(f=y` <ha-favorite-color-button .label="${0}" .disabled="${0}" .color="${0}" .index="${0}" .actionHandler="${0}" @action="${0}"> </ha-favorite-color-button> `),this.hass.localize("ui.dialogs.more_info_control.light.favorite_color.set",{number:e}),this._stateObj.state===l.Hh,t,e,(0,_.T)({disabled:this._stateObj.state===l.Hh}),this._handleColorAction)))}_handleColorAction(t){t.stopPropagation();const e=t.target.index,i=this._favoriteColors[e];this.hass.callService("light","turn_on",Object.assign({entity_id:this._stateObj.entity_id},i))}static get styles(){return[d.T,(0,a.AH)(b||(b=y`:host{display:block;--min-width:${0}px;--gap:${0}px}.container{position:relative;display:flex;user-select:none;flex-wrap:nowrap;align-items:center;gap:var(--gap);height:var(--feature-height)}ha-favorite-color-button{--ha-favorite-color-button-border-radius:var(--feature-border-radius);height:100%;min-width:var(--min-width);width:100%;flex:1 1 var(--min-width)}`),(0,a.iz)(C),(0,a.iz)(m))]}constructor(...t){super(...t),this._favoriteColors=[],this._resizeController=new n.P(this,{callback:t=>{var e;const i=null===(e=t[0])||void 0===e?void 0:e.contentRect.width;return i?Math.floor((i+m)/(C+m)):0}})}}x.getConfigElement=p.C,(0,s.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"context",void 0),(0,s.Cg)([(0,r.wk)()],x.prototype,"_config",void 0),(0,s.Cg)([(0,r.wk)()],x.prototype,"_entry",void 0),(0,s.Cg)([(0,r.wk)()],x.prototype,"_favoriteColors",void 0),x=(0,s.Cg)([(0,r.EM)("hui-light-color-favorites-card-feature")],x),o()}catch(g){o(g)}})},67142:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{a:function(){return C}});i(16280),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(22786),l=(i(16629),i(71727)),h=i(47129),d=i(10223),u=i(22675),_=i(88827),p=i(57264),v=i(68737),g=i(49908),f=t([d,_,v]);[d,_,v]=f.then?(await f)():f;let b,y,m=t=>t;const C=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"light"===(0,l.m)(i.entity_id)&&(0,p.ti)(i,p.NC.COLOR_TEMP)};class w extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"light-color-temp"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t,e;if(!(this._config&&this.hass&&this.context&&this._stateObj&&C(this.hass,this.context)))return n.s6;const i=null!=this._stateObj.attributes.color_temp_kelvin?this._stateObj.attributes.color_temp_kelvin:void 0,o=null!==(t=this._stateObj.attributes.min_color_temp_kelvin)&&void 0!==t?t:2700,s=null!==(e=this._stateObj.attributes.max_color_temp_kelvin)&&void 0!==e?e:6500,a=this._generateTemperatureGradient(o,s);return(0,n.qy)(b||(b=m` <ha-control-slider .value="${0}" mode="cursor" .showHandle="${0}" .disabled="${0}" @value-changed="${0}" .label="${0}" .min="${0}" .max="${0}" style="${0}" .unit="${0}" .locale="${0}"></ha-control-slider> `),i,(0,h.a)(this._stateObj),this._stateObj.state===u.Hh,this._valueChanged,this.hass.localize("ui.card.light.color_temperature"),o,s,(0,r.W)({"--gradient":a}),_.rM.light.color_temp_kelvin,this.hass.locale)}_valueChanged(t){t.stopPropagation();const e=t.detail.value;this.hass.callService("light","turn_on",{entity_id:this._stateObj.entity_id,color_temp_kelvin:e})}static get styles(){return[g.T,(0,n.AH)(y||(y=m`ha-control-slider{--control-slider-background:-webkit-linear-gradient(
            left,
            var(--gradient)
          );--control-slider-background-opacity:1}`))]}constructor(...t){super(...t),this._generateTemperatureGradient=(0,c.A)((t,e)=>(0,v.J)(t,e))}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],w.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],w.prototype,"_config",void 0),w=(0,s.Cg)([(0,a.EM)("hui-light-color-temp-card-feature")],w),o()}catch(b){o(b)}})},14312:function(t,e,i){i.d(e,{o:function(){return v}});i(16280),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=i(82286),c=(i(48374),i(28624),i(55881)),l=i(49908);let h,d,u,_,p=t=>t;const v=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"lock"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.Z0.OPEN)};class g extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"lock-open-door"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_setButtonState(t,e){clearTimeout(this._buttonTimeout),this._buttonState=t,e&&(this._buttonTimeout=window.setTimeout(()=>{this._buttonState="normal"},1e3*e))}async _open(){"confirm"===this._buttonState?this.hass&&this._stateObj&&((0,c.hW)(this,this.hass,this._stateObj,"open"),this._setButtonState("done",2)):this._setButtonState("confirm",5)}render(){return this._config&&this.hass&&this.context&&this._stateObj&&v(this.hass,this.context)?(0,s.qy)(h||(h=p` ${0} `),"done"===this._buttonState?(0,s.qy)(d||(d=p` <p class="open-done"> <ha-svg-icon path="${0}"></ha-svg-icon> ${0} </p> `),"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",this.hass.localize("ui.card.lock.open_door_done")):(0,s.qy)(u||(u=p` <ha-control-button-group> <ha-control-button .disabled="${0}" class="open-button ${0}" @click="${0}"> ${0} </ha-control-button> </ha-control-button-group> `),!(0,c.pc)(this._stateObj),this._buttonState,this._open,"confirm"===this._buttonState?this.hass.localize("ui.card.lock.open_door_confirm"):this.hass.localize("ui.card.lock.open_door"))):s.s6}static get styles(){return[l.T,(0,s.AH)(_||(_=p`ha-control-button{font-size:var(--ha-font-size-m)}.open-button{width:130px}.open-button.confirm{--control-button-background-color:var(--warning-color)}.open-done{font-size:var(--ha-font-size-m);line-height:14px;display:flex;align-items:center;justify-content:center;flex-direction:row;gap:var(--ha-space-2);font-weight:var(--ha-font-weight-medium);color:var(--success-color);margin:0 12px 12px 12px;height:40px;text-align:center}`))]}constructor(...t){super(...t),this._buttonState="normal"}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_buttonState",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),g=(0,o.Cg)([(0,n.EM)("hui-lock-open-door-card-feature")],g)},29175:function(t,e,i){i.d(e,{L:function(){return C},U:function(){return m}});i(16280),i(44114),i(18111),i(22489),i(61701),i(13579),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=i(47129),c=i(82286),l=(i(48374),i(28624),i(22675)),h=i(53072),d=i(784),u=i(49908),_=i(37531);let p,v,g,f=t=>t;const b="M13,3H11V13H13V3M17.83,5.17L16.41,6.59C18.05,7.91 19,9.9 19,12A7,7 0 0,1 12,19C8.14,19 5,15.88 5,12C5,9.91 5.95,7.91 7.58,6.58L6.17,5.17C2.38,8.39 1.92,14.07 5.14,17.86C8.36,21.64 14.04,22.1 17.83,18.88C19.85,17.17 21,14.65 21,12C21,9.37 19.84,6.87 17.83,5.17Z",y={turn_on:[h.vj.TURN_ON],turn_off:[h.vj.TURN_OFF],media_play:[h.vj.PLAY],media_pause:[h.vj.PAUSE],media_play_pause:[h.vj.PLAY,h.vj.PAUSE],media_stop:[h.vj.STOP],media_previous_track:[h.vj.PREVIOUS_TRACK],media_next_track:[h.vj.NEXT_TRACK],volume_down:[h.vj.VOLUME_STEP],volume_up:[h.vj.VOLUME_STEP],volume_mute:[h.vj.VOLUME_MUTE],shuffle:[h.vj.SHUFFLE_SET],repeat:[h.vj.REPEAT_SET]},m=(t,e)=>y[e].some(e=>(0,c.$)(t,e)),C=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"media_player"===(0,a.m)(i.entity_id)};class w extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}get _controls(){var t;return null!==(t=this._config)&&void 0!==t&&null!==(t=t.controls)&&void 0!==t&&t.length?this._config.controls:[..._.mJ]}static getStubConfig(){return{type:"media-player-playback"}}static async getConfigElement(){return await i.e(1834).then(i.bind(i,93073)),document.createElement("hui-media-player-playback-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(){this.hasUpdated||this._measureCard()}shouldUpdate(t){var e;const i=t.get("hass"),o=null===(e=this.context)||void 0===e?void 0:e.entity_id;return(0,d.xP)(this,t)||t.has("hass")&&(!i||!o||i.states[o]!==this.hass.states[o])}render(){if(!(this._config&&this.hass&&this.context&&C(this.hass,this.context)&&this._stateObj))return s.s6;const t=this._computeButtons(this._stateObj);return(0,s.qy)(p||(p=f` <ha-control-button-group> ${0} </ha-control-button-group> `),t.map(t=>{var e;return(0,s.qy)(v||(v=f` <ha-control-button key="${0}" .label="${0}" @click="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),t.action,null===(e=this.hass)||void 0===e?void 0:e.localize(`ui.card.media_player.${t.action}`),this._action,t.icon)}))}_measureCard(){var t,e;if(!this.isConnected)return;const i=this.getRootNode().host,o=null!==(t=null!==(e=null==i?void 0:i.clientWidth)&&void 0!==e?e:this.clientWidth)&&void 0!==t?t:0;this._narrow=o<200}_computeButtons(t){var e,i;return null!==(e=this._config)&&void 0!==e&&null!==(e=e.controls)&&void 0!==e&&e.length?this._filterNarrow(this._computeExplicitButtons(t)):this._filterNarrow(null!==(i=(0,h.Un)(t))&&void 0!==i?i:[])}_computeExplicitButtons(t){const e=(0,r.a)(t),i=!0===t.attributes.assumed_state,o=[];for(const s of this._controls)switch(s){case"turn_off":(e||i)&&(0,c.$)(t,h.vj.TURN_OFF)&&o.push({icon:i?"M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19Z":b,action:"turn_off"});break;case"turn_on":e&&!i||t.state===l.Hh||!(0,c.$)(t,h.vj.TURN_ON)||o.push({icon:i?"M11,3H13V21H11V3Z":b,action:"turn_on"});break;case"media_play":(0,c.$)(t,h.vj.PLAY)&&o.push({icon:"M8,5.14V19.14L19,12.14L8,5.14Z",action:"media_play"});break;case"media_pause":(0,c.$)(t,h.vj.PAUSE)&&o.push({icon:"M14,19H18V5H14M6,19H10V5H6V19Z",action:"media_pause"});break;case"media_play_pause":((0,c.$)(t,h.vj.PLAY)||(0,c.$)(t,h.vj.PAUSE))&&o.push({icon:"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5",action:"media_play_pause"});break;case"media_stop":(0,c.$)(t,h.vj.STOP)&&o.push({icon:"M18,18H6V6H18V18Z",action:"media_stop"});break;case"media_previous_track":(0,c.$)(t,h.vj.PREVIOUS_TRACK)&&o.push({icon:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",action:"media_previous_track"});break;case"media_next_track":(0,c.$)(t,h.vj.NEXT_TRACK)&&o.push({icon:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",action:"media_next_track"});break;case"volume_down":(0,c.$)(t,h.vj.VOLUME_STEP)&&o.push({icon:"M3,9H7L12,4V20L7,15H3V9M14,11H22V13H14V11Z",action:"volume_down"});break;case"volume_up":(0,c.$)(t,h.vj.VOLUME_STEP)&&o.push({icon:"M3,9H7L12,4V20L7,15H3V9M14,11H17V8H19V11H22V13H19V16H17V13H14V11Z",action:"volume_up"});break;case"volume_mute":(0,c.$)(t,h.vj.VOLUME_MUTE)&&o.push({icon:t.attributes.is_volume_muted?"M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z":"M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z",action:"volume_mute"});break;case"shuffle":(0,c.$)(t,h.vj.SHUFFLE_SET)&&o.push({icon:!0===t.attributes.shuffle?"M14.83,13.41L13.42,14.82L16.55,17.95L14.5,20H20V14.5L17.96,16.54L14.83,13.41M14.5,4L16.54,6.04L4,18.59L5.41,20L17.96,7.46L20,9.5V4M10.59,9.17L5.41,4L4,5.41L9.17,10.58L10.59,9.17Z":"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",action:"shuffle"});break;case"repeat":(0,c.$)(t,h.vj.REPEAT_SET)&&o.push({icon:"all"===t.attributes.repeat?"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"one"===t.attributes.repeat?"M13,15V9H12L10,10V11H11.5V15M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"M2,5.27L3.28,4L20,20.72L18.73,22L15.73,19H7V22L3,18L7,14V17H13.73L7,10.27V11H5V8.27L2,5.27M17,13H19V17.18L17,15.18V13M17,5V2L21,6L17,10V7H8.82L6.82,5H17Z",action:"repeat"})}return o}_filterNarrow(t){return this._narrow&&t.length>3?t.filter(t=>"media_previous_track"!==t.action&&"media_next_track"!==t.action):t}_action(t){if(!this._stateObj)return;const e=t.currentTarget.getAttribute("key");if(e){if("media_play_pause"===e){const t="playing"!==this._stateObj.state?"media_play":(0,c.$)(this._stateObj,h.vj.PAUSE)?"media_pause":"media_stop";return void this.hass.callService("media_player",t,{entity_id:this._stateObj.entity_id})}if("volume_mute"!==e)if("shuffle"!==e){if("repeat"===e){var i;const t=null!==(i=this._stateObj.attributes.repeat)&&void 0!==i?i:"off";return void this.hass.callService("media_player","repeat_set",{entity_id:this._stateObj.entity_id,repeat:"off"===t?"one":"one"===t?"all":"off"})}this.hass.callService("media_player",e,{entity_id:this._stateObj.entity_id})}else this.hass.callService("media_player","shuffle_set",{entity_id:this._stateObj.entity_id,shuffle:!this._stateObj.attributes.shuffle});else this.hass.callService("media_player","volume_mute",{entity_id:this._stateObj.entity_id,is_volume_muted:!this._stateObj.attributes.is_volume_muted})}}constructor(...t){super(...t),this._narrow=!1}}w.styles=[u.T,(0,s.AH)(g||(g=f`ha-control-button-group{overflow:hidden}`))],(0,o.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"context",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"color",void 0),(0,o.Cg)([(0,n.wk)()],w.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)()],w.prototype,"_narrow",void 0),w=(0,o.Cg)([(0,n.EM)("hui-media-player-playback-card-feature")],w)},26671:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{u:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(53072),l=i(784),h=i(48555),d=t([h]);h=(d.then?(await d)():d)[0];const u=(t,e)=>{var i;const o=e.entity_id?t.states[e.entity_id]:void 0;if(!o)return!1;return"media_player"===(0,a.m)(o.entity_id)&&(0,r.$)(o,c.vj.SELECT_SOUND_MODE)&&!(null===(i=o.attributes.sound_mode_list)||void 0===i||!i.length)};class _ extends h.n{get _label(){return this.hass.localize("ui.card.media_player.sound_mode")}static getStubConfig(){return{type:"media-player-sound-mode"}}static async getConfigElement(){return await i.e(89890).then(i.bind(i,56121)),document.createElement("hui-media-player-sound-mode-card-feature-editor")}get _configuredModes(){var t;const e=null===(t=this._config)||void 0===t?void 0:t.sound_modes;return null!=e&&e.length?e:void 0}shouldUpdate(t){var e,i;const o=null===(e=this.context)||void 0===e?void 0:e.entity_id,s=t.get("hass");return t.has("_currentValue")||t.has("context")||(0,l.xP)(this,t)||t.has("hass")&&(!s||!o||s.states[o]!==(null===(i=this.hass)||void 0===i?void 0:i.states[o]))}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="sound_mode",this._modesAttribute="sound_mode_list",this._serviceDomain="media_player",this._serviceAction="select_sound_mode",this._hideLabel=!1,this._showDropdownOptionIcons=!1,this._allowIconsStyle=!1}}_=(0,s.Cg)([(0,n.EM)("hui-media-player-sound-mode-card-feature")],_),o()}catch(u){o(u)}})},61691:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{d:function(){return u}});i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(82286),c=i(53072),l=i(784),h=i(48555),d=t([h]);h=(d.then?(await d)():d)[0];const u=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"media_player"===(0,a.m)(i.entity_id)&&(0,r.$)(i,c.vj.SELECT_SOURCE)};class _ extends h.n{get _configuredModes(){var t;const e=null===(t=this._config)||void 0===t?void 0:t.sources;return null!=e&&e.length?e:void 0}get _label(){return this.hass.localize("ui.card.media_player.source")}static getStubConfig(){return{type:"media-player-source"}}static async getConfigElement(){return await i.e(16406).then(i.bind(i,53397)),document.createElement("hui-media-player-source-card-feature-editor")}shouldUpdate(t){var e,i;const o=null===(e=this.context)||void 0===e?void 0:e.entity_id,s=t.get("hass");return t.has("_currentValue")||t.has("context")||(0,l.xP)(this,t)||t.has("hass")&&(!s||!o||s.states[o]!==(null===(i=this.hass)||void 0===i?void 0:i.states[o]))}_isSupported(){return!!(this.hass&&this.context&&u(this.hass,this.context))}constructor(...t){super(...t),this._attribute="source",this._modesAttribute="source_list",this._serviceDomain="media_player",this._serviceAction="select_source",this._hideLabel=!1,this._showDropdownOptionIcons=!1,this._allowIconsStyle=!1}}_=(0,s.Cg)([(0,n.EM)("hui-media-player-source-card-feature")],_),o()}catch(u){o(u)}})},71982:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{X:function(){return y}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(82286),l=i(63004),h=i(46051),d=i(22675),u=i(53072),_=i(49908),p=i(22287),v=t([h]);h=(v.then?(await v)():v)[0];let g,f,b=t=>t;const y=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"media_player"===(0,r.m)(i.entity_id)&&(0,c.$)(i,u.vj.VOLUME_SET)};class m extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"media-player-volume-buttons",step:5}}static async getConfigElement(){return await i.e(88031).then(i.bind(i,17282)),document.createElement("hui-media-player-volume-buttons-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&y(this.hass,this.context)))return n.s6;const e=this._stateObj,i=e.state===d.Hh,o=null!=e.attributes.volume_level?Math.round(100*e.attributes.volume_level):void 0;return(0,n.qy)(g||(g=b` <ha-control-number-buttons .disabled="${0}" .locale="${0}" min="0" max="100" .step="${0}" .value="${0}" unit="%" @value-changed="${0}"></ha-control-number-buttons> ${0} `),i,this.hass.locale,null!==(t=this._config.step)&&void 0!==t?t:5,o,this._valueChanged,(0,p.U)(this.hass,e,this._config.show_mute_button,i,this._toggleMute))}_valueChanged(t){t.stopPropagation(),this.hass.callService("media_player","volume_set",{entity_id:this._stateObj.entity_id,volume_level:(0,l.q)(t.detail.value,0,100)/100})}static get styles(){return[_.T,(0,n.AH)(f||(f=b`:host{display:flex;flex-direction:row;gap:var(--feature-button-spacing)}ha-control-number-buttons{flex:1;min-width:0}.mute{width:var(--feature-height);height:var(--feature-height)}`))]}constructor(...t){super(...t),this._toggleMute=t=>{(0,p.d)(t,this.hass,this._stateObj,this)}}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_config",void 0),m=(0,s.Cg)([(0,a.EM)("hui-media-player-volume-buttons-card-feature")],m),o()}catch(g){o(g)}})},91282:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{R:function(){return y}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(47129),l=i(82286),h=i(10223),d=i(22675),u=i(53072),_=i(49908),p=i(22287),v=t([h]);h=(v.then?(await v)():v)[0];let g,f,b=t=>t;const y=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"media_player"===(0,r.m)(i.entity_id)&&(0,l.$)(i,u.vj.VOLUME_SET)};class m extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"media-player-volume-slider"}}static async getConfigElement(){return await i.e(87363).then(i.bind(i,12974)),document.createElement("hui-media-player-volume-slider-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&y(this.hass,this.context)))return n.s6;const t=this._stateObj,e=t.state===d.Hh,i=null!=t.attributes.volume_level?Math.round(100*t.attributes.volume_level):void 0;return(0,n.qy)(g||(g=b` <ha-control-slider .value="${0}" min="0" max="100" .showHandle="${0}" .disabled="${0}" @value-changed="${0}" unit="%" .locale="${0}"></ha-control-slider> ${0} `),i,(0,c.a)(t),e,this._valueChanged,this.hass.locale,(0,p.U)(this.hass,t,this._config.show_mute_button,e,this._toggleMute))}_valueChanged(t){t.stopPropagation();const e=t.detail.value;this.hass.callService("media_player","volume_set",{entity_id:this._stateObj.entity_id,volume_level:e/100})}static get styles(){return[_.T,(0,n.AH)(f||(f=b`:host{display:flex;flex-direction:row;gap:var(--feature-button-spacing)}ha-control-slider{flex:1;min-width:0}.mute{width:var(--feature-height);height:var(--feature-height)}`))]}constructor(...t){super(...t),this._toggleMute=t=>{(0,p.d)(t,this.hass,this._stateObj,this)}}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_config",void 0),m=(0,s.Cg)([(0,a.EM)("hui-media-player-volume-slider-card-feature")],m),o()}catch(g){o(g)}})},48555:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{n:function(){return m}});i(16280),i(18111),i(61701),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(36248),l=(i(43958),i(56048)),h=(i(67094),i(22675)),d=i(49908),u=i(98071),_=t([c,l]);[c,l]=_.then?(await _)():_;let p,v,g,f,b,y=t=>t;class m extends n.WF{get _configuredModes(){}get _label(){return this.hass.formatEntityAttributeName(this._stateObj,this._attribute)}get _controlSelectStyle(){}_getServiceDomain(t){return this._serviceDomain}_isValueValid(t,e){return!0}get _stateObj(){var t;if(this.hass&&null!==(t=this.context)&&void 0!==t&&t.entity_id)return this.hass.states[this.context.entity_id]}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){if(super.willUpdate(t),(t.has("hass")||t.has("context"))&&this._stateObj){var e;const i=t.get("hass");(null!==(e=this.context)&&void 0!==e&&e.entity_id?null==i?void 0:i.states[this.context.entity_id]:void 0)!==this._stateObj&&(this._currentValue=this._getValue(this._stateObj))}}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&this._isSupported()))return null;const t=this._stateObj,e=this._getOptions(),i=this._label;var o;return this._allowIconsStyle&&("icons"===this._config.style||void 0===this._config.style&&"icons"===this._defaultStyle)?(0,n.qy)(p||(p=y` <ha-control-select .options="${0}" .value="${0}" @value-changed="${0}" hide-option-label .label="${0}" style="${0}" .disabled="${0}"> </ha-control-select> `),e.map(t=>Object.assign(Object.assign({},t),{},{icon:this._renderOptionIcon(t)})),this._currentValue,this._valueChanged,i,(0,r.W)(null!==(o=this._controlSelectStyle)&&void 0!==o?o:{}),t.state===h.Hh):(0,n.qy)(v||(v=y` <ha-control-select-menu show-arrow ?hide-label="${0}" .label="${0}" .value="${0}" .disabled="${0}" @wa-select="${0}" .options="${0}" .renderIcon="${0}"> ${0} </ha-control-select-menu> `),this._hideLabel,i,this._currentValue,t.state===h.Hh,this._valueChanged,e,this._showDropdownOptionIcons?this._renderMenuIcon:void 0,this._dropdownIconPath?(0,n.qy)(g||(g=y`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),this._dropdownIconPath):n.s6)}_getValue(t){return t.attributes[this._attribute]}_getOptions(){return this._stateObj&&this.hass?(0,u.P)(this._stateObj.attributes[this._modesAttribute],this._configuredModes).map(t=>({value:t,label:this.hass.formatEntityAttributeValue(this._stateObj,this._attribute,t)})):[]}_renderOptionIcon(t){return(0,n.qy)(f||(f=y`<ha-attribute-icon slot="graphic" .hass="${0}" .stateObj="${0}" .attribute="${0}" .attributeValue="${0}"></ha-attribute-icon>`),this.hass,this._stateObj,this._attribute,t.value)}async _valueChanged(t){var e,i;if(!this.hass||!this._stateObj)return;const o=null!==(e=t.detail.value)&&void 0!==e?e:null===(i=t.detail.item)||void 0===i?void 0:i.value,s=this._getValue(this._stateObj);if(o!==s&&o&&this._isValueValid(o,this._stateObj)){this._currentValue=o;try{await this.hass.callService(this._getServiceDomain(this._stateObj),this._serviceAction,{entity_id:this._stateObj.entity_id,[this._attribute]:o})}catch(n){this._currentValue=s}}}static get styles(){return d.T}constructor(...t){super(...t),this._hideLabel=!0,this._showDropdownOptionIcons=!0,this._allowIconsStyle=!0,this._defaultStyle="dropdown",this._renderMenuIcon=t=>(0,n.qy)(b||(b=y`<ha-attribute-icon .hass="${0}" .stateObj="${0}" .attribute="${0}" .attributeValue="${0}"></ha-attribute-icon>`),this.hass,this._stateObj,this._attribute,t)}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_config",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_currentValue",void 0),o()}catch(p){o(p)}})},55719:function(t,e,i){i.d(e,{N:function(){return g},s:function(){return v}});i(16280),i(18111),i(61701),i(13579),i(3362);var o=i(40445),s=i(5124),n=i(67576),a=i(89784),r=i(78870),c=i(71727),l=i(52658),h=(i(43958),i(22675)),d=i(59241),u=i(49908);let _,p=t=>t;const v=(t,e,i)=>{const o=e.entity_id?t.states[e.entity_id]:void 0;return!!o&&((0,c.m)(o.entity_id)===i.domain&&i.supportsPosition(o))};class g extends s.WF{get _stateObj(){var t;if(this.hass&&null!==(t=this.context)&&void 0!==t&&t.entity_id)return this.hass.states[this.context.entity_id]}connectedCallback(){super.connectedCallback(),this._refreshEntitySubscription()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeEntityRegistry()}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){var e,i,o,s;if(super.willUpdate(t),(t.has("hass")||t.has("context"))&&this._stateObj){var n;const e=t.get("hass");(null!==(n=this.context)&&void 0!==n&&n.entity_id?null==e?void 0:e.states[this.context.entity_id]:void 0)!==this._stateObj&&(this._currentPosition=this._definition.getCurrentValue(this._stateObj))}t.has("context")&&(null===(e=t.get("context"))||void 0===e?void 0:e.entity_id)!==(null===(i=this.context)||void 0===i?void 0:i.entity_id)&&this._refreshEntitySubscription(),t.has("hass")&&(null===(o=t.get("hass"))||void 0===o?void 0:o.connection)!==(null===(s=this.hass)||void 0===s?void 0:s.connection)&&this._refreshEntitySubscription()}_refreshEntitySubscription(){this._ensureEntitySubscription().catch(()=>{})}_unsubscribeEntityRegistry(){this._unsubEntityRegistry&&(this._unsubEntityRegistry(),this._unsubEntityRegistry=void 0)}async _loadEntityEntry(t){if(this.hass)try{var e;const i=await(0,d.v)(this.hass,t);(null===(e=this.context)||void 0===e?void 0:e.entity_id)===t&&(this._entry=i)}catch(o){var i;(null===(i=this.context)||void 0===i?void 0:i.entity_id)===t&&(this._entry=null)}}async _subscribeEntityEntry(t){this._unsubscribeEntityRegistry(),await this._loadEntityEntry(t);try{this._unsubEntityRegistry=(0,d.Bz)(this.hass.connection,async e=>{var i;(null===(i=this.context)||void 0===i?void 0:i.entity_id)===t&&(e.some(e=>e.entity_id===t)?await this._loadEntityEntry(t):this._entry=null)})}catch(e){this._unsubEntityRegistry=void 0}}async _ensureEntitySubscription(){var t,e;const i=null===(t=this.context)||void 0===t?void 0:t.entity_id,o=null===(e=this.hass)||void 0===e?void 0:e.connection;if(!this.hass||!i||!o)return this._unsubscribeEntityRegistry(),this._subscribedEntityId=void 0,this._subscribedConnection=void 0,void(this._entry=void 0);this._subscribedEntityId===i&&this._subscribedConnection===o&&this._unsubEntityRegistry||(this._subscribedEntityId=i,this._subscribedConnection=o,await this._subscribeEntityEntry(i))}async _valueChanged(t){const e=t.detail.value;if(null==e||!this.hass||!this._stateObj)return;const i=Number(e);if(isNaN(i))return;const o=this._definition.getCurrentValue(this._stateObj);if(i!==o){this._currentPosition=i;try{await this.hass.callService(this._definition.domain,this._definition.setPositionService,{entity_id:this._stateObj.entity_id,[this._definition.serviceDataKey]:i})}catch(s){this._currentPosition=o}}}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&v(this.hass,this.context,this._definition)))return null;const e=this._definition.normalizeFavoritePositions(null!==(t=this._definition.getFavoritePositions(this._entry))&&void 0!==t?t:this._definition.defaultFavoritePositions),i=this.hass;if(0===e.length||!i)return null;const o=e.map(t=>({value:String(t),label:`${t}%`,ariaLabel:i.localize(this._definition.setPositionLabelKey,{value:`${t}%`})})),n=null!=this._currentPosition?String(this._currentPosition):void 0,c=this.color?(0,r.MP)(this.color):(0,l.Se)(this._stateObj);return(0,s.qy)(_||(_=p` <ha-control-select style="${0}" .options="${0}" .value="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"> </ha-control-select> `),(0,a.W)({"--feature-color":c}),o,n,this._valueChanged,i.localize(this._definition.featureLabelKey),this._stateObj.state===h.Hh)}static get styles(){return u.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"color",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_entry",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_currentPosition",void 0)},73269:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{Q:function(){return g}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=(i(48374),i(28624),i(46051)),l=i(10223),h=(i(47680),i(22675)),d=i(49908),u=t([c,l]);[c,l]=u.then?(await u)():u;let _,p,v=t=>t;const g=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;const o=(0,r.m)(i.entity_id);return"input_number"===o||"number"===o};class f extends n.WF{static getStubConfig(){return{type:"numeric-input",style:"buttons"}}get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static async getConfigElement(){return await i.e(67816).then(i.bind(i,28955)),document.createElement("hui-numeric-input-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){if(super.willUpdate(t),(t.has("hass")||t.has("context"))&&this._stateObj){const e=t.get("hass");(null==e?void 0:e.states[this.context.entity_id])!==this._stateObj&&(this._currentState=this._stateObj.state)}}async _setValue(t){const e=this._stateObj,i=(0,r.m)(e.entity_id);await this.hass.callService(i,"set_value",{entity_id:e.entity_id,value:t.detail.value})}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&g(this.hass,this.context)))return n.s6;const t=this._stateObj,e=Number(t.state),i=isNaN(e)?void 0:e;return"buttons"===this._config.style?(0,n.qy)(_||(_=v` <ha-control-number-buttons .value="${0}" .min="${0}" .max="${0}" .step="${0}" @value-changed="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"></ha-control-number-buttons> `),i,t.attributes.min,t.attributes.max,t.attributes.step,this._setValue,t.state===h.Hh,t.attributes.unit_of_measurement,this.hass.locale):(0,n.qy)(p||(p=v` <ha-control-slider .value="${0}" .min="${0}" .max="${0}" .step="${0}" @value-changed="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"></ha-control-slider> `),i,t.attributes.min,t.attributes.max,t.attributes.step,this._setValue,t.state===h.Hh,t.attributes.unit_of_measurement,this.hass.locale)}static get styles(){return d.T}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],f.prototype,"_config",void 0),(0,s.Cg)([(0,a.wk)()],f.prototype,"_currentState",void 0),f=(0,s.Cg)([(0,a.EM)("hui-numeric-input-card-feature")],f),o()}catch(_){o(_)}})},14501:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{t:function(){return q}});i(16280),i(44114),i(18111),i(61701),i(3362),i(62953);var s=i(40445),n=i(35211),a=i(88696),r=i(5124),c=i(67576),l=i(6412),h=i(78870),d=(i(46190),i(93421)),u=i(32172),_=i(65829),p=i(22792),v=i(43248),g=i(70565),f=i(18696),b=t([_,a,f]);[_,a,f]=b.then?(await b)():b;let y,m,C,w,x,$,M,O,H,k,A,j,V,E=t=>t;const L=16,S=(t,e,i,o,s)=>{const n=Math.max(0,Math.min(s,i/2,o));return`M ${t},${e+n} a ${n},${n} 0 0 1 ${n},${-n} h ${i-2*n} a ${n},${n} 0 0 1 ${n},${n} v ${o-n} h ${-i} z`},q=(t,e)=>(0,g._W)(e.entity_id?t.states[e.entity_id]:void 0);class Z extends r.WF{static getStubConfig(){return{type:"precipitation-forecast"}}static async getConfigElement(){return await i.e(4619).then(i.bind(i,15065)),document.createElement("hui-precipitation-forecast-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._subscribeForecast()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeForecast()}firstUpdated(){this._subscribeForecast()}updated(t){this._shouldResubscribe(t)&&(this._unsubscribeForecast(),this._subscribeForecast())}_shouldResubscribe(t){if(t.has("context")){var e;const i=t.get("context");if((null==i?void 0:i.entity_id)!==(null===(e=this.context)||void 0===e?void 0:e.entity_id))return!0}return!(!t.has("_config")||this._resolvedForecastType()===this._subscribedType)}_referenceMaxAmount(){const t=!(!this._hassConfig||!this._stateObj)&&"in"===(0,v.d9)(this._hassConfig,this._stateObj,"precipitation");switch(this._subscribedType){case"hourly":return t?.1:2.5;case"twice_daily":return t?.25:6;default:return t?.4:10}}_resolvedForecastType(){var t;return(0,g.Sg)(this._stateObj,null===(t=this._config)||void 0===t?void 0:t.forecast_type)}get _showLabels(){var t;return!1!==(null===(t=this._config)||void 0===t?void 0:t.show_labels)}render(){var t,e;if(!this._config||!this.context||!(0,g._W)(this._stateObj))return r.s6;if(this._error)return(0,r.qy)(y||(y=E` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.failed_to_load",{error:this._error}));if(!this._forecast)return(0,r.qy)(m||(m=E` <div class="container loading"> <ha-spinner size="small"></ha-spinner> </div> `));const i="hourly"===this._subscribedType,o=null!==(t=this._config.precipitation_type)&&void 0!==t?t:"amount",s=this._config.color?(0,h.MP)(this._config.color):void 0,n=null!=s?s:"var(--state-weather-rainy-color)",a=(0,l.H)({container:!0,"with-labels":this._showLabels});if(i){var c;const t=this._renderHourlyBars(o,n);if(!t)return(0,r.qy)(C||(C=E` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.no_forecast"));const e=null!==(c=this._config.hours_to_show)&&void 0!==c?c:24;return(0,r.qy)(w||(w=E` <div class="${0}"> <div class="bars">${0}</div> ${0} </div> `),a,t,this._showLabels&&this._locale?(0,f.qO)(e,this._locale):r.s6)}const d=null!==(e=this._config.days_to_show)&&void 0!==e?e:7,u="twice_daily"===this._subscribedType?2:1,_=this._forecast.slice(0,d*u);return _.length?(0,r.qy)($||($=E` <div class="${0}"> <div class="bars"> ${0} </div> ${0} </div> `),a,this._renderDailyBars(_,o,n),this._showLabels&&this._locale?(0,f.Is)(_,u,this._locale):r.s6):(0,r.qy)(x||(x=E` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.precipitation-forecast.no_forecast"))}_renderDailyBars(t,e,i){var o,s;const n=(null===(o=this._size.value)||void 0===o?void 0:o.width)||this.clientWidth,a=(null===(s=this._size.value)||void 0===s?void 0:s.height)||this.clientHeight,c=n/t.length,l=Math.max(1,Math.min(L,c-4)),h=a-8,d=t.map(t=>(0,v.zr)(t,e));let u="probability"===e?100:this._referenceMaxAmount();if("amount"===e)for(const r of d)Number.isFinite(r)&&(u=Math.max(u,r));const _=d.map((t,e)=>{const o=c*e+c/2;if(!Number.isFinite(t)||t<=0||u<=0){const t=4+h-1.5;return(0,r.JW)(M||(M=E`<circle cx="${0}" cy="${0}" r="${0}" fill="${0}" class="mark"></circle>`),o,t,1.5,i)}const s=Math.max(1,t/u*h),n=S(o-l/2,4+h-s,l,s,l/4);return(0,r.JW)(O||(O=E`<path d="${0}" fill="${0}" class="mark"></path>`),n,i)});return(0,r.qy)(H||(H=E` <svg width="100%" height="100%" viewBox="0 0 ${0} ${0}" preserveAspectRatio="none"> ${0} </svg> `),n,a,_)}_renderHourlyBars(t,e){var i,o,s,n;if(null===(i=this._forecast)||void 0===i||!i.length)return;const a=(null===(o=this._size.value)||void 0===o?void 0:o.width)||this.clientWidth,c=(null===(s=this._size.value)||void 0===s?void 0:s.height)||this.clientHeight,l=c-4,h=Date.now(),d=null!==(n=this._config.hours_to_show)&&void 0!==n?n:24,u=Math.ceil(h/g.C_)*g.C_,_=d*g.C_,p=u+_,f=[];for(const r of this._forecast){const e=new Date(r.datetime).getTime();e>=u&&e<p&&f.push({value:(0,v.zr)(r,t),t:e})}if(!f.length)return;let b="probability"===t?100:this._referenceMaxAmount();if("amount"===t)for(const{value:r}of f)Number.isFinite(r)&&(b=Math.max(b,r));const y=a/d,m=Math.max(1,Math.min(L,y-2)),C=f.map(({value:t,t:i})=>{const o=(i-u)/_*a+y/2;if(!Number.isFinite(t)||t<=0||b<=0){const t=c-1.5;return(0,r.JW)(k||(k=E`<circle cx="${0}" cy="${0}" r="${0}" fill="${0}" class="mark"></circle>`),o,t,1.5,e)}const s=o-m/2,n=Math.max(1,t/b*l),h=S(s,c-n,m,n,m/4);return(0,r.JW)(A||(A=E`<path d="${0}" fill="${0}" class="mark"></path>`),h,e)});return(0,r.qy)(j||(j=E` <svg width="100%" height="100%" viewBox="0 0 ${0} ${0}" preserveAspectRatio="none"> ${0} </svg> `),a,c,C)}_unsubscribeForecast(){this._subscribed&&(this._subscribed.then(t=>null==t?void 0:t()).catch(()=>{}),this._subscribed=void 0),this._subscribedType=void 0}async _subscribeForecast(){var t;if(null===(t=this.context)||void 0===t||!t.entity_id||!this._config||!this._connection||this._subscribed)return;const e=this._resolvedForecastType();if(!e)return;const i=this.context.entity_id;this._forecast=void 0,this._error=void 0,this._subscribedType=e,this._subscribed=(0,v.Mu)(this._connection,i,e,t=>{var e;this._forecast=null!==(e=t.forecast)&&void 0!==e?e:[]}).catch(t=>{this._subscribed=void 0,this._subscribedType=void 0,this._error=t.message||t.code})}constructor(...t){super(...t),this._size=new a.P(this,{callback:t=>{var e;const i=null==t||null===(e=t[0])||void 0===e?void 0:e.contentRect;if(i)return{width:i.width,height:i.height}}})}}Z.styles=[f.KX,(0,r.AH)(V||(V=E`:host{display:flex;width:100%;height:var(--feature-height);flex-direction:column;justify-content:flex-end;align-items:stretch;pointer-events:none!important;--feature-precipitation-opacity:0.4}.container{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;overflow:hidden}.bars{flex:1;min-height:0;display:flex;align-items:stretch}.container.with-labels .bars{padding-bottom:2px}.info{color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}svg{display:block}.mark{opacity:var(--feature-precipitation-opacity)}`))],(0,s.Cg)([(0,c.MZ)({attribute:!1})],Z.prototype,"context",void 0),(0,s.Cg)([(0,c.wk)(),(0,d.fI)({entityIdPath:["context","entity_id"]})],Z.prototype,"_stateObj",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:p.D5,subscribe:!0}),(0,u.p)({transformer:({localize:t})=>t})],Z.prototype,"_localize",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:p.D5,subscribe:!0}),(0,u.p)({transformer:({locale:t})=>t})],Z.prototype,"_locale",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:p.Wq,subscribe:!0}),(0,u.p)({transformer:({connection:t})=>t})],Z.prototype,"_connection",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:p.WF,subscribe:!0}),(0,u.p)({transformer:({config:t})=>t})],Z.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,c.wk)()],Z.prototype,"_config",void 0),(0,s.Cg)([(0,c.wk)()],Z.prototype,"_forecast",void 0),(0,s.Cg)([(0,c.wk)()],Z.prototype,"_error",void 0),Z=(0,s.Cg)([(0,c.EM)("hui-precipitation-forecast-card-feature")],Z),o()}catch(y){o(y)}})},29106:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{N:function(){return h}});i(74423),i(18111),i(61701),i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(98071),c=i(48555),l=t([c]);c=(l.then?(await l)():l)[0];const h=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;const o=(0,a.m)(i.entity_id);return"select"===o||"input_select"===o};class d extends c.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.options}get _label(){return this.hass.localize("ui.card.select.option")}static getStubConfig(){return{type:"select-options"}}static async getConfigElement(){return await i.e(45555).then(i.bind(i,21630)),document.createElement("hui-select-options-card-feature-editor")}_getValue(t){return t.state}_getOptions(){var t;return this._stateObj&&this.hass?(0,r.P)(this._stateObj.attributes.options,null===(t=this._config)||void 0===t?void 0:t.options).map(t=>({value:t,label:this.hass.formatEntityState(this._stateObj,t)})):[]}_getServiceDomain(t){return(0,a.m)(t.entity_id)}_isValueValid(t,e){return e.attributes.options.includes(t)}_isSupported(){return!!(this.hass&&this.context&&h(this.hass,this.context))}constructor(...t){super(...t),this._attribute="option",this._modesAttribute="options",this._serviceDomain="select",this._serviceAction="select_option",this._allowIconsStyle=!1,this._showDropdownOptionIcons=!1}}d=(0,s.Cg)([(0,n.EM)("hui-select-options-card-feature")],d),o()}catch(h){o(h)}})},57484:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{V:function(){return p}});i(16280),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(10223),l=i(22675),h=i(49908),d=t([c]);c=(d.then?(await d)():d)[0];let u,_=t=>t;const p=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"humidifier"===(0,r.m)(i.entity_id)};class v extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"target-humidity"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}willUpdate(t){if(super.willUpdate(t),(t.has("hass")||t.has("context"))&&this._stateObj){const e=t.get("hass");(null==e?void 0:e.states[this.context.entity_id])!==this._stateObj&&(this._targetHumidity=this._stateObj.attributes.humidity)}}get _min(){var t;return null!==(t=this._stateObj.attributes.min_humidity)&&void 0!==t?t:0}get _max(){var t;return null!==(t=this._stateObj.attributes.max_humidity)&&void 0!==t?t:100}_valueChanged(t){const{value:e}=t.detail;"number"!=typeof e||isNaN(e)||(this._targetHumidity=e,this._callService())}_callService(){this.hass.callService("humidifier","set_humidity",{entity_id:this._stateObj.entity_id,humidity:this._targetHumidity})}render(){return this._config&&this.hass&&this.context&&this._stateObj&&p(this.hass,this.context)?(0,n.qy)(u||(u=_` <ha-control-slider .value="${0}" .min="${0}" .max="${0}" .step="${0}" .disabled="${0}" @value-changed="${0}" .label="${0}" unit="%" .locale="${0}"></ha-control-slider> `),this._stateObj.attributes.humidity,this._min,this._max,this._step,this._stateObj.state===l.Hh,this._valueChanged,this.hass.formatEntityAttributeName(this._stateObj,"humidity"),this.hass.locale):n.s6}static get styles(){return h.T}constructor(...t){super(...t),this._step=1}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],v.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],v.prototype,"_config",void 0),(0,s.Cg)([(0,a.wk)()],v.prototype,"_targetHumidity",void 0),v=(0,s.Cg)([(0,a.EM)("hui-target-humidity-card-feature")],v),o()}catch(u){o(u)}})},58467:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{q:function(){return Z}});i(16280),i(44114),i(18111),i(22489),i(61701),i(3362),i(62953);var s=i(40445),n=i(35211),a=i(88696),r=i(5124),c=i(67576),l=i(6412),h=i(89784),d=i(78870),u=(i(46190),i(93421)),_=i(32172),p=i(65829),v=i(22792),g=i(43248),f=i(70565),b=i(2706),y=i(18696),m=i(18721),C=(i(21824),t([p,a,y]));[p,a,y]=C.then?(await C)():C;let w,x,$,M,O,H,k,A,j,V,E,L,S=t=>t;const q=8,Z=(t,e)=>(0,f._W)(e.entity_id?t.states[e.entity_id]:void 0);class T extends r.WF{static getStubConfig(){return{type:"temperature-forecast"}}static async getConfigElement(){return await i.e(54918).then(i.bind(i,15877)),document.createElement("hui-temperature-forecast-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._subscribeForecast()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeForecast()}firstUpdated(){this._subscribeForecast()}updated(t){this._shouldResubscribe(t)&&(this._unsubscribeForecast(),this._subscribeForecast())}_shouldResubscribe(t){if(t.has("context")){var e;const i=t.get("context");if((null==i?void 0:i.entity_id)!==(null===(e=this.context)||void 0===e?void 0:e.entity_id))return!0}return!(!t.has("_config")||this._resolvedForecastType()===this._subscribedType)}_resolvedForecastType(){var t;return(0,f.Sg)(this._stateObj,null===(t=this._config)||void 0===t?void 0:t.forecast_type)}get _showLabels(){var t;return!1!==(null===(t=this._config)||void 0===t?void 0:t.show_labels)}_toCelsius(t){return!(!this._hassConfig||!this._stateObj)&&"°F"===(0,g.d9)(this._hassConfig,this._stateObj,"temperature")?5*(t-32)/9:t}render(){var t;if(!this._config||!this.context||!(0,f._W)(this._stateObj))return r.s6;if(this._error)return(0,r.qy)(w||(w=S` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.temperature-forecast.failed_to_load",{error:this._error}));if(!this._forecast)return(0,r.qy)(x||(x=S` <div class="container loading"> <ha-spinner size="small"></ha-spinner> </div> `));const e="hourly"===this._subscribedType,i=this._config.color?(0,d.MP)(this._config.color):void 0,o=(0,l.H)({container:!0,"with-labels":this._showLabels});if(e){var s;const t=this._computeHourly();if(null==t||!t.coordinates.length)return(0,r.qy)($||($=S` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.temperature-forecast.no_forecast"));const e=i?(0,h.W)({"--feature-color":i}):r.s6,n=null!==(s=this._config.hours_to_show)&&void 0!==s?s:24;return(0,r.qy)(M||(M=S` <div class="${0}"> <div class="bars"> <hui-graph-base .coordinates="${0}" .yAxisOrigin="${0}" .gradient="${0}" style="${0}"></hui-graph-base> </div> ${0} </div> `),o,t.coordinates,t.yAxisOrigin,i?void 0:t.gradient,e,this._showLabels&&this._locale?(0,y.kd)(n,this._locale):r.s6)}const n=null!==(t=this._config.days_to_show)&&void 0!==t?t:7,a="twice_daily"===this._subscribedType?2:1,c=this._forecast.filter(t=>Number.isFinite(t.temperature)&&Number.isFinite(t.templow)).slice(0,n*a);return c.length?(0,r.qy)(H||(H=S` <div class="${0}"> <div class="bars">${0}</div> ${0} </div> `),o,this._renderBars(c,i),this._showLabels&&this._locale?(0,y.Is)(c,a,this._locale):r.s6):(0,r.qy)(O||(O=S` <div class="container"> <div class="info"> ${0} </div> </div> `),this._localize("ui.panel.lovelace.editor.features.types.temperature-forecast.no_forecast"))}_renderBars(t,e){var i,o;const s=(null===(i=this._size.value)||void 0===i?void 0:i.width)||this.clientWidth,n=(null===(o=this._size.value)||void 0===o?void 0:o.height)||this.clientHeight,a=s/t.length,c=Math.max(1,Math.min(q,a-4)),l=n-8;let h=1/0,d=-1/0;for(const r of t)h=Math.min(h,r.templow),d=Math.max(d,r.temperature);h===d&&(h-=1,d+=1);const u=t=>4+l-(t-h)/(d-h)*l,_=e?void 0:t.map((t,e)=>(0,r.JW)(k||(k=S`<linearGradient id="temp-bar-${0}" x1="0" y1="0" x2="0" y2="1"> ${0} </linearGradient>`),e,(0,b.R)(this._toCelsius(t.templow),this._toCelsius(t.temperature),3).map(t=>(0,r.JW)(A||(A=S`<stop offset="${0}" stop-color="${0}"></stop>`),t.offset,t.color)))),p=t.map((t,i)=>{const o=a*i+(a-c)/2,s=u(t.temperature),n=u(t.templow),l=Math.max(1,n-s),h=Math.min(c/2,l/2),d=null!=e?e:`url(#temp-bar-${i})`;return(0,r.JW)(j||(j=S`<rect x="${0}" y="${0}" width="${0}" height="${0}" rx="${0}" ry="${0}" fill="${0}"></rect>`),o,s,c,l,h,h,d)});return(0,r.qy)(V||(V=S` <svg width="100%" height="100%" viewBox="0 0 ${0} ${0}" preserveAspectRatio="none"> ${0}${0} </svg> `),s,n,_?(0,r.JW)(E||(E=S`<defs>${0}</defs>`),_):r.s6,p)}_unsubscribeForecast(){this._subscribed&&(this._subscribed.then(t=>null==t?void 0:t()).catch(()=>{}),this._subscribed=void 0),this._subscribedType=void 0}_computeHourly(){var t,e,i;if(null===(t=this._forecast)||void 0===t||!t.length||!this._stateObj)return;const o=[],s=Date.now(),n=null!==(e=this._config.hours_to_show)&&void 0!==e?e:24,a=Math.floor((s+n*f.C_)/f.C_)*f.C_,r=null===(i=this._stateObj.attributes)||void 0===i?void 0:i.temperature;null==r||Number.isNaN(Number(r))||o.push([s,Number(r)]);for(const f of this._forecast)if(null!=f.temperature&&!Number.isNaN(f.temperature)){const t=new Date(f.datetime).getTime();if(t>a)break;if(t<s)continue;o.push([t,f.temperature])}if(!o.length)return;let c=o[0][1],l=o[0][1];for(const[,f]of o)f<c&&(c=f),f>l&&(l=f);const h=l-c||.1*c,d=c-.1*h,u=l+.1*h,_=this._size.value,p=(null==_?void 0:_.width)||this.clientWidth,v=this._showLabels?12:0,g=Math.max(1,((null==_?void 0:_.height)||this.clientHeight)-v),{points:y,yAxisOrigin:C}=(0,m.G)(o,p,g,o.length,{minX:s,maxX:a,minY:d,maxY:u});y.pop();const w=u-d||.1*d,x=d-.1*w,$=u+.1*w;return{coordinates:y,yAxisOrigin:C,gradient:{x1:0,y1:0,x2:0,y2:g,stops:(0,b.U)(this._toCelsius(x),this._toCelsius($))}}}async _subscribeForecast(){var t;if(null===(t=this.context)||void 0===t||!t.entity_id||!this._config||!this._connection||this._subscribed)return;const e=this._resolvedForecastType();if(!e)return;const i=this.context.entity_id;this._forecast=void 0,this._error=void 0,this._subscribedType=e,this._subscribed=(0,g.Mu)(this._connection,i,e,t=>{var e;this._forecast=null!==(e=t.forecast)&&void 0!==e?e:[]}).catch(t=>{this._subscribed=void 0,this._subscribedType=void 0,this._error=t.message||t.code})}constructor(...t){super(...t),this._size=new a.P(this,{callback:t=>{var e;const i=null==t||null===(e=t[0])||void 0===e?void 0:e.contentRect;if(i)return{width:i.width,height:i.height}}})}}T.styles=[y.KX,(0,r.AH)(L||(L=S`:host{display:flex;width:100%;height:var(--feature-height);flex-direction:column;justify-content:flex-end;align-items:stretch;pointer-events:none!important}.container{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-bottom-right-radius:8px;border-bottom-left-radius:8px;overflow:hidden}.container.with-labels{border-bottom-right-radius:0;border-bottom-left-radius:0}.bars{flex:1;min-height:0;display:flex;align-items:stretch}.container.with-labels .bars{padding-bottom:2px}.info{color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}svg{display:block}hui-graph-base{width:100%;height:100%;--accent-color:var(--feature-color)}`))],(0,s.Cg)([(0,c.MZ)({attribute:!1})],T.prototype,"context",void 0),(0,s.Cg)([(0,c.wk)(),(0,u.fI)({entityIdPath:["context","entity_id"]})],T.prototype,"_stateObj",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:v.D5,subscribe:!0}),(0,_.p)({transformer:({localize:t})=>t})],T.prototype,"_localize",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:v.D5,subscribe:!0}),(0,_.p)({transformer:({locale:t})=>t})],T.prototype,"_locale",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:v.Wq,subscribe:!0}),(0,_.p)({transformer:({connection:t})=>t})],T.prototype,"_connection",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:v.WF,subscribe:!0}),(0,_.p)({transformer:({config:t})=>t})],T.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,c.wk)()],T.prototype,"_config",void 0),(0,s.Cg)([(0,c.wk)()],T.prototype,"_forecast",void 0),(0,s.Cg)([(0,c.wk)()],T.prototype,"_error",void 0),T=(0,s.Cg)([(0,c.EM)("hui-temperature-forecast-card-feature")],T),o()}catch(w){o(w)}})},77799:function(t,e,i){i.d(e,{N:function(){return f}});i(16280),i(74423),i(3362);var o=i(40445),s=i(5124),n=i(67576),a=i(6412),r=i(89784),c=i(71727),l=i(52658),h=(i(48374),i(28624),i(25094),i(22675)),d=i(88360),u=i(49908);let _,p,v,g=t=>t;const f=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;const o=(0,c.m)(i.entity_id);return["switch","input_boolean","light","fan","siren","automation"].includes(o)},b={siren:{on:"M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z",off:"M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z"},light:{on:"M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63Z",off:"M12,2C9.76,2 7.78,3.05 6.5,4.68L16.31,14.5C17.94,13.21 19,11.24 19,9A7,7 0 0,0 12,2M3.28,4L2,5.27L5.04,8.3C5,8.53 5,8.76 5,9C5,11.38 6.19,13.47 8,14.74V17A1,1 0 0,0 9,18H14.73L18.73,22L20,20.72L3.28,4M9,20V21A1,1 0 0,0 10,22H14A1,1 0 0,0 15,21V20H9Z"},fan:{on:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",off:"M12.5,2C9.64,2 8.57,4.55 9.29,7.47L15,13.16C15.87,13.37 16.81,13.81 17.28,14.73C18.46,17.1 22.03,17 22.03,12.5C22.03,8.92 18.05,8.13 14.35,10.13C14.03,9.73 13.61,9.42 13.13,9.22C13.32,8.29 13.76,7.24 14.75,6.75C17.11,5.57 17,2 12.5,2M3.28,4L2,5.27L4.47,7.73C3.22,7.74 2,8.87 2,11.5C2,15.07 5.96,15.85 9.65,13.87C9.97,14.27 10.4,14.59 10.89,14.79C10.69,15.71 10.25,16.75 9.27,17.24C6.91,18.42 7,22 11.5,22C13.8,22 14.94,20.36 14.94,18.21L18.73,22L20,20.72L3.28,4Z"}};class y extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"toggle"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_valueChanged(t){t.target.checked?this._turnOn():this._turnOff()}_turnOn(){this._callService(!0)}_turnOff(){this._callService(!1)}async _callService(t){if(!this.hass||!this._stateObj)return;(0,d.j)(this,"light");const e=(0,c.m)(this._stateObj.entity_id),i=t?"turn_on":"turn_off";await this.hass.callService(e,i,{entity_id:this._stateObj.entity_id})}render(){var t,e;if(!(this._config&&this.hass&&this.context&&this._stateObj&&f(this.hass,this.context)))return s.s6;const i=(0,l.Se)(this._stateObj,"off"),o="on"===this._stateObj.state,n="off"===this._stateObj.state,d=(0,c.m)(this._stateObj.entity_id),u=(null===(t=b[d])||void 0===t?void 0:t.on)||"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",v=(null===(e=b[d])||void 0===e?void 0:e.off)||"M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19Z";return this._stateObj.attributes.assumed_state||this._stateObj.state===h.HV?(0,s.qy)(_||(_=g` <ha-control-button-group> <ha-control-button .label="${0}" @click="${0}" .disabled="${0}" class="${0}" style="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> <ha-control-button .label="${0}" @click="${0}" .disabled="${0}" class="${0}" style="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> </ha-control-button-group> `),this.hass.localize("ui.card.common.turn_off"),this._turnOff,this._stateObj.state===h.Hh,(0,a.H)({active:n}),(0,r.W)({"--color":i}),v,this.hass.localize("ui.card.common.turn_on"),this._turnOn,this._stateObj.state===h.Hh,(0,a.H)({active:o}),(0,r.W)({"--color":"var(--feature-color)"}),u):(0,s.qy)(p||(p=g` <ha-control-switch .pathOn="${0}" .pathOff="${0}" .checked="${0}" @change="${0}" .label="${0}" .disabled="${0}"> </ha-control-switch> `),u,v,o,this._valueChanged,this.hass.localize("ui.card.common.toggle"),this._stateObj.state===h.Hh)}static get styles(){return[u.T,(0,s.AH)(v||(v=g`ha-control-button.active{--control-button-icon-color:white;--control-button-background-color:var(--color);--control-button-background-opacity:1}`))]}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],y.prototype,"_config",void 0),y=(0,o.Cg)([(0,n.EM)("hui-toggle-card-feature")],y)},45429:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{E:function(){return b}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(36312),c=i(71727),l=i(20058),h=i(25064),d=i(18721),u=(i(21824),t([l,h]));[l,h]=u.then?(await u)():u;let _,p,v,g,f=t=>t;const b=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"sensor"===(0,c.m)(i.entity_id)&&(0,l.ty)(i.attributes)},y=24;class m extends n.WF{static getStubConfig(){return{type:"trend-graph"}}static async getConfigElement(){return await i.e(14328).then(i.bind(i,38539)),document.createElement("hui-trend-graph-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}connectedCallback(){super.connectedCallback(),clearInterval(this._interval),this._interval=window.setInterval(()=>this.requestUpdate(),6e4),this.hasUpdated&&this._subscribeHistory()}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._interval),this._unsubscribeHistory()}firstUpdated(){this._setLoadingCoordinates(),this.isConnected&&this._subscribeHistory()}_setLoadingCoordinates(){var t;const e=null===(t=this.context)||void 0===t?void 0:t.entity_id;if(!e||!this.hass)return;const i=this.hass.states[e];if(!i)return;const{points:o,yAxisOrigin:s}=(0,d.a)((0,h.Lj)(i),this.clientWidth,this.clientHeight,10);this._coordinates=o,this._yAxisOrigin=s}render(){return this._config&&this.hass&&this.context&&b(this.hass,this.context)?this._error?(0,n.qy)(_||(_=f` <div class="container"> <div class="info">${0}</div> </div> `),this._error.message||this._error.code):this._coordinates&&!this._coordinates.length?(0,n.qy)(p||(p=f` <div class="container"> <div class="info">No state history found.</div> </div> `)):(0,n.qy)(v||(v=f` <hui-graph-base ?loading="${0}" .coordinates="${0}" .yAxisOrigin="${0}"></hui-graph-base> `),this._loading,this._coordinates,this._yAxisOrigin):n.s6}_unsubscribeHistory(){this._subscribed&&(this._subscribed.then(t=>null==t?void 0:t()).catch(()=>{}),this._subscribed=void 0)}updated(t){var e;if(this.isConnected&&!this._subscribed&&!this._error&&this._config&&null!==(e=this.context)&&void 0!==e&&e.entity_id&&t.has("hass")){const e=t.get("hass");e&&e.config.components!==this.hass.config.components&&this._subscribeHistory()}}async _subscribeHistory(){var t,e;if(!(0,r.x)(this.hass.config,"history")||null===(t=this.context)||void 0===t||!t.entity_id||!this._config||this._subscribed)return;const i=null!==(e=this._config.hours_to_show)&&void 0!==e?e:y,o=!1!==this._config.detail;this._subscribed=(0,h.IQ)(this.hass,t=>{var e;const s=this.context.entity_id;let n=t[s];if(null===(e=n)||void 0===e||!e.length){const t=this.hass.states[s];t&&(n=(0,h.Lj)(t))}const a=o?Math.max(10,this.clientWidth/5,i):Math.max(10,i),r=!o,{points:c,yAxisOrigin:l}=(0,d.a)(n,this.clientWidth,this.clientHeight,a,void 0,r);this._coordinates=c,this._yAxisOrigin=l,this._loading=!1},i,[this.context.entity_id]).catch(t=>{this._subscribed=void 0,this._error=t})}constructor(...t){super(...t),this._loading=!0}}m.styles=(0,n.AH)(g||(g=f`:host{display:flex;width:100%;height:var(--feature-height);flex-direction:column;justify-content:flex-end;align-items:flex-end;pointer-events:none!important}hui-graph-base{width:100%;--accent-color:var(--feature-color);border-bottom-right-radius:8px;border-bottom-left-radius:8px;overflow:hidden}`)),(0,s.Cg)([(0,a.MZ)({attribute:!1,hasChanged:()=>!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_config",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_coordinates",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_yAxisOrigin",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_loading",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"_error",void 0),m=(0,s.Cg)([(0,a.EM)("hui-trend-graph-card-feature")],m),o()}catch(_){o(_)}})},52494:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{J:function(){return m}});i(16280),i(3362),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(71727),c=i(47129),l=i(82286),h=(i(48374),i(28624),i(22675)),d=i(24247),u=i(15471),_=i(49908),p=t([d]);d=(p.then?(await p)():p)[0];let v,g=t=>t;const f="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",b="M17,1H7A2,2 0 0,0 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1M17,19H7V5H17V19M16,13H13V8H11V13H8L12,17L16,13Z",y="no",m=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"update"===(0,r.m)(i.entity_id)&&(0,l.$)(i,d.TY.INSTALL)};class C extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static async getConfigElement(){return await i.e(15871).then(i.bind(i,87906)),document.createElement("hui-update-actions-card-feature-editor")}static getStubConfig(){return{type:"update-actions",backup:y}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}get _installDisabled(){const t=this._stateObj;if(t.state===h.Hh)return!0;const e=t.attributes.latest_version&&t.attributes.skipped_version===t.attributes.latest_version;return!(0,c.a)(t)&&!e||(0,d.Jy)(t)}get _skipDisabled(){const t=this._stateObj;if(t.state===h.Hh)return!0;return t.attributes.latest_version&&t.attributes.skipped_version===t.attributes.latest_version||!(0,c.a)(t)||(0,d.Jy)(t)}async _install(){var t,e;const i=(0,l.$)(this._stateObj,d.TY.BACKUP);let o=i&&"yes"===(null===(t=this._config)||void 0===t?void 0:t.backup);if(i&&"ask"===(null===(e=this._config)||void 0===e?void 0:e.backup)){const t=await(0,u.X)(this,{});if(null===t)return;o=t}this.hass.callService("update","install",{entity_id:this._stateObj.entity_id,backup:o})}async _skip(){this.hass.callService("update","skip",{entity_id:this._stateObj.entity_id})}render(){return this._config&&this.hass&&this.context&&this._stateObj&&m(this.hass,this.context)?(0,n.qy)(v||(v=g` <ha-control-button-group> <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> </ha-control-button-group> `),this.hass.localize("ui.dialogs.more_info_control.update.skip"),this._skip,this._skipDisabled,f,this.hass.localize("ui.dialogs.more_info_control.update.install"),this._install,this._installDisabled,b):n.s6}static get styles(){return _.T}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],C.prototype,"context",void 0),(0,s.Cg)([(0,a.wk)()],C.prototype,"_config",void 0),C=(0,s.Cg)([(0,a.EM)("hui-update-actions-card-feature")],C),o()}catch(v){o(v)}})},65115:function(t,e,i){i.d(e,{Fv:function(){return f},Ky:function(){return y},vA:function(){return g}});i(16280),i(18111),i(22489),i(61701),i(13579),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71727),r=i(82286),c=(i(48374),i(28624),i(67094),i(22675)),l=i(24717),h=i(49908),d=i(37531);let u,_,p=t=>t;const v={start_pause:[l.Ri.PAUSE,l.Ri.START],stop:[l.Ri.STOP],clean_spot:[l.Ri.CLEAN_SPOT],locate:[l.Ri.LOCATE],return_home:[l.Ri.RETURN_HOME]},g=["start_pause","stop","return_home"],f=(t,e)=>v[e].some(e=>(0,r.$)(t,e)),b={start_pause:t=>{if(!(0,r.$)(t,l.Ri.STATE)&&!(0,r.$)(t,l.Ri.START)&&(0,r.$)(t,l.Ri.PAUSE))return{translationKey:"start_pause",icon:"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5",serviceName:"start_pause"};return(0,l.Ak)(t)&&(0,r.$)(t,l.Ri.PAUSE)?{translationKey:"pause",icon:"M14,19H18V5H14M6,19H10V5H6V19Z",serviceName:"pause"}:{translationKey:"start",icon:"M8,5.14V19.14L19,12.14L8,5.14Z",serviceName:"start",disabled:!(0,l.Bd)(t)}},stop:t=>({translationKey:"stop",icon:"M18,18H6V6H18V18Z",serviceName:"stop",disabled:!(0,l.lg)(t)}),clean_spot:()=>({translationKey:"clean_spot",icon:"M22.08,11.04H20.08V4H13.05V2H11.04V4H4V11.04H2V13.05H4V20.08H11.04V22.08H13.05V20.08H20.08V13.05H22.08V11.04M18.07,18.07H13.05V16.06H11.04V18.07H6V13.05H8.03V11.04H6V6H11.04V8.03H13.05V6H18.07V11.04H16.06V13.05H18.07V18.07M13.05,12.05A1,1 0 0,1 12.05,13.05C11.5,13.05 11.04,12.6 11.04,12.05C11.04,11.5 11.5,11.04 12.05,11.04C12.6,11.04 13.05,11.5 13.05,12.05Z",serviceName:"clean_spot"}),locate:()=>({translationKey:"locate",icon:"M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",serviceName:"locate"}),return_home:t=>({translationKey:"return_home",icon:"M15 13L11 17V14H2V12H11V9L15 13M5 20V16H7V18H17V10.19L12 5.69L7.21 10H4.22L12 3L22 12H19V20H5Z",serviceName:"return_to_base",disabled:!(0,l.uu)(t)})},y=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"vacuum"===(0,a.m)(i.entity_id)&&d.zz.some(t=>f(i,t))};class m extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"vacuum-commands"}}static async getConfigElement(){return await i.e(82230).then(i.bind(i,1109)),document.createElement("hui-vacuum-commands-card-feature-editor")}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_onCommandTap(t){t.stopPropagation();const e=t.target.entry;this.hass.callService("vacuum",e.serviceName,{entity_id:this._stateObj.entity_id})}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&y(this.hass,this.context)))return s.s6;const e=this._stateObj,i=null!==(t=this._config.commands)&&void 0!==t?t:g;return(0,s.qy)(u||(u=p` <ha-control-button-group> ${0} </ha-control-button-group> `),i.filter(t=>f(e,t)).map(t=>{const i=b[t](e);return(0,s.qy)(_||(_=p` <ha-control-button .entry="${0}" .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),i,this.hass.localize(`ui.dialogs.more_info_control.vacuum.${i.translationKey}`),this._onCommandTap,i.disabled||e.state===c.Hh,i.icon)}))}static get styles(){return h.T}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],m.prototype,"_config",void 0),m=(0,o.Cg)([(0,n.EM)("hui-vacuum-commands-card-feature")],m)},31235:function(t,e,i){i.d(e,{B:function(){return x}});i(16280);var o=i(40445),s=i(5124),n=i(67576),a=i(6412),r=i(89784),c=i(71727),l=i(52658),h=i(82286),d=(i(48374),i(28624),i(25094),i(67094),i(22675)),u=i(92326),_=i(49908);let p,v,g,f,b,y,m=t=>t;const C="M22 2V22H20V13H14.82A3 3 0 0 1 9.18 13H4V22H2V2H4V11H9.18A3 3 0 0 1 14.82 11H20V2Z",w="M4 22H2V2H4M22 2H20V22H22M11 4V9.18A3 3 0 0 0 11 14.82V20H13V14.82A3 3 0 0 0 13 9.18V4Z",x=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"valve"===(0,c.m)(i.entity_id)&&((0,h.$)(i,u.qm.OPEN)||(0,h.$)(i,u.qm.CLOSE))};class $ extends s.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"valve-open-close"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}_onOpenValve(){this.hass.callService("valve","open_valve",{entity_id:this._stateObj.entity_id})}_onCloseValve(){this.hass.callService("valve","close_valve",{entity_id:this._stateObj.entity_id})}_onOpenTap(t){t.stopPropagation(),this._onOpenValve()}_onCloseTap(t){t.stopPropagation(),this._onCloseValve()}_onStopTap(t){t.stopPropagation(),this.hass.callService("valve","stop_valve",{entity_id:this._stateObj.entity_id})}_valueChanged(t){t.stopPropagation();t.target.checked?this._onOpenValve():this._onCloseValve()}render(){if(!(this._config&&this.hass&&this.context&&this._stateObj&&x(this.hass,this.context)))return s.s6;const t=(0,l.Se)(this._stateObj,"open"),e=(0,l.Se)(this._stateObj,"closed"),i=w,o=C,n="open"===this._stateObj.state||"closing"===this._stateObj.state||"opening"===this._stateObj.state,c="closed"===this._stateObj.state;return this._stateObj.attributes.assumed_state||this._stateObj.state===d.HV?(0,s.qy)(p||(p=m` <ha-control-button-group> ${0} ${0} ${0} </ha-control-button-group> `),(0,h.$)(this._stateObj,u.qm.CLOSE)?(0,s.qy)(v||(v=m` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}" class="${0}" style="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.valve.close_valve"),this._onCloseTap,!(0,u.hJ)(this._stateObj),(0,a.H)({active:c}),(0,r.W)({"--color":e}),C):s.s6,(0,h.$)(this._stateObj,u.qm.STOP)?(0,s.qy)(g||(g=m` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.valve.stop_valve"),this._onStopTap,!(0,u.lg)(this._stateObj),"M18,18H6V6H18V18Z"):s.s6,(0,h.$)(this._stateObj,u.qm.OPEN)?(0,s.qy)(f||(f=m` <ha-control-button .label="${0}" @click="${0}" .disabled="${0}" class="${0}" style="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-control-button> `),this.hass.localize("ui.card.valve.open_valve"),this._onOpenTap,!(0,u.pc)(this._stateObj),(0,a.H)({active:n}),(0,r.W)({"--color":t}),w):s.s6):(0,s.qy)(b||(b=m` <ha-control-switch .pathOn="${0}" .pathOff="${0}" .checked="${0}" @change="${0}" .label="${0}" .disabled="${0}"> </ha-control-switch> `),i,o,n,this._valueChanged,this.hass.localize("ui.card.common.toggle"),this._stateObj.state===d.Hh)}static get styles(){return[_.T,(0,s.AH)(y||(y=m`ha-control-button.active{--control-button-icon-color:white;--control-button-background-color:var(--color);--control-button-background-opacity:1}`))]}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],$.prototype,"_config",void 0),$=(0,o.Cg)([(0,n.EM)("hui-valve-open-close-card-feature")],$)},34609:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{U:function(){return w}});i(16280);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(78870),l=i(53610),h=i(71727),d=i(47129),u=i(52658),_=i(82286),p=i(10223),v=i(22675),g=i(88827),f=i(92326),b=i(49908),y=t([p,l,g]);[p,l,g]=y.then?(await y)():y;let m,C=t=>t;const w=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"valve"===(0,h.m)(i.entity_id)&&(0,_.$)(i,f.qm.SET_POSITION)};class x extends n.WF{get _stateObj(){if(this.hass&&this.context&&this.context.entity_id)return this.hass.states[this.context.entity_id]}static getStubConfig(){return{type:"valve-position"}}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}render(){var t;if(!(this._config&&this.hass&&this.context&&this._stateObj&&w(this.hass,this.context)))return n.s6;const e=(0,d.a)(this._stateObj)&&null!==(t=this._stateObj.attributes.current_position)&&void 0!==t?t:0,i=Math.max(Math.round(e),0),o=(0,u.Se)(this._stateObj,"open"),s={"--feature-color":this.color?(0,c.MP)(this.color):(0,u.Se)(this._stateObj),"--state-valve-inactive-color":o};return(0,n.qy)(m||(m=C` <ha-control-slider style="${0}" .value="${0}" min="0" max="100" step="1" inverted show-handle @value-changed="${0}" .label="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"></ha-control-slider> `),(0,r.W)(s),i,this._valueChanged,(0,l.computeAttributeNameDisplay)(this.hass.localize,this._stateObj,this.hass.entities,"current_position"),this._stateObj.state===v.Hh,g.rM.valve.current_position,this.hass.locale)}_valueChanged(t){const{value:e}=t.detail;"number"!=typeof e||isNaN(e)||this.hass.callService("valve","set_valve_position",{entity_id:this._stateObj.entity_id,position:e})}static get styles(){return b.T}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"context",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],x.prototype,"color",void 0),(0,s.Cg)([(0,a.wk)()],x.prototype,"_config",void 0),x=(0,s.Cg)([(0,a.EM)("hui-valve-position-card-feature")],x),o()}catch(m){o(m)}})},25232:function(t,e,i){i.d(e,{c:function(){return h}});var o=i(40445),s=i(67576),n=i(92326),a=i(84337),r=i(55719),c=i(32181);const l={domain:"valve",supportsPosition:n.sA,getFavoritePositions:t=>{var e;return null==t||null===(e=t.options)||void 0===e||null===(e=e.valve)||void 0===e?void 0:e.favorite_positions},getCurrentValue:t=>t.attributes.current_position,normalizeFavoritePositions:a.S,defaultFavoritePositions:n.ph,setPositionService:"set_valve_position",serviceDataKey:"position",setPositionLabelKey:"ui.dialogs.more_info_control.valve.favorite_position.set",featureLabelKey:"ui.panel.lovelace.editor.features.types.valve-position-favorite.label"},h=(t,e)=>(0,r.s)(t,e,l);class d extends r.N{get _definition(){return l}static getStubConfig(){return{type:"valve-position-favorite"}}}d.getConfigElement=c.C,d=(0,o.Cg)([(0,s.EM)("hui-valve-position-favorite-card-feature")],d)},75781:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{Y:function(){return _}});i(94490),i(26910),i(18111),i(61701),i(3362),i(62953);var s=i(40445),n=i(67576),a=i(71727),r=i(52658),c=i(62091),l=i(98071),h=i(48555),d=t([h]);h=(d.then?(await d)():d)[0];const u="M8 2C6.89 2 6 2.89 6 4V16C6 17.11 6.89 18 8 18H9V20H6V22H9C10.11 22 11 21.11 11 20V18H13V20C13 21.11 13.89 22 15 22H18V20H15V18H16C17.11 18 18 17.11 18 16V4C18 2.89 17.11 2 16 2H8M12 4.97A2 2 0 0 1 14 6.97A2 2 0 0 1 12 8.97A2 2 0 0 1 10 6.97A2 2 0 0 1 12 4.97M10 14.5H14V16H10V14.5Z",_=(t,e)=>{const i=e.entity_id?t.states[e.entity_id]:void 0;if(!i)return!1;return"water_heater"===(0,a.m)(i.entity_id)};class p extends h.n{get _configuredModes(){var t;return null===(t=this._config)||void 0===t?void 0:t.operation_modes}get _label(){return this.hass.localize("ui.card.water_heater.mode")}get _controlSelectStyle(){if(this._stateObj)return{"--control-select-color":(0,r.Se)(this._stateObj)}}static getStubConfig(){return{type:"water-heater-operation-modes"}}static async getConfigElement(){return await i.e(97504).then(i.bind(i,26691)),document.createElement("hui-water-heater-operation-modes-card-feature-editor")}_getValue(t){return t.state}_getOptions(){var t;if(!this._stateObj||!this.hass)return[];const e=(this._stateObj.attributes.operation_list||[]).concat().sort(c.im).reverse();return(0,l.P)(e,null===(t=this._config)||void 0===t?void 0:t.operation_modes).map(t=>({value:t,label:this.hass.formatEntityState(this._stateObj,t)}))}_isSupported(){return!!(this.hass&&this.context&&_(this.hass,this.context))}constructor(...t){super(...t),this._attribute="operation_mode",this._modesAttribute="operation_list",this._dropdownIconPath=u,this._serviceDomain="water_heater",this._serviceAction="set_operation_mode",this._defaultStyle="icons"}}p=(0,s.Cg)([(0,n.EM)("hui-water-heater-operation-modes-card-feature")],p),o()}catch(u){o(u)}})},37531:function(t,e,i){i.d(e,{HA:function(){return s},Ry:function(){return a},Ut:function(){return r},mJ:function(){return o},zz:function(){return n}});const o=["turn_on","turn_off","media_play","media_pause","media_play_pause","media_stop","media_previous_track","media_next_track","volume_down","volume_up","volume_mute","shuffle","repeat"],s=["decrement","reset","increment"],n=["start_pause","stop","clean_spot","locate","return_home"],a=["start_pause","dock"],r=["light","fan","cover-shutter","cover-blind","cover-curtain","cover-shade","cover-awning","cover-garage","cover-gate","cover-door","cover-window","cover-damper","switch"]},13632:function(t,e,i){i.d(e,{B:function(){return s}});i(74423),i(44114),i(62953);var o=i(71727);const s=(t,e,i,n,a,r)=>{const c=[];null!=a&&a.length&&c.push(t=>a.includes((0,o.m)(t))),r&&c.push(e=>t.states[e]&&r(t.states[e]));const l=((t,e,i)=>{(!i||i>t.length)&&(i=t.length);const o=[];for(let s=0;s<t.length&&o.length<i;s++){let i=!0;for(const o of e)if(!o(t[s])){i=!1;break}i&&o.push(t[s])}return o})(i,c,e);if(l.length<e&&n.length){const i=s(t,e-l.length,n,[],a,r);l.push(...i)}return l}},18721:function(t,e,i){i.d(e,{G:function(){return s},a:function(){return n}});i(44114),i(18111),i(22489),i(7588),i(61701),i(62953);var o=i(34218);const s=(t,e,i,s,n,a=!1)=>{t=t.filter(t=>!Number.isNaN(t[1]));return((t,e,i,o)=>{var s,n,a,r;if(0===t.length)return{points:[],yAxisOrigin:i};let c=i,l=null!==(s=null==o?void 0:o.minY)&&void 0!==s?s:t[0][1],h=null!==(n=null==o?void 0:o.maxY)&&void 0!==n?n:t[0][1];const d=null!==(a=null==o?void 0:o.minX)&&void 0!==a?a:t[0][0],u=null!==(r=null==o?void 0:o.maxX)&&void 0!==r?r:t[t.length-1][0];t.forEach(([t,e])=>{e<l?l=e:e>h&&(h=e)});const _=h-l||.1*l;h+=.1*_,l-=.1*_,h<0?(h=Math.min(0,h),c=0):l<0?c=h/(h-l||1)*i:l=Math.max(0,l);const p=h-l||1,v=u-d||1,g=t.map(t=>[(t[0]-d)/v*e,i-(t[1]-l)/p*i]);return g.push([e,g[g.length-1][1]]),{points:g,yAxisOrigin:c}})((0,o.P)(t,s,null==n?void 0:n.minX,null==n?void 0:n.maxX,a),e,i,n)},n=(t,e,i,o,n,a=!1)=>{if(null==t||!t.length)return{points:[],yAxisOrigin:0};const r=t.map(t=>[1e3*t.lu,Number(t.s)]);return s(r,e,i,o,n,a)}},96332:function(t,e,i){i.d(e,{O:function(){return o}});const o={view_columns:"M4 5V18H21V5H4M14 7V16H11V7H14M6 7H9V16H6V7M19 16H16V7H19V16Z",location:"M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",numeric_state:"M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",screen:"M4,6V16H9V12A2,2 0 0,1 11,10H16A2,2 0 0,1 18,12V16H20V6H4M0,20V18H4A2,2 0 0,1 2,16V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V16A2,2 0 0,1 20,18H24V20H18V20C18,21.11 17.1,22 16,22H11A2,2 0 0,1 9,20H9L0,20M11.5,20A0.5,0.5 0 0,0 11,20.5A0.5,0.5 0 0,0 11.5,21A0.5,0.5 0 0,0 12,20.5A0.5,0.5 0 0,0 11.5,20M15.5,20A0.5,0.5 0 0,0 15,20.5A0.5,0.5 0 0,0 15.5,21A0.5,0.5 0 0,0 16,20.5A0.5,0.5 0 0,0 15.5,20M13,20V21H14V20H13M11,12V19H16V12H11Z",time:"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z",user:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z",and:"M4.4,16.5C4.4,15.6 4.7,14.7 5.2,13.9C5.7,13.1 6.7,12.2 8.2,11.2C7.3,10.1 6.8,9.3 6.5,8.7C6.1,8 6,7.4 6,6.7C6,5.2 6.4,4.1 7.3,3.2C8.2,2.3 9.4,2 10.9,2C12.2,2 13.3,2.4 14.2,3.2C15.1,4 15.5,5 15.5,6.1C15.5,6.9 15.3,7.6 14.9,8.3C14.5,9 13.8,9.7 12.8,10.4L11.4,11.5L15.7,16.7C16.3,15.5 16.6,14.3 16.6,12.8H18.8C18.8,15.1 18.3,17 17.2,18.5L20,21.8H17L15.7,20.3C15,20.9 14.3,21.3 13.4,21.6C12.5,21.9 11.6,22.1 10.7,22.1C8.8,22.1 7.3,21.6 6.1,20.6C5,19.5 4.4,18.2 4.4,16.5M10.7,20C12,20 13.2,19.5 14.3,18.5L9.6,12.8L9.2,13.1C7.7,14.2 7,15.3 7,16.5C7,17.6 7.3,18.4 8,19C8.7,19.6 9.5,20 10.7,20M8.5,6.7C8.5,7.6 9,8.6 10.1,9.9L11.7,8.8C12.3,8.4 12.7,8 12.9,7.6C13.1,7.2 13.2,6.7 13.2,6.2C13.2,5.6 13,5.1 12.5,4.7C12.1,4.3 11.5,4.1 10.8,4.1C10.1,4.1 9.5,4.3 9.1,4.8C8.7,5.3 8.5,5.9 8.5,6.7Z",not:"M14.08,4.61L15.92,5.4L14.8,8H19V10H13.95L12.23,14H19V16H11.38L9.92,19.4L8.08,18.61L9.2,16H5V14H10.06L11.77,10H5V8H12.63L14.08,4.61Z",or:"M2,4C5,10 5,14 2,20H8C13,20 19,16 22,12C19,8 13,4 8,4H2M5,6H8C11.5,6 16.3,9 19.3,12C16.3,15 11.5,18 8,18H5C6.4,13.9 6.4,10.1 5,6Z"}},21824:function(t,e,i){i(18111),i(61701),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(71769),r=i(17399);i(22489);const c=(t,e,i,o)=>[(t-i)/2+i,(e-o)/2+o];let l,h,d,u,_,p,v,g,f=t=>t;class b extends s.WF{render(){var t,e,i;const o=this.clientWidth||500,n=this.clientHeight||o/5,a=null!==(t=this.yAxisOrigin)&&void 0!==t?t:n,r=null!==(e=this._displayCoordinates&&(t=>{if(!t.length)return"";let e,i,o="",s=t.filter(Boolean)[0];o+=`M ${s[0]},${s[1]}`;for(const n of t)e=n,i=c(s[0],s[1],e[0],e[1]),o+=` ${i[0]},${i[1]}`,o+=` Q${e[0]},${e[1]}`,s=e;return o+=` ${e[0]},${e[1]}`,o})(this._displayCoordinates))&&void 0!==e?e:this.loading?`M 0,${n/2} L ${o},${n/2}`:void 0,g=null!==(i=this._displayCoordinates)&&void 0!==i&&i.length?this._displayCoordinates[this._displayCoordinates.length-1][0]:o;if(!r)return(0,s.qy)(l||(l=f` ${0} `),(0,s.JW)(h||(h=f`<svg width="100%" height="100%" viewBox="0 0 ${0} ${0}"></svg>`),o,n));const b=this.loading&&!this._reducedMotion,y=`${this._uniqueId}-shimmer`,m=`${this._uniqueId}-gradient`,C=this.gradient,w=b?`url(#${y})`:C?`url(#${m})`:"var(--accent-color)";return(0,s.qy)(d||(d=f` ${0} `),(0,s.JW)(u||(u=f`<svg width="100%" height="100%" viewBox="0 0 ${0} ${0}" preserveAspectRatio="none"> ${0} <g> <mask id="${0}-fill"> <path class="fill" fill="white" d="${0} L ${0}, ${0} L 0, ${0} z"/> </mask> <rect height="100%" width="100%" fill="${0}" mask="url(#${0}-fill)"></rect> <mask id="${0}-line"> <path vector-effect="non-scaling-stroke" class="line" fill="none" stroke="white" stroke-width="${0}" stroke-linecap="round" stroke-linejoin="round" d="${0}"></path> </mask> <rect height="100%" width="100%" fill="${0}" mask="url(#${0}-line)"></rect> </g> </svg>`),o,n,b?(0,s.JW)(_||(_=f`<defs> <linearGradient id="${0}" x1="-50%" x2="-30%" y1="0" y2="0"> <stop offset="0%" stop-color="var(--accent-color)"/> <stop offset="50%" stop-color="white"/> <stop offset="100%" stop-color="var(--accent-color)"/> <animate attributeName="x1" values="-50%;120%" dur="1.8s" repeatCount="indefinite"/> <animate attributeName="x2" values="-30%;140%" dur="1.8s" repeatCount="indefinite"/> </linearGradient> </defs>`),y):C?(0,s.JW)(p||(p=f`<defs> <linearGradient id="${0}" gradientUnits="userSpaceOnUse" x1="${0}" y1="${0}" x2="${0}" y2="${0}"> ${0} </linearGradient> </defs>`),m,C.x1,C.y1,C.x2,C.y2,C.stops.map(t=>(0,s.JW)(v||(v=f`<stop offset="${0}" style="stop-color:${0}"></stop>`),t.offset,t.color))):s.s6,this._uniqueId,r,g,a,a,w,this._uniqueId,this._uniqueId,2,r,w,this._uniqueId))}connectedCallback(){super.connectedCallback(),this._unsubMediaQuery=(0,a.m)("(prefers-reduced-motion: reduce)",t=>{this._reducedMotion!==t&&(this._reducedMotion=t)})}willUpdate(t){this.coordinates&&t.has("coordinates")&&this._setCoordinates(this.coordinates)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unsubMediaQuery)||void 0===t||t.call(this),this._unsubMediaQuery=void 0,this._cancelAnimation()}_setCoordinates(t){this._cancelAnimation();const e=this._displayCoordinates;if(!e||t.length<2)return void(this._displayCoordinates=t);const i=(0,r.W)(getComputedStyle(this).getPropertyValue("--ha-animation-duration-slow"));if(i<=1)return void(this._displayCoordinates=t);const o=t.map(t=>[t[0],this._interpolateY(e,t[0])]),s=performance.now(),n=e=>{const a=Math.min((e-s)/i,1),r=1-(1-a)**3;this._displayCoordinates=t.map((t,e)=>[t[0],o[e][1]+(t[1]-o[e][1])*r]),this._animationFrame=a<1?requestAnimationFrame(n):void 0};this._animationFrame=requestAnimationFrame(n)}_interpolateY(t,e){if(!t.length)return 0;if(e<=t[0][0])return t[0][1];for(let i=1;i<t.length;i++){const o=t[i];if(e>o[0])continue;const s=t[i-1],n=o[0]-s[0];if(!n)return o[1];const a=(e-s[0])/n;return s[1]+(o[1]-s[1])*a}return t[t.length-1][1]}_cancelAnimation(){void 0!==this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}constructor(...t){super(...t),this.loading=!1,this._uniqueId=`graph-${Math.random().toString(36).substring(2,9)}`,this._reducedMotion=!1}}b.styles=(0,s.AH)(g||(g=f`:host{display:flex;width:100%;height:100%}.line{opacity:.8}.fill{opacity:.1}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"coordinates",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"y-axis-origin",type:Number})],b.prototype,"yAxisOrigin",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],b.prototype,"loading",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"gradient",void 0),(0,o.Cg)([(0,n.wk)()],b.prototype,"_displayCoordinates",void 0),(0,o.Cg)([(0,n.wk)()],b.prototype,"_reducedMotion",void 0),b=(0,o.Cg)([(0,n.EM)("hui-graph-base")],b)},47046:function(t,e,i){var o=i(40445),s=i(5124),n=i(67576);i(67094);let a,r,c=t=>t;class l extends s.WF{render(){return(0,s.qy)(a||(a=c` <ha-svg-icon .path="${0}" .title="${0}"></ha-svg-icon> `),"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",this.label)}}l.styles=(0,s.AH)(r||(r=c`ha-svg-icon{color:var(--warning-color)}`)),(0,o.Cg)([(0,n.MZ)()],l.prototype,"label",void 0),l=(0,o.Cg)([(0,n.EM)("hui-warning-element")],l)},13174:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{L:function(){return P},h:function(){return I}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(50179),n=(i(89807),i(11865)),a=i(85032),r=i(47547),c=i(66102),l=i(89156),h=(i(3453),i(81210),i(31095),i(1248)),d=(i(19300),i(57251),i(35598)),u=i(58500),_=i(44772),p=(i(44577),i(5817)),v=i(67034),g=i(13028),f=(i(30277),i(38409),i(339)),b=i(67142),y=i(74049),m=(i(5375),i(14312),i(29175),i(26671)),C=i(61691),w=i(71982),x=i(91282),$=i(73269),M=i(29106),O=i(57484),H=i(95605),k=(i(77799),i(52494)),A=(i(65115),i(31235),i(25232),i(34609)),j=i(75781),V=i(7349),E=i(38098),L=i(14501),S=i(58467),q=i(45429),Z=i(34128),T=t([s,n,a,r,c,l,h,d,u,_,p,v,g,f,b,y,m,C,w,x,$,M,O,H,k,A,j,V,E,L,S,q]);[s,n,a,r,c,l,h,d,u,_,p,v,g,f,b,y,m,C,w,x,$,M,O,H,k,A,j,V,E,L,S,q]=T.then?(await T)():T;const z=new Set(["alarm-modes","area-controls","bar-gauge","button","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes","climate-hvac-modes","climate-preset-modes","counter-actions","cover-open-close","cover-position-favorite","cover-position","cover-tilt-favorite","cover-tilt-position","cover-tilt","date-set","fan-direction","fan-oscillate","fan-preset-modes","fan-speed","humidifier-modes","humidifier-toggle","lawn-mower-commands","light-brightness","light-color-temp","light-color-favorites","lock-commands","lock-open-door","media-player-playback","media-player-sound-mode","media-player-source","media-player-volume-buttons","media-player-volume-slider","numeric-input","precipitation-forecast","select-options","trend-graph","target-humidity","target-temperature","temperature-forecast","toggle","update-actions","vacuum-commands","valve-open-close","valve-position-favorite","valve-position","water-heater-operation-modes"]),P=t=>(0,Z.Ue)("card-feature",t,z),I=t=>(0,Z.gh)(t,"card-feature",z);o()}catch(z){o(z)}})},72669:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{E:function(){return c},U:function(){return l}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953),i(90285);var s=i(16678),n=i(34128),a=t([s]);s=(a.then?(await a)():a)[0];const r=new Set(["error","entity","button"]),c=t=>(0,n.Ue)("heading-badge",t,r,void 0,void 0,"entity"),l=t=>(0,n.gh)(t,"heading-badge",r);o()}catch(r){o(r)}})},82747:function(t,e,i){i.d(e,{$:function(){return o}});const o=(0,i(35211).q6)("conditions-entity-context")},11839:function(t,e,i){i.d(e,{M:function(){return o},Q:function(){return s}});const o="__current_entity__",s=(t,e,i)=>({id:o,primary:t("ui.panel.lovelace.editor.condition-editor.condition.state.current_entity"),secondary:null!=i?i:e,entity_id:e,hide_clear:!0})},98204:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{t:function(){return Y}});i(74423),i(18111),i(61701),i(13579),i(3362),i(62953);var s=i(40445),n=(i(68825),i(35211)),a=i(34271),r=i(5124),c=i(67576),l=i(87047),h=i(93905),d=i(69558),u=i(1087),_=i(57237),p=i(78978),v=i(7822),g=(i(78486),i(38962)),f=(i(76776),i(29823)),b=(i(70947),i(11382),i(26300)),y=(i(67094),i(34127)),m=i(10763),C=i(65063),w=i(14503),x=i(96332),$=i(14487),M=i(82747),O=t([v,g,f,b,y,m,$,l]);[v,g,f,b,y,m,$,l]=O.then?(await O)():O;let H,k,A,j,V,E,L,S,q,Z,T=t=>t;const z="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",P="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",I="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",F="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",N="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",W="M6,22A3,3 0 0,1 3,19C3,18.4 3.18,17.84 3.5,17.37L9,7.81V6A1,1 0 0,1 8,5V4A2,2 0 0,1 10,2H14A2,2 0 0,1 16,4V5A1,1 0 0,1 15,6V7.81L20.5,17.37C20.82,17.84 21,18.4 21,19A3,3 0 0,1 18,22H6M5,19A1,1 0 0,0 6,20H18A1,1 0 0,0 19,19C19,18.79 18.93,18.59 18.82,18.43L16.53,14.47L14,17L8.93,11.93L5.18,18.43C5.07,18.59 5,18.79 5,19M13,10A1,1 0 0,0 12,11A1,1 0 0,0 13,12A1,1 0 0,0 14,11A1,1 0 0,0 13,10Z",U="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",R=["state","numeric_state"],D=["and","or","not"],B=(t,e)=>R.includes(t)&&e,Y=(t,e)=>B(t,e)?`ha-card-condition-${t}-no_entity`:`ha-card-condition-${t}`,K=(t,e)=>{var i;return e&&D.includes(t.condition)&&!0===(null===(i=t.conditions)||void 0===i?void 0:i.some(t=>R.includes(t.condition)))};class J extends r.WF{get _noEntity(){var t;return"filter"===(null===(t=this._entityContext)||void 0===t?void 0:t.mode)}get _editor(){if(this._condition)return customElements.get(Y(this._condition.condition,this._noEntity))}expand(){this.updateComplete.then(()=>{this.shadowRoot.querySelector("ha-expansion-panel").expanded=!0})}_setupConditionListeners(){this._listeners.setup(this.condition?[this.condition]:[],this.hass,()=>this._evaluateLiveTest())}willUpdate(t){if(t.has("condition")){var e;this._condition=Object.assign({condition:"state"},this.condition);const t=null===(e=this._editor)||void 0===e?void 0:e.validateUIConfig;if(t)try{t(this._condition,this.hass),this._uiAvailable=!0,this._uiWarnings=[]}catch(i){this._uiWarnings=(0,p._)(this.hass,i).warnings,this._uiAvailable=!1}else this._uiAvailable=!1,this._uiWarnings=[];this._uiAvailable||this._yamlMode||(this._yamlMode=!0),this._setupConditionListeners()}(t.has("condition")||t.has("hass"))&&this._evaluateLiveTest()}updated(t){t.has("_entityContext")&&this._evaluateLiveTest()}_evaluateLiveTest(){var t;if(!this.condition||!this._condition)return void(this._liveTestResult={state:"unknown"});if(B(this._condition.condition,this._noEntity)||K(this._condition,this._noEntity))return void(this._liveTestResult={state:"unknown",message:this.hass.localize("ui.panel.lovelace.editor.condition-editor.live_test_state.unknown")});if(!(0,$.db)([this.condition]))return void(this._liveTestResult={state:"invalid",message:this.hass.localize("ui.panel.lovelace.editor.condition-editor.live_test_state.invalid")});const e="current"===(null===(t=this._entityContext)||void 0===t?void 0:t.mode)?{entity_id:this._entityContext.entityId}:{},i=(0,$.XH)([this.condition],this.hass,e);this._liveTestResult={state:i?"pass":"fail",message:this.hass.localize("ui.panel.lovelace.editor.condition-editor.live_test_state."+(i?"pass":"fail"))}}render(){const t=this._condition;if(!t)return r.s6;const e=B(t.condition,this._noEntity)||K(t,this._noEntity);return(0,r.qy)(H||(H=T` <div class="container"> <ha-expansion-panel left-chevron> <div id="condition-icon" class="icon-badge-wrapper" slot="leading-icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </div> ${0} <h3 slot="header"> ${0} </h3> <ha-automation-row-event-chip .show="${0}" .variant="${0}" slot="event" class="event-chip" aria-live="polite"> ${0} </ha-automation-row-event-chip> <ha-dropdown slot="icons" @wa-select="${0}" @click="${0}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"> </ha-icon-button> ${0} <ha-dropdown-item value="duplicate"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="copy"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="cut"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="toggle_yaml" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item variant="danger" value="delete"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> </ha-dropdown> ${0} <div class="content"> ${0} </div> </ha-expansion-panel> </div> `),x.O[t.condition],e?r.s6:(0,r.qy)(k||(k=T`<ha-automation-row-live-test .state="${0}" .label="${0}"></ha-automation-row-live-test>`),this._liveTestResult.state,this.hass.localize(`ui.panel.lovelace.editor.condition-editor.live_test_state.${this._liveTestResult.state}`)),!e&&this._liveTestResult.message?(0,r.qy)(A||(A=T`<ha-tooltip for="condition-icon" slot="leading-icon">${0}</ha-tooltip>`),this._liveTestResult.message):r.s6,this.hass.localize(`ui.panel.lovelace.editor.condition-editor.condition.${t.condition}.label`)||t.condition,void 0!==this._testingResult,this._testingResult?"success":"warning",this._testingResult?this.hass.localize("ui.panel.lovelace.editor.condition-editor.testing_pass"):this.hass.localize("ui.panel.lovelace.editor.condition-editor.testing_error"),this._handleAction,_.d,this.hass.localize("ui.common.menu"),N,B(t.condition,this._noEntity)||K(t,this._noEntity)?r.s6:(0,r.qy)(j||(j=T`<ha-dropdown-item value="test"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item>`),this.hass.localize("ui.panel.lovelace.editor.condition-editor.test"),W),this.hass.localize("ui.panel.lovelace.editor.edit_card.duplicate"),I,this.hass.localize("ui.panel.lovelace.editor.edit_card.copy"),z,this.hass.localize("ui.panel.lovelace.editor.edit_card.cut"),P,!this._uiAvailable,this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml")),U,this.hass.localize("ui.common.delete"),F,this._uiAvailable?r.s6:(0,r.qy)(V||(V=T` <ha-alert alert-type="warning" .title="${0}"> ${0} ${0} </ha-alert> `),this.hass.localize("ui.errors.config.editor_not_supported"),this._uiWarnings.length>0&&void 0!==this._uiWarnings[0]?(0,r.qy)(E||(E=T` <ul> ${0} </ul> `),this._uiWarnings.map(t=>(0,r.qy)(L||(L=T`<li>${0}</li>`),t))):r.s6,this.hass.localize("ui.errors.config.edit_in_yaml_supported")),this._yamlMode?(0,r.qy)(S||(S=T` <ha-yaml-editor .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor> `),this.condition,this._onYamlChange):(0,r.qy)(q||(q=T` ${0} `),(0,d._)(Y(t.condition,this._noEntity),{hass:this.hass,condition:t})))}async _handleAction(t){const e=t.detail.item.value;if(void 0!==e)switch(e){case"test":return void(await this._testCondition());case"duplicate":return void this._duplicateCondition();case"copy":return void this._copyCondition();case"cut":return void this._cutCondition();case"toggle_yaml":return void(this._yamlMode=!this._yamlMode);case"delete":this._delete()}}async _testCondition(){var t;this._timeout&&(window.clearTimeout(this._timeout),this._timeout=void 0),this._testingResult=void 0;const e=this.condition;if(!(0,$.db)([this.condition]))return void(0,C.showAlertDialog)(this,{title:this.hass.localize("ui.panel.lovelace.editor.condition-editor.invalid_config_title"),text:this.hass.localize("ui.panel.lovelace.editor.condition-editor.invalid_config_text")});const i="current"===(null===(t=this._entityContext)||void 0===t?void 0:t.mode)?{entity_id:this._entityContext.entityId}:{};this._testingResult=(0,$.XH)([e],this.hass,i),this._timeout=window.setTimeout(()=>{this._testingResult=void 0},2500)}_duplicateCondition(){(0,u.r)(this,"duplicate-condition",{value:(0,a.A)(this.condition)})}_copyCondition(){this._clipboard=(0,a.A)(this.condition)}_cutCondition(){this._copyCondition(),this._delete()}_onYamlChange(t){t.stopPropagation(),t.detail.isValid&&(0,u.r)(this,"value-changed",{value:t.detail.value})}constructor(...t){super(...t),this._yamlMode=!1,this._uiAvailable=!1,this._uiWarnings=[],this._liveTestResult={state:"unknown"},this._listeners=new l.x(this),this._delete=()=>{(0,u.r)(this,"value-changed",{value:null})}}}J.styles=[w.RF,(0,r.AH)(Z||(Z=T`ha-dropdown{--mdc-theme-text-primary-on-background:var(--primary-text-color)}ha-expansion-panel{--expansion-panel-summary-padding:0 0 0 8px;--expansion-panel-content-padding:0}.icon-badge-wrapper{display:inline-flex;position:relative;color:var(--secondary-text-color);opacity:.9}h3{margin:0;font-size:inherit;font-weight:inherit}.content{padding:12px}.disabled{opacity:.5;pointer-events:none}.event-chip{position:absolute;inset-inline-end:40px}.container{position:relative;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border:1px solid var(--divider-color)}`))],(0,s.Cg)([(0,c.MZ)({attribute:!1})],J.prototype,"hass",void 0),(0,s.Cg)([(0,c.MZ)({attribute:!1})],J.prototype,"condition",void 0),(0,s.Cg)([(0,c.wk)(),(0,n.Fg)({context:M.$,subscribe:!0})],J.prototype,"_entityContext",void 0),(0,s.Cg)([(0,h.I)({key:"dashboardConditionClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],J.prototype,"_clipboard",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_yamlMode",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_uiAvailable",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_uiWarnings",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_condition",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_testingResult",void 0),(0,s.Cg)([(0,c.wk)()],J.prototype,"_liveTestResult",void 0),J=(0,s.Cg)([(0,c.EM)("ha-card-condition-editor")],J),o()}catch(H){o(H)}})},13898:function(t,e,i){i.a(t,async function(t,e){try{i(44114),i(18111),i(61701),i(62953);var o=i(40445),s=i(35211),n=i(34271),a=i(5124),r=i(67576),c=i(93905),l=i(1087),h=i(18350),d=i(29823),u=(i(70947),i(67094),i(96332)),_=i(82747),p=i(98204),v=i(82450),g=i(40224),f=i(63518),b=i(12506),y=i(39208),m=i(85726),C=i(41343),w=i(54262),x=i(75076),$=i(9618),M=i(82884),O=t([h,d,v,g,f,b,y,m,C,w,x,$,M,p]);[h,d,v,g,f,b,y,m,C,w,x,$,M,p]=O.then?(await O)():O;let H,k,A,j,V,E=t=>t;const L="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",S="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",q=["location","numeric_state","state","screen","time","user","and","not","or"];class Z extends a.WF{get _noEntity(){var t;return"filter"===(null===(t=this._entityContext)||void 0===t?void 0:t.mode)}firstUpdated(){if(1===this.conditions.length){const t=this.shadowRoot.querySelector("ha-card-condition-editor");t.updateComplete.then(()=>{t.expand()})}}updated(t){if(t.has("conditions")&&this._focusLastConditionOnChange){this._focusLastConditionOnChange=!1;const t=this.shadowRoot.querySelector("ha-card-condition-editor:last-of-type");t.updateComplete.then(()=>{t.expand(),t.scrollIntoView(),t.focus()})}}render(){return(0,a.qy)(H||(H=E` <div class="conditions"> ${0} <div> <ha-dropdown @wa-select="${0}"> <ha-button slot="trigger" appearance="filled"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> ${0} ${0} </ha-dropdown> </div> </div> `),this.conditions.map((t,e)=>(0,a.qy)(k||(k=E` <ha-card-condition-editor .index="${0}" @duplicate-condition="${0}" @value-changed="${0}" .hass="${0}" .condition="${0}"></ha-card-condition-editor> `),e,this._duplicateCondition,this._conditionChanged,this.hass,t)),this._addCondition,S,this.hass.localize("ui.panel.lovelace.editor.condition-editor.add"),this._clipboard?(0,a.qy)(A||(A=E` <ha-dropdown-item value="paste"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> `),this.hass.localize("ui.panel.lovelace.editor.edit_card.paste_condition"),L):a.s6,q.map(t=>(0,a.qy)(j||(j=E` <ha-dropdown-item .value="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> `),t,this.hass.localize(`ui.panel.lovelace.editor.condition-editor.condition.${t}.label`)||t,u.O[t])))}_addCondition(t){const e=t.detail.item.value,i=[...this.conditions];if(e&&("paste"!==e||this._clipboard)){if("paste"===e){const t=(0,n.A)(this._clipboard);i.push(t)}else{const t=customElements.get((0,p.t)(e,this._noEntity)),o=null==t?void 0:t.defaultConfig;i.push(o?Object.assign({},o):{condition:e})}this._focusLastConditionOnChange=!0,(0,l.r)(this,"value-changed",{value:i})}}_duplicateCondition(t){const e=[...this.conditions];e.push(t.detail.value),(0,l.r)(this,"value-changed",{value:e})}_conditionChanged(t){t.stopPropagation();const e=[...this.conditions],i=t.detail.value,o=t.target.index;null===i?e.splice(o,1):e[o]=i,(0,l.r)(this,"value-changed",{value:e})}static get styles(){return[(0,a.AH)(V||(V=E`ha-alert{display:block;margin-top:12px}ha-card-condition-editor{display:block;margin-top:12px;scroll-margin-top:48px}ha-dropdown{display:inline-block;margin-top:var(--ha-space-3)}`))]}constructor(...t){super(...t),this._focusLastConditionOnChange=!1}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],Z.prototype,"hass",void 0),(0,o.Cg)([(0,c.I)({key:"dashboardConditionClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],Z.prototype,"_clipboard",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],Z.prototype,"conditions",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.Fg)({context:_.$,subscribe:!0})],Z.prototype,"_entityContext",void 0),Z=(0,o.Cg)([(0,r.EM)("ha-card-conditions-editor")],Z),e()}catch(H){e(H)}})},82450:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63533),r=i(1087),c=i(52763),l=i(13898),h=t([c,l]);[c,l]=h.then?(await h)():h;let d,u=t=>t;const _=(0,a.Ik)({condition:(0,a.eu)("and"),conditions:(0,a.lq)((0,a.YO)((0,a.bz)()))});class p extends s.WF{static get defaultConfig(){return{condition:"and",conditions:[]}}static validateUIConfig(t){return(0,a.vA)(t,_)}render(){return(0,s.qy)(d||(d=u` <ha-card-conditions-editor nested .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> `),this.hass,this.condition.conditions,this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value,i=Object.assign(Object.assign({},this.condition),{},{conditions:e});(0,r.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),p=(0,o.Cg)([(0,n.EM)("ha-card-condition-and")],p),e()}catch(d){e(d)}})},40224:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63533),r=i(1087),c=(i(30716),i(59646)),l=(i(8630),i(52763)),h=t([c,l]);[c,l]=h.then?(await h)():h;let d,u,_=t=>t;const p=(0,a.Ik)({condition:(0,a.eu)("location"),locations:(0,a.YO)((0,a.Yj)())}),v=[{name:"locations",selector:{state:{entity_id:"person.whomever",hide_states:["unavailable","unknown"],multiple:!0}}}];class g extends s.WF{static get defaultConfig(){return{condition:"location",locations:[]}}static validateUIConfig(t){return(0,a.vA)(t,p)}render(){return(0,s.qy)(d||(d=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}" .computeHelper="${0}"></ha-form> `),this.hass,this.condition,v,this.disabled,this._valueChanged,this._computeLabelCallback,this._computeHelperCallback)}_valueChanged(t){t.stopPropagation();const e=t.detail.value.locations,i=Object.assign(Object.assign({},this.condition),{},{locations:e});(0,r.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1,this._computeLabelCallback=t=>"locations"===t.name?this.hass.localize("ui.panel.lovelace.editor.condition-editor.condition.location.locations"):"",this._computeHelperCallback=t=>"locations"===t.name?this.hass.localize("ui.panel.lovelace.editor.condition-editor.condition.location.locations_helper"):""}}g.styles=(0,s.AH)(u||(u=_`:host{display:block}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),g=(0,o.Cg)([(0,n.EM)("ha-card-condition-location")],g),e()}catch(d){e(d)}})},63518:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63533),r=i(1087),c=i(52763),l=i(13898),h=t([c,l]);[c,l]=h.then?(await h)():h;let d,u=t=>t;const _=(0,a.Ik)({condition:(0,a.eu)("not"),conditions:(0,a.lq)((0,a.YO)((0,a.bz)()))});class p extends s.WF{static get defaultConfig(){return{condition:"not",conditions:[]}}static validateUIConfig(t){return(0,a.vA)(t,_)}render(){return(0,s.qy)(d||(d=u` <ha-card-conditions-editor nested .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> `),this.hass,this.condition.conditions,this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value,i=Object.assign(Object.assign({},this.condition),{},{conditions:e});(0,r.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),p=(0,o.Cg)([(0,n.EM)("ha-card-condition-not")],p),e()}catch(d){e(d)}})},39208:function(t,e,i){i.a(t,async function(t,e){try{var o=i(40445),s=i(67576),n=i(12506),a=t([n]);n=(a.then?(await a)():a)[0];class r extends n.j{static get defaultConfig(){return{condition:"numeric_state"}}}r=(0,o.Cg)([(0,s.EM)("ha-card-condition-numeric_state-no_entity")],r),e()}catch(r){e(r)}})},12506:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{j:function(){return w}});var s=i(86518),n=(i(62953),i(40445)),a=i(35211),r=i(5124),c=i(67576),l=i(22786),h=i(63533),d=i(1087),u=i(52763),_=i(88827),p=i(82747),v=i(28978),g=i(11839),f=t([u,_]);[u,_]=f.then?(await f)():f;const b=["entity"];let y,m=t=>t;const C=(0,h.Ik)({condition:(0,h.eu)("numeric_state"),entity:(0,h.lq)((0,h.Yj)()),attribute:(0,h.lq)((0,h.Yj)()),above:(0,h.lq)((0,h.ai)()),below:(0,h.lq)((0,h.ai)())});class w extends r.WF{static get defaultConfig(){return{condition:"numeric_state",entity:""}}static validateUIConfig(t){return(0,h.vA)(t,C)}render(){const t=this._entityContext,e="current"===(null==t?void 0:t.mode)?t.entityId:void 0,i="filter"===(null==t?void 0:t.mode)?t.entityIds:void 0,o=void 0!==e&&!this.condition.entity,s=o?e:this.condition.entity,n=s?this.hass.states[s]:void 0,a=e?this.hass.states[e]:void 0,c=a?(0,v.u)(a):void 0,l=this.condition.attribute||null==n?void 0:n.attributes.unit_of_measurement,h=Object.assign(Object.assign({},this.condition),{},{entity:o?g.M:this.condition.entity});return(0,r.qy)(y||(y=m` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,h,this._schema(this.hass.localize,e,c,o,i,l),this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(t){t.stopPropagation();const e=Object.assign({},t.detail.value),{entity:i}=e,o=(0,s.A)(e,b),n=i===g.M,a=Object.assign(Object.assign({},o),!n&&i?{entity:i}:{});a.attribute||delete a.attribute,(0,d.r)(this,"value-changed",{value:a})}constructor(...t){super(...t),this.disabled=!1,this._schema=(0,l.A)((t,e,i,o,s,n)=>{const a=void 0===s,r=e?(0,g.Q)(t,e,i):void 0,c=null!=s?s:o&&e?[e]:void 0;return[...a?[{name:"entity",selector:{entity:{extra_options:r?[r]:void 0}}}]:[],{name:"attribute",selector:{attribute:{hide_attributes:_.We,entity_id:c}},context:{filter_entity:"entity"}},{name:"",type:"grid",schema:[{name:"above",selector:{number:{step:"any",mode:"box",unit_of_measurement:n}}},{name:"below",selector:{number:{step:"any",mode:"box",unit_of_measurement:n}}}]}]}),this._computeLabelCallback=t=>{switch(t.name){case"entity":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.panel.lovelace.editor.condition-editor.condition.numeric_state.attribute");case"below":case"above":return this.hass.localize(`ui.panel.lovelace.editor.condition-editor.condition.numeric_state.${t.name}`);default:return""}}}}(0,n.Cg)([(0,c.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,n.Cg)([(0,c.MZ)({attribute:!1})],w.prototype,"condition",void 0),(0,n.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,n.Cg)([(0,c.wk)(),(0,a.Fg)({context:p.$,subscribe:!0})],w.prototype,"_entityContext",void 0),w=(0,n.Cg)([(0,c.EM)("ha-card-condition-numeric_state")],w),o()}catch(b){o(b)}})},85726:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63533),r=i(1087),c=i(52763),l=i(13898),h=t([c,l]);[c,l]=h.then?(await h)():h;let d,u=t=>t;const _=(0,a.Ik)({condition:(0,a.eu)("or"),conditions:(0,a.lq)((0,a.YO)((0,a.bz)()))});class p extends s.WF{static get defaultConfig(){return{condition:"or",conditions:[]}}static validateUIConfig(t){return(0,a.vA)(t,_)}render(){return(0,s.qy)(d||(d=u` <ha-card-conditions-editor nested .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> `),this.hass,this.condition.conditions,this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value,i=Object.assign(Object.assign({},this.condition),{},{conditions:e});(0,r.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.disabled=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),p=(0,o.Cg)([(0,n.EM)("ha-card-condition-or")],p),e()}catch(d){e(d)}})},41343:function(t,e,i){i.a(t,async function(t,e){try{i(16280),i(44114),i(26910),i(18111),i(22489),i(61701),i(45367),i(92731),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(22786),r=i(36091),c=i(1087),l=i(52763),h=t([l]);l=(h.then?(await h)():h)[0];let u,_=t=>t;const p=[0,768,1024,1280,1/0],v=["mobile","tablet","desktop","wide"];function g(t){if(0===t.length)return[];[...t].sort((t,e)=>t[0]-e[0]);const e=[t[0]];for(let i=1;i<t.length;i++){const o=t[i],s=e[e.length-1];o[0]<=s[1]+1?s[1]=o[1]:e.push(o)}return e}function f(t){const[e,i]=t,o=[];return null!=e&&o.push(`(min-width: ${e}px)`),null!=i&&i!==1/0&&o.push(`(max-width: ${i-1}px)`),o.join(" and ")}function b(t){return g(t.map(t=>{const e=v.indexOf(t);return[p[e],p[e+1]||1/0]})).map(t=>f(t)).filter(t=>t).join(", ")}function y(t){return[...t].sort().join("_")}const m=(0,r.a)(v).filter(t=>0!==t.length).map(t=>[t,b(t)]),C=new Map(m.map(([t,e])=>[y(t),e])),w=new Map(m.map(([t,e])=>[e,t]));class x extends s.WF{static get defaultConfig(){return{condition:"screen",media_query:""}}static validateUIConfig(t,e){if(!(!t.media_query||w.has(t.media_query)))throw new Error(e.localize("ui.errors.config.media_query_not_supported"))}render(){const t=this.condition.media_query?w.get(this.condition.media_query):void 0,e={breakpoints:null!=t?t:[]};return(0,s.qy)(u||(u=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,e,this._schema(this.hass.localize),this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(t){var e;t.stopPropagation();const i=t.detail.value,{breakpoints:o}=i,s={condition:"screen",media_query:null!==(e=C.get(y(o)))&&void 0!==e?e:""};(0,c.r)(this,"value-changed",{value:s})}constructor(...t){super(...t),this.disabled=!1,this._schema=(0,a.A)(t=>[{name:"breakpoints",selector:{select:{mode:"list",options:v.map(e=>{const i=p[v.indexOf(e)];return{value:e,label:`${t(`ui.panel.lovelace.editor.condition-editor.condition.screen.breakpoints_list.${e}`)}${i?` (${t("ui.panel.lovelace.editor.condition-editor.condition.screen.min",{size:i})})`:""}`}}),multiple:!0}}}]),this._computeLabelCallback=t=>"breakpoints"===t.name?this.hass.localize(`ui.panel.lovelace.editor.condition-editor.condition.screen.${t.name}`):""}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],x.prototype,"disabled",void 0),x=(0,o.Cg)([(0,n.EM)("ha-card-condition-screen")],x),e()}catch(d){e(d)}})},75076:function(t,e,i){i.a(t,async function(t,e){try{var o=i(40445),s=i(67576),n=i(54262),a=t([n]);n=(a.then?(await a)():a)[0];class r extends n.W{static get defaultConfig(){return{condition:"state",state:""}}}r=(0,o.Cg)([(0,s.EM)("ha-card-condition-state-no_entity")],r),e()}catch(r){e(r)}})},54262:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{W:function(){return x}});var s=i(86518),n=(i(62953),i(40445)),a=i(35211),r=i(5124),c=i(67576),l=i(22786),h=i(63533),d=i(1087),u=i(52763),_=i(88827),p=i(82747),v=i(28978),g=i(11839),f=t([u,_]);[u,_]=f.then?(await f)():f;let b,y=t=>t;const m=["state","state_not"],C=["invert","state","entity","condition"],w=(0,h.Ik)({condition:(0,h.eu)("state"),entity:(0,h.lq)((0,h.Yj)()),attribute:(0,h.lq)((0,h.Yj)()),state:(0,h.lq)((0,h.Yj)()),state_not:(0,h.lq)((0,h.Yj)())});class x extends r.WF{static get defaultConfig(){return{condition:"state",entity:"",state:""}}static validateUIConfig(t){return(0,h.vA)(t,w)}render(){var t;const e=this.condition,{state:i,state_not:o}=e,n=(0,s.A)(e,m),a=this._entityContext,c="current"===(null==a?void 0:a.mode)?a.entityId:void 0,l="filter"===(null==a?void 0:a.mode)?a.entityIds:void 0,h=void 0!==c&&!this.condition.entity,d=c?this.hass.states[c]:void 0,u=d?(0,v.u)(d):void 0,_=Object.assign(Object.assign({},n),{},{entity:h?g.M:this.condition.entity,invert:void 0!==this.condition.state_not?"true":"false",state:null!==(t=this.condition.state_not)&&void 0!==t?t:this.condition.state});return(0,r.qy)(b||(b=y` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}" .computeLabel="${0}"></ha-form> `),this.hass,_,this._schema(this.hass.localize,c,u,h,l),this.disabled,this._valueChanged,this._computeLabelCallback)}_valueChanged(t){t.stopPropagation();const e=t.detail.value,{invert:i,state:o,entity:n,condition:a}=e,r=(0,s.A)(e,C),c=n===g.M,l=Object.assign(Object.assign(Object.assign({condition:"state"},r),!c&&n?{entity:n}:{}),{},{state:"false"===i?null!=o?o:"":void 0,state_not:"true"===i?null!=o?o:"":void 0});l.attribute||delete l.attribute,(0,d.r)(this,"value-changed",{value:l})}constructor(...t){super(...t),this.disabled=!1,this._schema=(0,l.A)((t,e,i,o,s)=>{const n=e?(0,g.Q)(t,e,i):void 0,a=null!=s?s:o&&e?[e]:void 0;return[...void 0===s?[{name:"entity",selector:{entity:{extra_options:n?[n]:void 0}}}]:[],{name:"attribute",selector:{attribute:{hide_attributes:_.B9,entity_id:a}},context:{filter_entity:"entity"}},{name:"",type:"grid",schema:[{name:"invert",required:!0,selector:{select:{mode:"dropdown",options:[{label:t("ui.panel.lovelace.editor.condition-editor.condition.state.state_equal"),value:"false"},{label:t("ui.panel.lovelace.editor.condition-editor.condition.state.state_not_equal"),value:"true"}]}}},{name:"state",selector:{state:{entity_id:a}},context:{filter_entity:"entity",filter_attribute:"attribute"}}]}]}),this._computeLabelCallback=t=>{switch(t.name){case"entity":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.panel.lovelace.editor.condition-editor.condition.state.attribute");case"state":return this.hass.localize("ui.components.entity.entity-state-picker.state");default:return""}}}}(0,n.Cg)([(0,c.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,n.Cg)([(0,c.MZ)({attribute:!1})],x.prototype,"condition",void 0),(0,n.Cg)([(0,c.MZ)({type:Boolean})],x.prototype,"disabled",void 0),(0,n.Cg)([(0,c.wk)(),(0,a.Fg)({context:p.$,subscribe:!0})],x.prototype,"_entityContext",void 0),x=(0,n.Cg)([(0,c.EM)("ha-card-condition-state")],x),o()}catch(b){o(b)}})},9618:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(61701),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(63533),r=i(22786),c=i(96029),l=i(1087),h=i(52763),d=t([h]);h=(d.then?(await d)():d)[0];let u,_=t=>t;const p=(0,a.Ik)({condition:(0,a.eu)("time"),after:(0,a.lq)((0,a.Yj)()),before:(0,a.lq)((0,a.Yj)()),weekdays:(0,a.lq)((0,a.YO)((0,a.vP)(c.ZV)))});class v extends s.WF{static get defaultConfig(){return{condition:"time",after:"08:00",before:"17:00"}}static validateUIConfig(t){return(0,a.vA)(t,p)}render(){return(0,s.qy)(u||(u=_` <ha-form .hass="${0}" .data="${0}" .computeLabel="${0}" .schema="${0}" .disabled="${0}" @value-changed="${0}"></ha-form> `),this.hass,this.condition,this._computeLabelCallback,this._schema(this.hass.localize),this.disabled,this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value;(0,l.r)(this,"value-changed",{value:e})}constructor(...t){super(...t),this.disabled=!1,this._schema=(0,r.A)(t=>[{name:"after",selector:{time:{no_second:!0}}},{name:"before",selector:{time:{no_second:!0}}},{name:"weekdays",selector:{select:{mode:"list",multiple:!0,options:c.ZV.map(e=>({value:e,label:t(`ui.weekdays.${c.Tq[e]}`)}))}}}]),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.lovelace.editor.condition-editor.condition.time.${t.name}`)}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"disabled",void 0),v=(0,o.Cg)([(0,n.EM)("ha-card-condition-time")],v),e()}catch(u){e(u)}})},82884:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(26910),i(18111),i(22489),i(61701),i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(22786),r=i(63533),c=i(1087),l=i(52220),h=(i(30716),i(8630),i(59646)),d=(i(78673),i(28669)),u=t([h]);h=(u.then?(await u)():u)[0];let _,p,v,g=t=>t;const f=(0,r.Ik)({condition:(0,r.eu)("user"),users:(0,r.YO)((0,r.Yj)())});class b extends s.WF{static get defaultConfig(){return{condition:"user",users:[]}}static validateUIConfig(t){return(0,r.vA)(t,f)}async firstUpdated(t){super.firstUpdated(t),this._fetchUsers()}async _fetchUsers(){const t=await(0,d.hU)(this.hass);this._users=t.filter(t=>!t.system_generated)}render(){var t;const e=null!==(t=this.condition.users)&&void 0!==t?t:[];return(0,s.qy)(_||(_=g` <ha-list @selected="${0}" multi> ${0} </ha-list> `),this._handleSelected,this._sortedUsers(this._users).map(t=>(0,s.qy)(p||(p=g` <ha-check-list-item graphic="avatar" hasMeta .selected="${0}"> <ha-user-badge slot="graphic" .hass="${0}" .user="${0}"></ha-user-badge> <span>${0}</span> </ha-check-list-item> `),e.includes(t.id),this.hass,t,t.name)))}_handleSelected(t){var e;const i=this._sortedUsers(this._users);let o=null!==(e=this.condition.users)&&void 0!==e?e:[];t.detail.diff.added.length?o=[...o,i[t.detail.diff.added[0]].id]:t.detail.diff.removed.length&&(o=o.filter(e=>e!==i[t.detail.diff.removed[0]].id));const s=Object.assign(Object.assign({},this.condition),{},{users:o});(0,c.r)(this,"value-changed",{value:s})}constructor(...t){super(...t),this.disabled=!1,this._users=[],this._sortedUsers=(0,a.A)(t=>t.sort((t,e)=>(0,l.xL)(t.name,e.name,this.hass.locale.language)))}}b.styles=(0,s.AH)(v||(v=g`:host{display:block}ha-list{--mdc-list-vertical-padding:0}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"condition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"disabled",void 0),(0,o.Cg)([(0,n.wk)()],b.prototype,"_users",void 0),b=(0,o.Cg)([(0,n.EM)("ha-card-condition-user")],b),e()}catch(_){e(_)}})},7382:function(t,e,i){i.d(e,{U:function(){return s}});let o;const s=(0,i(5124).AH)(o||(o=(t=>t)`.card-config{overflow:auto}ha-switch{padding:16px 6px}.side-by-side{display:flex;align-items:flex-end}.side-by-side>*{flex:1;padding-right:8px;padding-inline-end:8px;padding-inline-start:initial}.side-by-side>:last-child{flex:1;padding-right:0;padding-inline-end:0;padding-inline-start:initial}.suffix{margin:0 8px}ha-icon-picker,ha-input,ha-select,hui-action-editor{margin-top:8px;display:block}ha-expansion-panel{display:block;--expansion-panel-content-padding:0;border-radius:var(--ha-border-radius-md);--ha-card-border-radius:var(--ha-border-radius-md)}ha-expansion-panel .content{padding:12px}ha-expansion-panel>[slot=header]{margin:0;font-size:inherit;font-weight:inherit}ha-expansion-panel ha-svg-icon{color:var(--secondary-text-color)}`))},21187:function(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{DEFAULT_CONFIG:function(){return M},HuiHeadingEntityEditor:function(){return H}});i(74423),i(44114),i(62953);var s=i(40445),n=i(35211),a=i(5124),r=i(67576),c=i(22786),l=i(63533),h=i(1087),d=(i(11382),i(52763)),u=i(999),_=i(82747),p=i(13898),v=i(7382),g=i(91408),f=i(44155),b=t([d,p,u]);[d,p,u]=b.then?(await b)():b;let y,m,C=t=>t;const w="M12,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,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",x="M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",$="M4,9H20V11H4V9M4,13H14V15H4V13Z",M={type:"entity",show_state:!0,show_icon:!0},O=(0,l.Ik)({type:(0,l.lq)((0,l.Yj)()),entity:(0,l.lq)((0,l.Yj)()),name:(0,l.lq)(f.q),icon:(0,l.lq)((0,l.Yj)()),state_content:(0,l.lq)((0,l.KC)([(0,l.Yj)(),(0,l.YO)((0,l.Yj)())])),show_state:(0,l.lq)((0,l.zM)()),show_icon:(0,l.lq)((0,l.zM)()),color:(0,l.lq)((0,l.Yj)()),tap_action:(0,l.lq)(g.kn),hold_action:(0,l.lq)(g.kn),double_tap_action:(0,l.lq)(g.kn),visibility:(0,l.lq)((0,l.YO)((0,l.bz)()))});class H extends a.WF{setConfig(t){(0,l.vA)(t,O),this._config=Object.assign(Object.assign({},M),t)}willUpdate(t){var e;t.has("_config")&&this._contextProvider.setValue(null!==(e=this._config)&&void 0!==e&&e.entity?{mode:"current",entityId:this._config.entity}:void 0)}render(){var t;if(!this.hass||!this._config)return a.s6;const e=this._schema(this.hass.localize),i=Object.assign(Object.assign({},this._config),{},{displayed_elements:this._displayedElements(this._config)}),o=null!==(t=this._config.visibility)&&void 0!==t?t:[];return(0,a.qy)(y||(y=C` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path="${0}"></ha-svg-icon> <h3 slot="header"> ${0} </h3> <div class="content"> <p class="intro"> ${0} </p> <ha-card-conditions-editor .hass="${0}" .conditions="${0}" @value-changed="${0}"> </ha-card-conditions-editor> </div> </ha-expansion-panel> `),this.hass,i,e,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged,w,this.hass.localize("ui.panel.lovelace.editor.card.heading.entity_config.visibility"),this.hass.localize("ui.panel.lovelace.editor.card.heading.entity_config.visibility_explanation"),this.hass,o,this._conditionChanged)}_valueChanged(t){if(t.stopPropagation(),!this._config||!this.hass)return;const e=Object.assign({},t.detail.value);e.displayed_elements&&(e.show_state=e.displayed_elements.includes("state"),e.show_icon=e.displayed_elements.includes("icon"),delete e.displayed_elements),(0,h.r)(this,"config-changed",{config:e})}_conditionChanged(t){var e;if(t.stopPropagation(),!this._config||!this.hass)return;const i=t.detail.value,o=Object.assign(Object.assign({},this._config),{},{visibility:i});0===(null===(e=o.visibility)||void 0===e?void 0:e.length)&&delete o.visibility,(0,h.r)(this,"config-changed",{config:o})}static get styles(){return[v.U,(0,a.AH)(m||(m=C`.container{display:flex;flex-direction:column}ha-form{display:block;margin-bottom:24px}.intro{margin:0;color:var(--secondary-text-color);margin-bottom:8px}`))]}constructor(...t){super(...t),this.preview=!1,this._contextProvider=new n.DT(this,{context:_.$,initialValue:void 0}),this._schema=(0,c.A)(t=>[{name:"entity",selector:{entity:{}}},{name:"content",type:"expandable",flatten:!0,iconPath:$,schema:[{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"",type:"grid",schema:[{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}},{name:"color",selector:{ui_color:{default_color:"none",include_state:!0,include_none:!0}}}]},{name:"displayed_elements",selector:{select:{mode:"list",multiple:!0,options:[{value:"state",label:t("ui.panel.lovelace.editor.card.heading.entity_config.displayed_elements_options.state")},{value:"icon",label:t("ui.panel.lovelace.editor.card.heading.entity_config.displayed_elements_options.icon")}]}}},{name:"state_content",selector:{ui_state_content:{allow_name:!0}},context:{filter_entity:"entity"}}]},{name:"interactions",type:"expandable",flatten:!0,iconPath:x,schema:[{name:"tap_action",selector:{ui_action:{default_action:"none"}},context:u.Tq},{name:"",type:"optional_actions",flatten:!0,schema:["hold_action","double_tap_action"].map(t=>({name:t,selector:{ui_action:{default_action:"none"}},context:u.Tq}))}]}]),this._displayedElements=(0,c.A)(t=>{const e=[];return t.show_state&&e.push("state"),t.show_icon&&e.push("icon"),e}),this._computeLabelCallback=t=>{switch(t.name){case"state_content":case"displayed_elements":case"color":return this.hass.localize(`ui.panel.lovelace.editor.card.heading.entity_config.${t.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}},this._computeHelperCallback=t=>{switch(t.name){case"color":return this.hass.localize(`ui.panel.lovelace.editor.card.heading.entity_config.${t.name}_helper`);case"name":return this.hass.localize("ui.panel.lovelace.editor.card.heading.entity_config.name_helper");default:return}}}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"preview",void 0),(0,s.Cg)([(0,r.wk)()],H.prototype,"_config",void 0),H=(0,s.Cg)([(0,r.EM)("hui-heading-entity-editor")],H),o()}catch(y){o(y)}})},91408:function(t,e,i){i.d(e,{dk:function(){return n},kn:function(){return u}});var o=i(63533);const s=(0,o.Ik)({user:(0,o.Yj)()}),n=(0,o.KC)([(0,o.zM)(),(0,o.Ik)({text:(0,o.lq)((0,o.Yj)()),excemptions:(0,o.lq)((0,o.YO)(s))})]),a=(0,o.Ik)({action:(0,o.eu)("url"),url_path:(0,o.Yj)(),confirmation:(0,o.lq)(n)}),r=(0,o.Ik)({action:(0,o.vP)(["call-service","perform-action"]),service:(0,o.lq)((0,o.Yj)()),perform_action:(0,o.lq)((0,o.Yj)()),service_data:(0,o.lq)((0,o.Ik)()),data:(0,o.lq)((0,o.Ik)()),target:(0,o.lq)((0,o.Ik)({entity_id:(0,o.lq)((0,o.KC)([(0,o.Yj)(),(0,o.YO)((0,o.Yj)())])),device_id:(0,o.lq)((0,o.KC)([(0,o.Yj)(),(0,o.YO)((0,o.Yj)())])),area_id:(0,o.lq)((0,o.KC)([(0,o.Yj)(),(0,o.YO)((0,o.Yj)())])),floor_id:(0,o.lq)((0,o.KC)([(0,o.Yj)(),(0,o.YO)((0,o.Yj)())])),label_id:(0,o.lq)((0,o.KC)([(0,o.Yj)(),(0,o.YO)((0,o.Yj)())]))})),confirmation:(0,o.lq)(n)}),c=(0,o.Ik)({action:(0,o.eu)("navigate"),navigation_path:(0,o.Yj)(),navigation_replace:(0,o.lq)((0,o.zM)()),confirmation:(0,o.lq)(n)}),l=(0,o.NW)({action:(0,o.eu)("assist"),pipeline_id:(0,o.lq)((0,o.Yj)()),start_listening:(0,o.lq)((0,o.zM)())}),h=(0,o.NW)({action:(0,o.eu)("more-info"),entity:(0,o.lq)((0,o.Yj)())}),d=(0,o.Ik)({action:(0,o.vP)(["none","toggle","more-info","call-service","perform-action","url","navigate","assist"]),confirmation:(0,o.lq)(n)}),u=(0,o.OR)(t=>{if(t&&"object"==typeof t&&"action"in t)switch(t.action){case"call-service":case"perform-action":return r;case"navigate":return c;case"url":return a;case"assist":return l;case"more-info":return h}return d})},44155:function(t,e,i){i.d(e,{q:function(){return n}});var o=i(63533);const s=(0,o.KC)([(0,o.Ik)({type:(0,o.eu)("text"),text:(0,o.Yj)()}),(0,o.Ik)({type:(0,o.KC)([(0,o.eu)("entity"),(0,o.eu)("device"),(0,o.eu)("area"),(0,o.eu)("floor")])}),(0,o.Yj)()]),n=(0,o.KC)([s,(0,o.YO)(s)])},90285:function(t,e,i){i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(89784),r=i(6412),c=i(78870),l=(i(48374),i(47680),i(19037)),h=i(22064),d=i(97176);let u,_,p,v,g=t=>t;const f={tap_action:{action:"none"},hold_action:{action:"none"},double_tap_action:{action:"none"}};class b extends s.WF{static async getConfigElement(){return await i.e(71751).then(i.bind(i,16282)),document.createElement("hui-button-heading-badge-editor")}static getStubConfig(){return{type:"button",icon:"mdi:gesture-tap-button"}}setConfig(t){this._config=Object.assign(Object.assign({},f),t)}get hasAction(){var t,e,i;return(0,d.h)(null===(t=this._config)||void 0===t?void 0:t.tap_action)||(0,d.h)(null===(e=this._config)||void 0===e?void 0:e.hold_action)||(0,d.h)(null===(i=this._config)||void 0===i?void 0:i.double_tap_action)}_handleAction(t){(0,h.$)(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config)return s.s6;const t=this._config,e=t.color?(0,c.MP)(t.color):void 0,i={"--color":e};return(0,s.qy)(u||(u=g` <ha-control-button @action="${0}" .actionHandler="${0}" style="${0}" .label="${0}" class="${0}"> <span class="content"> ${0} ${0} </span> </ha-control-button> `),this._handleAction,(0,l.T)({hasHold:(0,d.h)(this._config.hold_action),hasDoubleClick:(0,d.h)(this._config.double_tap_action)}),(0,a.W)(i),t.text,(0,r.H)({colored:!!e,"with-text":!!t.text}),t.icon?(0,s.qy)(_||(_=g`<ha-icon .icon="${0}"></ha-icon>`),t.icon):s.s6,t.text?(0,s.qy)(p||(p=g`<span class="text">${0}</span>`),t.text):s.s6)}constructor(...t){super(...t),this.preview=!1}}b.styles=(0,s.AH)(v||(v=g`ha-control-button{--control-button-border-radius:var(
        --ha-heading-badge-border-radius,
        var(--ha-border-radius-pill)
      );--control-button-padding:0;--mdc-icon-size:var(--ha-heading-badge-icon-size, 16px);width:auto;height:var(--ha-heading-badge-size,26px);min-width:var(--ha-heading-badge-size,26px);font-size:var(--ha-heading-badge-font-size, var(--ha-font-size-s));font-weight:var(--ha-font-weight-medium)}ha-control-button.with-text{--control-button-padding:0 var(--ha-space-2)}ha-control-button.colored{--control-button-icon-color:var(--color);--control-button-background-color:var(--color);--control-button-focus-color:var(--color);--control-button-background-opacity:0.2;--ha-ripple-color:var(--color)}.content{display:flex;flex-direction:row;align-items:center;white-space:nowrap}.text{padding:0 var(--ha-space-1);line-height:1}ha-icon{line-height:1}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,o.Cg)([(0,n.wk)()],b.prototype,"_config",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"preview",void 0),b=(0,o.Cg)([(0,n.EM)("hui-button-heading-badge")],b)},16678:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var o=i(40445),s=i(5124),n=i(67576),a=i(89784),r=i(22786),c=i(78870),l=i(79468),h=i(71727),d=i(47129),u=i(52658),_=(i(51336),i(93367)),p=i(14020),v=i(19037),g=i(13632),f=i(22064),b=i(97176),y=i(21187),m=t([_,p,y]);[_,p,y]=m.then?(await m)():m;let C,w,x,$,M,O=t=>t;const H="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",k={tap_action:{action:"none"},hold_action:{action:"none"},double_tap_action:{action:"none"}};class A extends s.WF{static async getConfigElement(){return await Promise.resolve().then(i.bind(i,21187)),document.createElement("hui-heading-entity-editor")}static getStubConfig(t){const e=Object.keys(t.states);return{type:"entity",entity:(0,g.B)(t,1,e,[],["sensor","light","switch"])[0]||""}}setConfig(t){this._config=Object.assign(Object.assign(Object.assign({},y.DEFAULT_CONFIG),k),t)}get hasAction(){var t,e,i;return(0,b.h)(null===(t=this._config)||void 0===t?void 0:t.tap_action)||(0,b.h)(null===(e=this._config)||void 0===e?void 0:e.hold_action)||(0,b.h)(null===(i=this._config)||void 0===i?void 0:i.double_tap_action)}_handleAction(t){(0,f.$)(this,this.hass,this._config,t.detail.action)}render(){if(!this.hass||!this._config)return s.s6;const t=this._config,e=t.entity,i=this.hass.states[e];if(!i)return(0,s.qy)(C||(C=O` <ha-heading-badge class="error" .title="${0}"> <ha-svg-icon slot="icon" .hass="${0}" .path="${0}"></ha-svg-icon> - </ha-heading-badge> `),e,this.hass,H);const o={"--icon-color":this._computeStateColor(i,t.color)},n=this.hass.formatEntityName(i,this._config.name);return(0,s.qy)(w||(w=O` <ha-heading-badge .type="${0}" @action="${0}" .actionHandler="${0}" style="${0}" .title="${0}"> ${0} ${0} </ha-heading-badge> `),this.hasAction?"button":"badge",this._handleAction,(0,v.T)({hasHold:(0,b.h)(this._config.hold_action),hasDoubleClick:(0,b.h)(this._config.double_tap_action)}),(0,a.W)(o),n,t.show_icon?(0,s.qy)(x||(x=O` <ha-state-icon slot="icon" .icon="${0}" .stateObj="${0}"></ha-state-icon> `),t.icon,i):s.s6,t.show_state?(0,s.qy)($||($=O` <state-display .hass="${0}" .stateObj="${0}" .content="${0}" .name="${0}" dash-unavailable></state-display> `),this.hass,i,t.state_content,n):s.s6)}constructor(...t){super(...t),this.preview=!1,this._computeStateColor=(0,r.A)((t,e)=>{if(e&&"none"!==e){if("state"===e){if("light"===(0,h.m)(t.entity_id)&&t.attributes.rgb_color){const e=(0,l.bi)(t.attributes.rgb_color);return e[1]<.4&&(e[1]<.1?e[2]=225:e[1]=.4),(0,l.v2)((0,l.hT)(e))}return(0,u.Se)(t)}return e?(0,d.a)(t)?(0,c.MP)(e):void 0:e}})}}A.styles=(0,s.AH)(M||(M=O`[role=button]{cursor:pointer}ha-heading-badge{--state-inactive-color:initial}ha-heading-badge.error{--icon-color:var(--red-color)}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,o.Cg)([(0,n.wk)()],A.prototype,"_config",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],A.prototype,"preview",void 0),A=(0,o.Cg)([(0,n.EM)("hui-entity-heading-badge")],A),e()}catch(C){e(C)}})},20380:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{X:function(){return b}});i(44114),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(89784),c=i(53610),l=i(52658),h=i(10223),d=i(22675),u=i(88827),_=t([h,c,u]);[h,c,u]=_.then?(await _)():_;let v,g,f=t=>t;function b(){const t=[];for(let e=0;e<24;e++){const i=e/24,o=i+e/576*.8+.2/24;0!==e&&t.push([i,"transparent"]),t.push([i,"var(--control-slider-color)"]),t.push([o,"var(--control-slider-color)"]),t.push([o,"transparent"])}return(0,n.iz)(t.map(([t,e])=>`${e} ${100*t}%`).join(", "))}const y=b();class m extends n.WF{updated(t){t.has("stateObj")&&(this.value=null!=this.stateObj.attributes.current_tilt_position?Math.round(this.stateObj.attributes.current_tilt_position):void 0)}_valueChanged(t){const{value:e}=t.detail;"number"!=typeof e||isNaN(e)||this.hass.callService("cover","set_cover_tilt_position",{entity_id:this.stateObj.entity_id,tilt_position:e})}render(){const t=(0,l.Se)(this.stateObj,"open"),e=(0,l.Se)(this.stateObj);return(0,n.qy)(v||(v=f` <ha-control-slider touch-action="none" vertical .value="${0}" min="0" max="100" mode="cursor" @value-changed="${0}" .label="${0}" style="${0}" .disabled="${0}" .unit="${0}" .locale="${0}"> <div slot="background" class="gradient"></div> </ha-control-slider> `),this.value,this._valueChanged,(0,c.computeAttributeNameDisplay)(this.hass.localize,this.stateObj,this.hass.entities,"current_tilt_position"),(0,r.W)({"--state-cover-inactive-color":t,"--control-slider-color":e,"--control-slider-background":e}),this.stateObj.state===d.Hh,u.rM.cover.current_tilt_position,this.hass.locale)}static get styles(){return(0,n.AH)(g||(g=f`ha-control-slider{height:45vh;max-height:320px;min-height:200px;--control-slider-thickness:130px;--control-slider-border-radius:var(--ha-border-radius-6xl);--control-slider-color:var(--primary-color);--control-slider-background:var(--disabled-color);--control-slider-background-opacity:0.2;--control-slider-tooltip-font-size:var(--ha-font-size-xl)}.gradient{background:-webkit-linear-gradient(top,${0});opacity:.6}`),y)}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"stateObj",void 0),(0,s.Cg)([(0,a.wk)()],m.prototype,"value",void 0),m=(0,s.Cg)([(0,a.EM)("ha-state-control-cover-tilt-position")],m),o()}catch(p){o(p)}})},14020:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{HS:function(){return M},p4:function(){return $}});i(74423),i(18111),i(22489),i(61701),i(3362),i(27495),i(25440),i(62953);var s=i(40445),n=i(5124),a=i(67576),r=i(20202),c=i(44537),l=i(69093),h=(i(46190),i(36158)),d=i(22675),u=i(64808),_=i(24247),p=i(62688),v=t([h,p,_]);[h,p,_]=v.then?(await v)():v;let g,f,b,y,m,C,w=t=>t;const x=["button","infrared","input_button","radio_frequency","scene"],$=["remaining_time","install_status"],M={timer:["remaining_time"],update:["install_status"]},O={valve:["current_position"],cover:["current_position"],fan:["percentage"],light:["brightness"]},H={climate:["state","current_temperature"],cover:["state","current_position"],fan:"percentage",humidifier:["state","current_humidity"],light:"brightness",timer:"remaining_time",update:"install_status",valve:["state","current_position"]};class k extends n.WF{createRenderRoot(){return this}get _content(){var t,e;const i=(0,l.t)(this.stateObj);return null!==(t=null!==(e=this.content)&&void 0!==e?e:H[i])&&void 0!==t?t:"state"}_computeContent(t){var e,o;const s=this.stateObj,a=(0,l.t)(s);if("state"===t){const t=s.state===d.Hh||s.state===d.HV;return this.dashUnavailable&&t?"—":!u.G6.includes(this.stateObj.attributes.device_class)&&!x.includes(a)||t?this.hass.formatEntityState(s):(0,n.qy)(g||(g=w` <hui-timestamp-display .hass="${0}" .ts="${0}" .format="${0}" capitalize></hui-timestamp-display> `),this.hass,new Date(s.state),"uptime"===this.stateObj.attributes.device_class?"total":"relative")}if("name"===t&&this.name)return(0,n.qy)(f||(f=w`${0}`),this.name);if("device_name"===t||"area_name"===t||"floor_name"===t){const e=t.replace("_name","");return this.hass.formatEntityName(s,{type:e})||void 0}let r;if("last_changed"!==t&&"last-changed"!==t||(r=s.last_changed),"last_updated"!==t&&"last-updated"!==t||(r=s.last_updated),"input_datetime"===a&&"timestamp"===t&&(r=new Date(1e3*s.attributes.timestamp)),"last_triggered"!==t&&("calendar"!==a||"start_time"!==t&&"end_time"!==t)&&("sun"!==a||"next_dawn"!==t&&"next_dusk"!==t&&"next_midnight"!==t&&"next_noon"!==t&&"next_rising"!==t&&"next_setting"!==t)||(r=s.attributes[t]),r)return(0,n.qy)(b||(b=w` <ha-relative-time .hass="${0}" .datetime="${0}" capitalize></ha-relative-time> `),this.hass,r);if((null!==(e=M[a])&&void 0!==e?e:[]).includes(t)){if("install_status"===t)return(0,n.qy)(y||(y=w` ${0} `),(0,_.A_)(s,this.hass));if("remaining_time"===t)return i.e(20283).then(i.bind(i,5078)),(0,n.qy)(m||(m=w` <ha-timer-remaining-time .hass="${0}" .stateObj="${0}"></ha-timer-remaining-time> `),this.hass,s)}const c=s.attributes[t];return null==c||null!==(o=O[a])&&void 0!==o&&o.includes(t)&&!c?void 0:this.hass.formatEntityAttributeValue(s,t)}render(){const t=this.stateObj,e=(0,c.e)(this._content).map(t=>this._computeContent(t)).filter(Boolean);return e.length?(0,r.f)(e," · "):(0,n.qy)(C||(C=w`${0}`),this.hass.formatEntityState(t))}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"stateObj",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"content",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],k.prototype,"name",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,attribute:"dash-unavailable"})],k.prototype,"dashUnavailable",void 0),k=(0,s.Cg)([(0,a.EM)("state-display")],k),o()}catch(g){o(g)}})}}]);