iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
61 lines • 86.1 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[4988],{93421:function(e,t,i){i.d(t,{IW:function(){return d},dH:function(){return c},fI:function(){return l}});i(44114),i(62953);var a=i(35211),o=i(22792),r=i(32172);const s=(e,t)=>{let i=e;for(const a of t){if(null==i)return;i=i[a]}return i},n=(e,t,i)=>{const o=(0,r.p)({transformer:function(e){return i.call(this,e)},watch:t?[t]:[]}),s=(0,a.Fg)({context:e,subscribe:!0});return(e,t)=>{o(e,t),s(e,t)}},l=e=>n(o.iN,e.entityIdPath[0],function(t){const i=s(this,e.entityIdPath);return"string"==typeof i?null==t?void 0:t[i]:void 0}),c=e=>n(o.X1,e.entityIdPath[0],function(t){const i=s(this,e.entityIdPath);return"string"==typeof i?null==t?void 0:t[i]:void 0}),d=()=>n(o.D5,void 0,({localize:e})=>e)},93905:function(e,t,i){i.d(t,{I:function(){return r}});i(16280),i(44114),i(18111),i(7588),i(69112),i(33110);class a{addFromStorage(e){if(!this._storage[e]){const t=this.storage.getItem(e);t&&(this._storage[e]=JSON.parse(t))}}subscribeChanges(e,t){return this._listeners[e]?this._listeners[e].push(t):this._listeners[e]=[t],()=>{this.unsubscribeChanges(e,t)}}unsubscribeChanges(e,t){if(!(e in this._listeners))return;const i=this._listeners[e].indexOf(t);-1!==i&&this._listeners[e].splice(i,1)}hasKey(e){return e in this._storage}getValue(e){return this._storage[e]}setValue(e,t){const i=this._storage[e];this._storage[e]=t;try{void 0===t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify(t))}catch(a){}finally{this._listeners[e]&&this._listeners[e].forEach(e=>e(i,t))}}constructor(e=window.localStorage){this._storage={},this._listeners={},this.storage=e,this.storage===window.localStorage&&window.addEventListener("storage",e=>{e.key&&this.hasKey(e.key)&&(this._storage[e.key]=e.newValue?JSON.parse(e.newValue):e.newValue,this._listeners[e.key]&&this._listeners[e.key].forEach(t=>t(e.oldValue?JSON.parse(e.oldValue):e.oldValue,this._storage[e.key])))})}}const o={};function r(e){return(t,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const r=e.storage||"localStorage";let s;r&&r in o?s=o[r]:(s=new a(window[r]),o[r]=s);const n=e.key||String(i);s.addFromStorage(n);const l=!1!==e.subscribe?e=>s.subscribeChanges(n,(t,a)=>{e.requestUpdate(i,t)}):void 0,c=()=>s.hasKey(n)?e.deserializer?e.deserializer(s.getValue(n)):s.getValue(n):void 0,d=(t,a)=>{let o;e.state&&(o=c()),s.setValue(n,e.serializer?e.serializer(a):a),e.state&&t.requestUpdate(i,o)},h=t.performUpdate;if(t.performUpdate=function(){this.__initialized=!0,h.call(this)},e.subscribe){const e=t.connectedCallback,i=t.disconnectedCallback;t.connectedCallback=function(){e.call(this);const t=this;t.__unbsubLocalStorage||(t.__unbsubLocalStorage=null==l?void 0:l(this))},t.disconnectedCallback=function(){var e;i.call(this);const t=this;null===(e=t.__unbsubLocalStorage)||void 0===e||e.call(t),t.__unbsubLocalStorage=void 0}}const u=Object.getOwnPropertyDescriptor(t,i);let p;if(void 0===u)p={get(){return c()},set(e){(this.__initialized||void 0===c())&&d(this,e)},configurable:!0,enumerable:!0};else{const e=u.set;p=Object.assign(Object.assign({},u),{},{get(){return c()},set(t){(this.__initialized||void 0===c())&&d(this,t),null==e||e.call(this,t)}})}Object.defineProperty(t,i,p)}}},32172:function(e,t,i){i.d(t,{p:function(){return a}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function a(e){return(t,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),o=t;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const e=o._transformers;o._transformers=new Map,e.forEach((e,t)=>o._transformers.set(t,e))}}else{o._transformers=new Map,o._watching=new Map;const e=o.willUpdate;o.willUpdate=function(t){e.call(this,t);const i=new Set;t.forEach((e,t)=>{const a=this._watching.get(t);void 0!==a&&a.forEach(e=>i.add(e))}),i.forEach(e=>{this[e]=this[`__original_${String(e)}`]})}}o._transformers.set(i,e.transformer),e.watch&&e.watch.forEach(e=>{let t=o._watching.get(e);t||(t=new Set,o._watching.set(e,t)),t.add(i)});const r=Object.getOwnPropertyDescriptor(t,i);let s;if(void 0===r)s={get(){return this[`__transform_${a}`]},set(e){const t=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,t)},configurable:!0,enumerable:!0};else{const e=r.set;s=Object.assign(Object.assign({},r),{},{set(t){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,i),null==e||e.call(this,t)}})}Object.defineProperty(t,i,s)}}},69558:function(e,t,i){i.d(t,{_:function(){return r}});i(16280),i(18111),i(7588),i(62953);var a=i(5124),o=i(54495);const r=(0,o.u$)(class extends o.WL{update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach(([e,t])=>{this._element[e]=t}),a.c0):this.render(t,i)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==o.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},69093:function(e,t,i){i.d(t,{t:function(){return o}});var a=i(71727);const o=e=>(0,a.m)(e.entity_id)},82286:function(e,t,i){i.d(t,{$:function(){return a}});const a=(e,t)=>o(e.attributes,t),o=(e,t)=>0!==(e.supported_features&t)},34470:function(e,t,i){i.d(t,{E:function(){return o}});let a;const o=(0,i(5124).AH)(a||(a=(e=>e)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},63130:function(e,t,i){i.d(t,{l:function(){return o}});i(3362);var a=i(50248);const o=async(e,t)=>{var i;if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(e))}catch(s){}const o=t||(null===(i=(0,a.n)())||void 0===i?void 0:i.getRootNode())||document.body,r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",o.appendChild(r),r.select(),document.execCommand("copy"),o.removeChild(r)}},60353:function(e,t,i){i.d(t,{u:function(){return a}});class a{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){var t,i;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(t=e.velocitySwipeThreshold)&&void 0!==t?t:.5,this._movementTimeThreshold=null!==(i=e.movementTimeThreshold)&&void 0!==i?i:100}}},3931:function(e,t,i){i.d(t,{U:function(){return a}});i(3362),i(62953);const a=async(e,t,i,a,o,...r)=>{let s=a[e];s||(s=a[e]={});const n=s[o];if(n)return n;const l=i(a,o,...r);return s[o]=l,l.then(()=>setTimeout(()=>{s[o]=void 0},t),()=>{s[o]=void 0}),l}},64481:function(e,t,i){i.d(t,{D:function(){return o},J:function(){return s}});i(16280),i(3362),i(55815),i(64979),i(79739);let a=!1;try{a="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=e=>{a=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||a)return e(!1),Promise.resolve();let t=!1;try{const i=document.startViewTransition(()=>{t=!0,e(!0)});return i.ready.catch(r),i.finished.catch(r)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),t?Promise.reject(i):(e(!1),Promise.resolve())}}},89300:function(e,t,i){i.a(e,async function(e,t){try{i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(6412),n=i(18350),l=i(65829),c=(i(67094),e([n,l]));[n,l]=c.then?(await c)():c;let d,h,u,p,v,m,y=e=>e;const g="M2.2,16.06L3.88,12L2.2,7.94L6.26,6.26L7.94,2.2L12,3.88L16.06,2.2L17.74,6.26L21.8,7.94L20.12,12L21.8,16.06L17.74,17.74L16.06,21.8L12,20.12L7.94,21.8L6.26,17.74L2.2,16.06M13,17V15H11V17H13M13,13V7H11V13H13Z",b="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";class _ extends o.WF{render(){const e=this.progress||this._result?"accent":this.appearance;return(0,o.qy)(d||(d=y` <ha-button .appearance="${0}" .disabled="${0}" .loading="${0}" .variant="${0}" class="${0}"> ${0} <slot>${0}</slot> </ha-button> ${0} `),e,this.disabled,this.progress,"success"===this._result?"success":"error"===this._result?"danger":this.variant,(0,s.H)({result:!!this._result,success:"success"===this._result,error:"error"===this._result}),this.iconPath?(0,o.qy)(h||(h=y`<ha-svg-icon .path="${0}" slot="start"></ha-svg-icon>`),this.iconPath):o.s6,this.label,this._result?(0,o.qy)(u||(u=y` <div class="progress"> ${0} </div> `),"success"===this._result?(0,o.qy)(p||(p=y`<ha-svg-icon .path="${0}"></ha-svg-icon>`),b):"error"===this._result?(0,o.qy)(v||(v=y`<ha-svg-icon .path="${0}"></ha-svg-icon>`),g):o.s6):o.s6)}actionSuccess(){this._setResult("success")}actionError(){this._setResult("error")}_setResult(e){this._result=e,setTimeout(()=>{this._result=void 0},2e3)}constructor(...e){super(...e),this.disabled=!1,this.progress=!1,this.appearance="accent",this.variant="brand"}}_.styles=(0,o.AH)(m||(m=y`:host{outline:0;display:inline-block;position:relative}:host([progress]){pointer-events:none}.progress{bottom:0;display:flex;justify-content:center;align-items:center;position:absolute;top:0;width:100%}ha-button{width:100%}ha-button.result::part(caret),ha-button.result::part(end),ha-button.result::part(label),ha-button.result::part(spinner),ha-button.result::part(start){visibility:hidden}:host([appearance=brand]) ha-svg-icon{color:var(--white-color)}`)),(0,a.Cg)([(0,r.MZ)()],_.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],_.prototype,"progress",void 0),(0,a.Cg)([(0,r.MZ)()],_.prototype,"appearance",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"iconPath",void 0),(0,a.Cg)([(0,r.MZ)()],_.prototype,"variant",void 0),(0,a.Cg)([(0,r.wk)()],_.prototype,"_result",void 0),_=(0,a.Cg)([(0,r.EM)("ha-progress-button")],_),t()}catch(d){t(d)}})},82474:function(e,t,i){i.a(e,async function(e,t){try{i(13609),i(18111),i(20116),i(61701),i(3362),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(22786),n=i(1087),l=i(74705),c=i(78649),d=i(53756),h=i(95350),u=i(24367),p=i(19711),v=(i(75064),i(38508)),m=(i(47680),i(67094),i(74281)),y=e([v,m]);[v,m]=y.then?(await y)():y;let g,b,_,f,w,x,C,$,k,M,E,O,z,j,A,Z=e=>e;const P="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",T="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",q="___create-new-entity___";class D extends o.WF{willUpdate(e){var t;this._pendingEntityId&&e.has("hass")&&this.hass.states!==(null===(t=e.get("hass"))||void 0===t?void 0:t.states)&&this.hass.states[this._pendingEntityId]&&(this._setValue(this._pendingEntityId),this._pendingEntityId=void 0)}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("title")}_findExtraOption(e){var t;return e?null===(t=this.extraOptions)||void 0===t?void 0:t.find(t=>t.id===e):void 0}_renderExtraOptionStart(e){const t=e.entity_id?this.hass.states[e.entity_id]:void 0;return t?(0,o.qy)(g||(g=Z` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),t,this.hass):e.icon_path?(0,o.qy)(b||(b=Z` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> `),e.icon_path):e.icon?(0,o.qy)(_||(_=Z`<ha-icon slot="start" .icon="${0}"></ha-icon>`),e.icon):o.s6}get _showEntityId(){var e;return this.showEntityId||(null===(e=this.hass.userData)||void 0===e?void 0:e.showEntityIdPicker)}_shouldHideClearIcon(){var e;return!(null===(e=this._findExtraOption(this.value))||void 0===e||!e.hide_clear)}render(){var e,t;const i=null!==(e=this.placeholder)&&void 0!==e?e:this.hass.localize("ui.components.entity.entity-picker.placeholder");return(0,o.qy)(f||(f=Z` <ha-generic-picker .hass="${0}" .disabled="${0}" .autofocus="${0}" .allowCustomValue="${0}" .required="${0}" .label="${0}" .placeholder="${0}" .helper="${0}" .value="${0}" .searchLabel="${0}" .notFoundLabel="${0}" .rowRenderer="${0}" .getItems="${0}" .getAdditionalItems="${0}" .hideClearIcon="${0}" .searchFn="${0}" .valueRenderer="${0}" .searchKeys="${0}" use-top-label .addButtonLabel="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.disabled,this.autofocus,this.allowCustomEntity,this.required,this.label,i,this.helper,this.addButton?void 0:this.value,this.searchLabel,this._notFoundLabel,this._rowRenderer,this._getItems,this._getAdditionalItems,this.hideClearIcon||this._shouldHideClearIcon(),this._searchFn,this._valueRenderer,d.t,this.addButton?null!==(t=this.addButtonLabel)&&void 0!==t?t:this.hass.localize("ui.components.entity.entity-picker.add"):void 0,this.hass.localize("ui.components.entity.entity-picker.unknown"),this._valueChanged)}async open(){var e;await this.updateComplete,await(null===(e=this._picker)||void 0===e?void 0:e.open())}_valueChanged(e){e.stopPropagation();const t=e.detail.value;if(t){if(t.startsWith(q)){const e=t.substring(q.length);return void(0,p.$)(this,{domain:e,dialogClosedCallback:e=>{e.entityId&&(this.hass.states[e.entityId]?this._setValue(e.entityId):this._pendingEntityId=e.entityId)}})}((0,c.n)(t)||this._findExtraOption(t))&&this._setValue(t)}else this._setValue(void 0)}_setValue(e){this.value=e,(0,n.r)(this,"value-changed",{value:e}),(0,n.r)(this,"change")}constructor(...e){super(...e),this.autofocus=!1,this.disabled=!1,this.required=!1,this.showEntityId=!1,this.hideClearIcon=!1,this.addButton=!1,this._valueRenderer=e=>{const t=e||"",i=this._findExtraOption(t);if(i)return(0,o.qy)(w||(w=Z` ${0} <span slot="headline">${0}</span> ${0} `),this._renderExtraOptionStart(i),i.primary,i.secondary?(0,o.qy)(x||(x=Z`<span slot="supporting-text">${0}</span>`),i.secondary):o.s6);const a=this.hass.states[t];if(!a)return(0,o.qy)(C||(C=Z` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${0}</span> `),T,t);const{primary:r,secondary:s}=(0,l.Bj)(this.hass,a);return(0,o.qy)($||($=Z` <state-badge .hass="${0}" .stateObj="${0}" slot="start"></state-badge> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> `),this.hass,a,r,s)},this._rowRenderer=(e,t)=>{const i=this._showEntityId;return(0,o.qy)(k||(k=Z` <ha-combo-box-item type="button" compact="compact" .borderTop="${0}"> ${0} <span slot="headline">${0}</span> ${0} ${0} ${0} </ha-combo-box-item> `),0!==t,e.icon_path?(0,o.qy)(M||(M=Z` <ha-svg-icon slot="start" style="margin:0 4px" .path="${0}"></ha-svg-icon> `),e.icon_path):(0,o.qy)(E||(E=Z` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),e.stateObj,this.hass),e.primary,e.secondary?(0,o.qy)(O||(O=Z`<span slot="supporting-text">${0}</span>`),e.secondary):o.s6,e.stateObj&&i?(0,o.qy)(z||(z=Z` <span slot="supporting-text" class="code"> ${0} </span> `),e.stateObj.entity_id):o.s6,e.domain_name&&!i?(0,o.qy)(j||(j=Z` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),e.domain_name):o.s6)},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,s.A)((e,t)=>null!=t&&t.length?(this.hass.loadFragmentTranslation("config"),t.map(t=>{const i=e("ui.components.entity.entity-picker.create_helper",{domain:(0,u.z)(t)?e(`ui.panel.config.helpers.types.${t}`)||t:(0,h.p$)(e,t)});return{id:q+t,primary:i,secondary:e("ui.components.entity.entity-picker.new_entity"),icon_path:P}})):[]),this._getEntitiesMemoized=(0,s.A)(d.w),this._getItems=()=>{var e;const t=this._getEntitiesMemoized(this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities,this.value);if(null!==(e=this.extraOptions)&&void 0!==e&&e.length){return[...this.extraOptions.map(e=>Object.assign(Object.assign({},e),{},{stateObj:e.entity_id?this.hass.states[e.entity_id]:void 0})),...t]}return t},this._searchFn=(e,t)=>{const i=t.findIndex(t=>{var i;return(null===(i=t.stateObj)||void 0===i?void 0:i.entity_id)===e});if(-1===i)return t;const[a]=t.splice(i,1);return t.unshift(a),t},this._notFoundLabel=e=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:(0,o.qy)(A||(A=Z`<b>‘${0}’</b>`),e)})}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],D.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],D.prototype,"autofocus",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],D.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],D.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"allow-custom-entity"})],D.prototype,"allowCustomEntity",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-entity-id"})],D.prototype,"showEntityId",void 0),(0,a.Cg)([(0,r.MZ)()],D.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],D.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],D.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)()],D.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:String,attribute:"search-label"})],D.prototype,"searchLabel",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],D.prototype,"createDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],D.prototype,"includeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],D.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],D.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-unit-of-measurement"})],D.prototype,"includeUnitOfMeasurement",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-entities"})],D.prototype,"includeEntities",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-entities"})],D.prototype,"excludeEntities",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],D.prototype,"entityFilter",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],D.prototype,"extraOptions",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"hide-clear-icon",type:Boolean})],D.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"add-button",type:Boolean})],D.prototype,"addButton",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"add-button-label"})],D.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,r.P)("ha-generic-picker")],D.prototype,"_picker",void 0),(0,a.Cg)([(0,r.wk)()],D.prototype,"_pendingEntityId",void 0),D=(0,a.Cg)([(0,r.EM)("ha-entity-picker")],D),t()}catch(g){t(g)}})},74281:function(e,t,i){i.a(e,async function(e,t){try{i(18111),i(7588),i(45367),i(92731),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(63672),n=i(89784),l=i(71727),c=i(69093),d=i(52658),h=i(34470),u=i(10897),p=i(38279),v=i(93367),m=e([v]);v=(m.then?(await m)():m)[0];let y,g,b,_=e=>e;const f="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends o.WF{connectedCallback(){var e,t;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture||null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var e,t;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture||null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var e;const t=this.stateObj?(0,c.t)(this.stateObj):void 0;return null!==(e=this.stateColor)&&void 0!==e?e:"light"===t}render(){const e=this.stateObj;if(!e&&!this.overrideIcon&&!this.overrideImage)return(0,o.qy)(y||(y=_`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),f);const t=this.getClass();if(t&&t.forEach((e,t)=>{e?this.classList.add(t):this.classList.remove(t)}),!this.icon)return o.s6;const i=e?(0,c.t)(e):void 0;return(0,o.qy)(g||(g=_`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,n.W)(this._iconStyle),(0,s.J)(i),(0,s.J)(null==e?void 0:e.state),this.overrideIcon,e)}willUpdate(e){if(super.willUpdate(e),!(e.has("stateObj")||e.has("overrideImage")||e.has("overrideIcon")||e.has("stateColor")||e.has("color")))return;const t=this.stateObj,i={};let a="";if(this.icon=!0,t){const e=(0,l.m)(t.entity_id);if(void 0===this.overrideImage)if(!t.attributes.entity_picture_local&&!t.attributes.entity_picture||this.overrideIcon){if(this.color)i.color=this.color;else if(this._stateColor){const e=(0,d.Se)(t);if(e&&(i.color=e),t.attributes.rgb_color&&(i.color=`rgb(${t.attributes.rgb_color.join(",")})`),t.attributes.brightness){const e=t.attributes.brightness;if("number"!=typeof e){const i=`Type error: state-badge expected number, but type of ${t.entity_id}.attributes.brightness is ${typeof e} (${e})`;console.warn(i)}i.filter=(0,d.mT)(t)}if(t.attributes.hvac_action){const e=t.attributes.hvac_action;e in p.sx?i.color=(0,d.Se)(t,p.sx[e]):delete i.color}}}else{let i=t.attributes.entity_picture_local||t.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===e&&(i=(0,u.su)(i,80,80)),a=`url(${i})`,this.icon=!1}else if(this.overrideImage){let e=this.overrideImage;this.hass&&(e=this.hass.hassUrl(e)),a=`url(${e})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=a}getClass(){const e=new Map(["has-no-radius","has-media-image","has-image"].map(e=>[e,!1]));if(this.stateObj){const t=(0,l.m)(this.stateObj.entity_id);"update"===t?e.set("has-no-radius",!0):"media_player"===t||"camera"===t?e.set("has-media-image",!0):""!==this.style.backgroundImage&&e.set("has-image",!0)}return e}static get styles(){return[h.E,(0,o.AH)(b||(b=_`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}constructor(...e){super(...e),this.icon=!0,this._iconStyle={}}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,a.Cg)([(0,r.MZ)()],w.prototype,"color",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,a.Cg)([(0,r.wk)()],w.prototype,"_iconStyle",void 0),w=(0,a.Cg)([(0,r.EM)("state-badge")],w),t()}catch(y){t(y)}})},38962:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(6412),l=i(93421),c=i(1087),d=i(26300),h=(i(67094),e([d]));d=(h.then?(await h)():h)[0];let u,p,v,m,y=e=>e;const g="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",b={info:"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",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends r.WF{render(){var e;return(0,r.qy)(u||(u=y` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",b[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(p||(p=y`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(v||(v=y`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(e=this._localize)||void 0===e?void 0:e.call(this,"ui.common.dismiss_alert"),g):r.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,r.AH)(m||(m=y`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,o.Cg)([(0,s.MZ)()],_.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.IW)()],_.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,o.Cg)([(0,s.EM)("ha-alert")],_),a()}catch(u){a(u)}})},89865:function(e,t,i){i.a(e,async function(e,t){try{i(18111),i(61701),i(62953);var a=i(40445),o=(i(22395),i(5124)),r=i(67576),s=i(1087),n=i(18350),l=(i(67094),e([n]));n=(l.then?(await l)():l)[0];let c,d,h,u,p=e=>e;class v extends o.WF{render(){return(0,o.qy)(c||(c=p` <wa-button-group childSelector="ha-button"> ${0} </wa-button-group> `),this.buttons.map(e=>(0,o.qy)(d||(d=p`<ha-button iconTag="ha-svg-icon" class="icon" .variant="${0}" .size="${0}" .value="${0}" @click="${0}" .title="${0}" .appearance="${0}"> ${0} </ha-button>`),this.active===e.value&&this.activeVariant?this.activeVariant:this.variant,this.size,e.value,this._handleClick,e.label,this.active===e.value?"accent":"filled",e.iconPath?(0,o.qy)(h||(h=p`<ha-svg-icon aria-label="${0}" .path="${0}"></ha-svg-icon>`),e.label,e.iconPath):e.label)))}_handleClick(e){this.active=e.currentTarget.value,(0,s.r)(this,"value-changed",{value:this.active})}constructor(...e){super(...e),this.size="medium",this.nowrap=!1,this.fullWidth=!1,this.variant="brand"}}v.styles=(0,o.AH)(u||(u=p`:host{--mdc-icon-size:var(--button-toggle-icon-size, 20px)}:host([no-wrap]) wa-button-group::part(base){flex-wrap:nowrap}wa-button-group{padding:var(--ha-button-toggle-group-padding)}:host([full-width]) wa-button-group,:host([full-width]) wa-button-group::part(base){width:100%}:host([full-width]) ha-button{flex:1}`)),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"buttons",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"active",void 0),(0,a.Cg)([(0,r.MZ)({reflect:!0})],v.prototype,"size",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"no-wrap"})],v.prototype,"nowrap",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"full-width"})],v.prototype,"fullWidth",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"variant",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"active-variant"})],v.prototype,"activeVariant",void 0),v=(0,a.Cg)([(0,r.EM)("ha-button-toggle-group")],v),t()}catch(c){t(c)}})},76776:function(e,t,i){i(62953);var a=i(40445),o=i(5124),r=i(67576);let s,n,l,c=e=>e;class d extends o.WF{render(){return(0,o.qy)(s||(s=c` ${0} <slot></slot> `),this.header?(0,o.qy)(n||(n=c`<h1 class="card-header">${0}</h1>`),this.header):o.s6)}constructor(...e){super(...e),this.raised=!1}}d.styles=(0,o.AH)(l||(l=c`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
:host
::slotted(
.card-content:not(:nth-child(1 of .card-content, .card-header))
),
slot:not(:first-child)::slotted(.card-content) {
padding-top: 0;
margin-top: calc(var(--ha-space-2) * -1);
}
:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,a.Cg)([(0,r.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,a.Cg)([(0,r.EM)("ha-card")],d)},9503:function(e,t,i){var a=i(40445),o=i(97577),r=i(5124),s=i(67576);let n,l=e=>e;class c extends o.A{get value(){var e;return null!==(e=this._value)&&void 0!==e?e:null}set value(e){this._value=e}static get styles(){return[o.A.styles,(0,r.AH)(n||(n=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,a.Cg)([(0,s.EM)("ha-checkbox")],c)},11382:function(e,t,i){i(3362),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(6412),n=i(1087),l=i(12587);i(67094);let c,d,h,u,p=e=>e;class v extends o.WF{render(){const e=this.noCollapse?o.s6:(0,o.qy)(c||(c=p` <ha-svg-icon .path="${0}" class="summary-icon ${0}"></ha-svg-icon> `),"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",(0,s.H)({expanded:this.expanded}));return(0,o.qy)(d||(d=p` <div class="top ${0}"> <div id="summary" class="${0}" @click="${0}" @keydown="${0}" @focus="${0}" @blur="${0}" role="button" tabindex="${0}" aria-expanded="${0}" aria-controls="sect1" part="summary"> ${0} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${0} <slot class="secondary" name="secondary">${0}</slot> </div> </slot> <slot name="event"></slot> ${0} <slot name="icons"></slot> </div> </div> <div class="container ${0}" @transitionend="${0}" role="region" aria-labelledby="summary" aria-hidden="${0}" tabindex="-1"> ${0} </div> `),(0,s.H)({expanded:this.expanded}),(0,s.H)({noCollapse:this.noCollapse}),this._toggleContainer,this._toggleContainer,this._focusChanged,this._focusChanged,this.noCollapse?-1:0,this.expanded,this.leftChevron?e:o.s6,this.header,this.secondary,this.leftChevron?o.s6:e,(0,s.H)({expanded:this.expanded}),this._handleTransitionEnd,!this.expanded,this._showContent?(0,o.qy)(h||(h=p`<slot></slot>`)):"")}willUpdate(e){super.willUpdate(e),e.has("expanded")&&(this._showContent=this.expanded,setTimeout(()=>{this._container.style.overflow=this.expanded?"initial":"hidden"},300))}_handleTransitionEnd(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}async _toggleContainer(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,n.r)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,l.E)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout(()=>{this._container.style.height="0px"},0),this.expanded=t,(0,n.r)(this,"expanded-changed",{expanded:this.expanded})}_focusChanged(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}constructor(...e){super(...e),this.expanded=!1,this.outlined=!1,this.leftChevron=!1,this.noCollapse=!1,this._showContent=this.expanded}}v.styles=(0,o.AH)(u||(u=p`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;border-radius:var(--ha-border-radius-circle)}#summary:focus-visible ha-svg-icon.summary-icon{background-color:var(--ha-color-fill-neutral-normal-active)}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:var(--ha-font-weight-medium);outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1;overflow-wrap:anywhere;color:var(--primary-text-color)}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}`)),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"expanded",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"outlined",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],v.prototype,"leftChevron",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],v.prototype,"noCollapse",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"secondary",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_showContent",void 0),(0,a.Cg)([(0,r.P)(".container")],v.prototype,"_container",void 0),v=(0,a.Cg)([(0,r.EM)("ha-expansion-panel")],v)},54276:function(e,t,i){i(62953);var a=i(40445),o=i(76482),r=i(91382),s=i(96245),n=i(5124),l=i(67576);let c;class d extends r.n{attach(e){super.attach(e),this.attachableTouchController.attach(e)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(e,t){null==e||e.removeEventListener("touchend",this._handleTouchEnd),null==t||t.addEventListener("touchend",this._handleTouchEnd)}constructor(...e){super(...e),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[s.R,(0,n.AH)(c||(c=(e=>e)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`))],d=(0,a.Cg)([(0,l.EM)("ha-ripple")],d)},11399:function(e,t,i){i(3362),i(27495),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(25440),i(62953);var a=i(40445),o=i(5124),r=i(67576),s=i(22786),n=i(69558),l=i(95311);let c,d=e=>e;const h={action:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(58303),i.e(81034),i.e(23659),i.e(54066),i.e(25950),i.e(64006),i.e(79185),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(55392),i.e(12009),i.e(20282),i.e(13628),i.e(16508),i.e(28501),i.e(84207),i.e(31863),i.e(283),i.e(30513),i.e(33547)]).then(i.bind(i,6274)),addon:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(62574),i.e(26092),i.e(39005),i.e(71625),i.e(43305)]).then(i.bind(i,36784)),automation_behavior:()=>Promise.all([i.e(72850),i.e(81034),i.e(99220)]).then(i.bind(i,66034)),app:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(62574),i.e(26092),i.e(39005),i.e(71625)]).then(i.bind(i,48585)),area:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(83523),i.e(62574),i.e(26092),i.e(39005),i.e(13905)]).then(i.bind(i,81857)),areas_display:()=>Promise.all([i.e(46095),i.e(64657),i.e(68273),i.e(64280),i.e(47956)]).then(i.bind(i,38235)),attribute:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(49168),i.e(62574),i.e(26092),i.e(39005),i.e(58072)]).then(i.bind(i,71498)),assist_pipeline:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(43048),i.e(63071)]).then(i.bind(i,83642)),boolean:()=>Promise.all([i.e(93282),i.e(19623)]).then(i.bind(i,30714)),choose:()=>i.e(93934).then(i.bind(i,58141)),color_rgb:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(7106),i.e(62574),i.e(21332)]).then(i.bind(i,34931)),condition:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(23659),i.e(54066),i.e(25950),i.e(48106),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(13628),i.e(28501),i.e(84207),i.e(283),i.e(77190)]).then(i.bind(i,81539)),config_entry:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(8706),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(81594)]).then(i.bind(i,49347)),conversation_agent:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(20667),i.e(44770)]).then(i.bind(i,94215)),constant:()=>i.e(77057).then(i.bind(i,39032)),country:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(84887),i.e(65799),i.e(62574),i.e(26092),i.e(39005),i.e(64157),i.e(47352)]).then(i.bind(i,94164)),date:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(81178),i.e(62574),i.e(36553)]).then(i.bind(i,94351)),datetime:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(62574),i.e(12466)]).then(i.bind(i,39045)),device:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(23659),i.e(33246),i.e(62574),i.e(26092),i.e(39005),i.e(83128)]).then(i.bind(i,2270)),duration:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(90324),i.e(62574),i.e(16508),i.e(24858)]).then(i.bind(i,79488)),entity:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(69923),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(1535),i.e(34435)]).then(i.bind(i,73863)),entity_name:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(80607),i.e(62574),i.e(26092),i.e(39005),i.e(3067)]).then(i.bind(i,7563)),statistic:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(72224),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(54884),i.e(88493)]).then(i.bind(i,28072)),file:()=>Promise.all([i.e(72850),i.e(49224)]).then(i.bind(i,25078)),floor:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(89100),i.e(54192),i.e(62574),i.e(26092),i.e(39005),i.e(33790),i.e(94628)]).then(i.bind(i,9040)),label:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(79808),i.e(62574),i.e(26092),i.e(39005),i.e(66201),i.e(40231)]).then(i.bind(i,99560)),language:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(82025),i.e(62574),i.e(26092),i.e(39005),i.e(59324)]).then(i.bind(i,15430)),navigation:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(83113),i.e(99788),i.e(54066),i.e(83502),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(19112),i.e(30002),i.e(59704),i.e(25322),i.e(89747),i.e(71572),i.e(12009),i.e(20282),i.e(28501),i.e(46152),i.e(33173)]).then(i.bind(i,58350)),number:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(21543),i.e(62574),i.e(64809)]).then(i.bind(i,31157)),numeric_threshold:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(88992),i.e(99386)]).then(i.bind(i,18719)),object:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(72130),i.e(85010),i.e(42981),i.e(34310),i.e(87352)]).then(i.bind(i,97951)),period:()=>i.e(54234).then(i.bind(i,40929)),qr_code:()=>Promise.all([i.e(72850),i.e(51343),i.e(90791)]).then(i.bind(i,35313)),select:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(62574),i.e(26092),i.e(39005),i.e(35873),i.e(99457)]).then(i.bind(i,856)),selector:()=>i.e(77810).then(i.bind(i,13897)),serial_port:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(68432),i.e(62574),i.e(26092),i.e(39005),i.e(87464)]).then(i.bind(i,82178)),state:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(19269),i.e(62574),i.e(26092),i.e(39005),i.e(48007)]).then(i.bind(i,12995)),backup_location:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(83241),i.e(72777)]).then(i.bind(i,16360)),stt:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(98286),i.e(87890)]).then(i.bind(i,42999)),target:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(40420),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(13628),i.e(14351),i.e(24891),i.e(45862)]).then(i.bind(i,84909)),template:()=>Promise.all([i.e(72850),i.e(39763),i.e(72130),i.e(33387),i.e(34310),i.e(15732)]).then(i.bind(i,62166)),text:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(37694),i.e(62574),i.e(55844)]).then(i.bind(i,47971)),time:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(92351),i.e(62574),i.e(17066)]).then(i.bind(i,42945)),icon:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(86325),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(82568)]).then(i.bind(i,14885)),media:()=>Promise.all([i.e(72850),i.e(33887),i.e(91845),i.e(22308)]).then(i.bind(i,59422)),theme:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(4406),i.e(62574),i.e(26092),i.e(39005),i.e(5127)]).then(i.bind(i,77655)),timezone:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(56253),i.e(12727),i.e(62574),i.e(26092),i.e(39005),i.e(78464),i.e(41460)]).then(i.bind(i,6719)),button_toggle:()=>i.e(7774).then(i.bind(i,79949)),trigger:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(58303),i.e(81034),i.e(23659),i.e(54066),i.e(25950),i.e(4379),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(13628),i.e(28501),i.e(84207),i.e(31863),i.e(155)]).then(i.bind(i,45078)),tts:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(75905),i.e(56146)]).then(i.bind(i,59447)),tts_voice:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(53524),i.e(58485)]).then(i.bind(i,41188)),location:()=>Promise.all([i.e(72850),i.e(66139),i.e(70622),i.e(73512),i.e(8851),i.e(12122),i.e(76696),i.e(83462)]).then(i.bind(i,21160)),color_temp:()=>Promise.all([i.e(72850),i.e(39763),i.e(99788),i.e(21543),i.e(29628),i.e(59704),i.e(20282),i.e(68611)]).then(i.bind(i,90780)),ui_action:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(83113),i.e(98470),i.e(99788),i.e(54066),i.e(25950),i.e(31746),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(12009),i.e(20282),i.e(28501),i.e(46152),i.e(59800)]).then(i.bind(i,38389)),ui_color:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(46051),i.e(62574),i.e(26092),i.e(39005),i.e(80651)]).then(i.bind(i,52744)),ui_state_content:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(67493),i.e(62574),i.e(26092),i.e(39005),i.e(48408)]).then(i.bind(i,96074))},u=new Set(["ui-action","ui-color"]);class p extends o.WF{reportValidity(){var e,t;return this._selectorElement&&"reportValidity"in this._selectorElement&&"function"==typeof this._selectorElement.reportValidity?null===(e=null===(t=this._selectorElement)||void 0===t?void 0:t.reportValidity())||void 0===e||e:!this.required||void 0!==this.value&&null!==this.value&&""!==this.value}async focus(){var e;await this.updateComplete,null===(e=this._selectorElement)||void 0===e||e.focus()}get _type(){const e=Object.keys(this.selector)[0];return u.has(e)?e.replace("-","_"):e}willUpdate(e){var t;e.has("selector")&&this.selector&&(null===(t=h[this._type])||void 0===t||t.call(h))}render(){return(0,o.qy)(c||(c=d` ${0} `),(0,n._)(`ha-selector-${this._type}`,{hass:this.hass,narrow:this.narrow,name:this.name,selector:this._handleLegacySelector(this.selector),value:this.value,label:this.label,placeholder:this.placeholder,disabled:this.disabled,required:this.required,helper:this.helper,context:this.context,localizeValue:this.localizeValue,id:"selector"}))}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1,this.required=!0,this._handleLegacySelector=(0,s.A)(e=>{if("entity"in e)return(0,l.UU)(e);if("device"in e)return(0,l.tD)(e);const t=Object.keys(this.selector)[0];return u.has(t)?{[t.replace("-","_")]:e[t]}:e})}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"name",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"selector",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"localizeValue",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,a.Cg)([(0,r.P)("#selector",!0)],p.prototype,"_selectorElement",void 0),p=(0,a.Cg)([(0,r.EM)("ha-selector")],p)},65829:function(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:function(){return h}});var o=i(40445),r=i(55262),s=i(5124),n=i(67576),l=e([r]);r=(l.then?(await l)():l)[0];let c,d=e=>e;class h extends r.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,(0,s.AH)(c||(c=d`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,o.Cg)([(0,n.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,n.EM)("ha-spinner")],h),a()}catch(c){a(c)}})},34127:function(e,t,i){i.a(e,async function(e,t){try{i(62953);var a=i(40445),o=i(52630),r=i(5124),s=i(67576),n=e([o]);o=(n.then?(await n)():n)[0];let l,c=e=>e;class d extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(l||(l=c`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...e){super(...e),this.showDelay=350,this.hideDelay=150}}(0,a.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],d.prototype,"showDelay",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],d.prototype,"hideDelay",void 0),d=(0,a.Cg)([(0,s.EM)("ha-tooltip")],d),t()}catch(l){t(l)}})},10763:function(e,t,i){i.a(e,async function(e,t){try{i(3362),i(62953);var a=i(40445),o=i(53289),r=i(5124),s=i(67576),n=i(35211),l=i(1087),c=i(63130),d=i(14503),h=i(81619),u=i(18350),p=i(15717),v=i(22792),m=e([u,p]);[u,p]=m.then?(await m)():m;let y,g,b,_,f,w=e=>e;const x=e=>{if("object"!=typeof e||null===e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0};class C extends r.WF{setValue(e){try{this._yaml=x(e)?"":(0,o.dump)(e,{schema:this.yamlSchema,quotingType:'"',noRefs:!0})}catch(t){console.error(t,e),alert(`There was an error converting to YAML: ${t}`)}}firstUpdated(){void 0!==this.defaultValue&&this.setValue(this.defaultValue)}willUpdate(e){super.willUpdate(e),this.autoUpdate&&e.has("value")&&this.setValue(this.value)}focus(){var e,t;null!==(e=this._codeEditor)&&void 0!==e&&e.codemirror&&(null===(t=this._codeEditor)||void 0===t||t.codemirror.focus())}disableCodeEditorFullscreen(){this.disableFullscreen=!0,this._codeEditor&&(this._codeEditor.disableFullscreen=!0)}render(){return void 0===this._yaml?r.s6:(0,r.qy)(y||(y=w` ${0} <ha-code-editor .value="${0}" .readOnly="${0}" .disableFullscreen="${0}" .inDialog="${0}" mode="yaml" lint autocomplete-entities autocomplete-icons .error="${0}" @value-changed="${0}" @editor-save="${0}" dir="ltr"></ha-code-editor> ${0} `),this.label?(0,r.qy)(g||(g=w`<p>${0}${0}</p>`),this.label,this.required?" *":""):r.s6,this._yaml,this.readOnly,this.disableFullscreen,this.inDialog,!1===this.isValid,this._onChange,this._onEditorSave,this.copyClipboard||this.hasExtraActions?(0,r.qy)(b||(b=w` <div class="card-actions"> ${0} <slot name="extra-actions"></slot> </div> `),this.copyClipboard?(0,r.qy)(_||(_=w` <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> `),this._copyYaml,this._i18n.localize("ui.components.yaml-editor.copy_to_clipboard")):r.s6):r.s6)}_onChange(e){var t;let i;e.stopPropagation(),this._yaml=e.detail.value;let a,r=!0,s=null;if(this._yaml)try{i=(0,o.Hh)(this._yaml,{schema:this.yamlSchema})}catch(n){r=!1,s=n,a=`${this._i18n.localize("ui.components.yaml-editor.error",{reason:n.reason})}${n.mark?` (${this._i18n.localize("ui.components.yaml-editor.error_location",{line:n.mark.line+1,column:n.mark.column+1})})`:""}`}else i={};null===(t=this._codeEditor)||void 0===t||t.setYamlError(s),this.value=i,this.isValid=r,(0,l.r)(this,"value-changed",{value:i,isValid:r,errorMsg:a})}get yaml(){return this._yaml}get codemirror(){var e;return null===(e=this._codeEditor)||void 0===e?void 0:e.codemirror}get hasComments(){var e,t;return null!==(e=null===(t=this._codeEditor)||void 0===t?void 0:t.hasComments)&&void 0!==e&&e}_onEditorSave(e){(0,l.r)(this,"editor-save"),e.stopPropagation()}async _copyYaml(){this.yaml&&(await(0,c.l)(this.yaml),(0,h.P)(this,{message:this._i18n.localize("ui.common.copied_clipboard")}))}static get styles(){return[d.RF,(0,r.AH)(f||(f=w`.card-actions{border-radius:var(--actions-border-radius,var(--ha-border-radius-square) var(--ha-border-radius-square) var(--ha-card-border-radius,var(--ha-border-radius-lg)) var(--ha-card-border-radius,var(--ha-border-radius-lg)));border:1px solid var(--divider-color);padding:5px 16px}ha-code-editor{flex-grow:1;min-height:0}`))]}constructor(...e){super(...e),this.yamlSchema=o.my,this.isValid=!0,this.autoUpdate=!1,this.readOnly=!1,this.disableFullscreen=!1,this.inDialog=!1,this.required=!1,this.copyClipboard=!1,this.hasExtraActions=!1,this._yaml=""}}(0,a.Cg)([(0,s.MZ)()],C.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"yamlSchema",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"defaultValue",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"is-valid",type:Boolean})],C.prototype,"isValid",void 0),(0,a.Cg)([(0,s.MZ)()],C.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"auto-update",type:Boolean})],C.prototype,"autoUpdate",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"read-only",type:Boolean})],C.prototype,"readOnly",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"disable-fullscreen"})],C.prototype,"disableFullscreen",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"in-dialog"})],C.prototype,"inDialog",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],C.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"copy-clipboard",type:Boolean})],C.prototype,"copyClipboard",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"has-extra-actions",type:Boolean})],C.prototype,"hasExtraActions",void 0),(0,a.Cg)([(0,s.wk)()],C.prototype,"_yaml",void 0),(0,a.Cg)([(0,s.wk)(),(0,n.Fg)({context:v.D5,subscribe:!0})],C.prototype,"_i18n",void 0),(0,a.Cg)([(0,s.P)("ha-code-editor")],C.prototype,"_codeEditor",void 0),C=(0,a.Cg)([(0,s.EM)("ha-yaml-editor")],C),t()}catch(y){t(y)}})},82e3:function(e,t,i){i.d(t,{D5:function(){return a},Fy:function(){return s},Gk:function(){return c},Hg:function(){return o},Y_:function(){return d},ds:function(){return l},e0:function(){return r},ec:function(){return n}});i(74423),i(18111),i(61701),i(33110),i(3362);const a=14881==i.j?`${location.protocol}//${location.host}`:null,o=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}}),r=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),s=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),n=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),l=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),c=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),d=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},10897:function(e,t,i){i.d(t,{C4:function(){return c},CK:function(){return l},FX:function(){return m},UC:function(){return p},_Z:function(){return _},bT:function(){return f},j4:function(){return g},sd:function(){return r},su:function(){return n},vc:function(){return b},w8:function(){return u},wv:function(){return h},y3:function(){return v},zS:function(){return s}});i(3362);var a=i(3931),o=i(82e3);const r=[1,2,3,4,6,8],s="web_rtc",n=(e,t,i)=>`${e}&width=${t}&height=${i}`,l=e=>e.attributes.access_token?`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`:void 0,c=async(e,t,i,o)=>{const r=await(0,a.U)("_cameraTmbUrl",9e3,d,e,t);return n(r,i,o)},d=async(e,t)=>{const i=await(0,o.e0)(e,`/api/camera_proxy/${t}`);return e.hassUrl(i.path)},h=async(e,t,i)=>{const a={type:"camera/stream",entity_id:t};i&&(a.format=i);const o=await e.callWS(a);return o.url=e.hassUrl(o.url),o},u=(e,t,i,a)=>e.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:t,offer:i}),p=(e,t,i,a)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:i,candidate:a}),v=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),m=(e,t,i)=>e.callWS(Object.assign({type:"camera/update_prefs",entity_id:t},i)),y="media-source://camera/",g=e=>e.startsWith(y),b=e=>e.substring(22),_=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),f=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},53756:function(e,t,i){i.d(t,{t:function(){return l},w:function(){return c}});i(74423),i(18111),i(22489),i(61701),i(62953);var a=i(71727),o=i(74705),r=i(28978),s=i(15638),n=i(95350);const l=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],c=(e,t,i,l,c,d,h,u,p,v="")=>{let m,y=Object.keys(e.states);return h&&(y=y.filter(e=>h.includes(e))),u&&(y=y.filter(e=>!u.includes(e))),t&&(y=y.filter(e=>t.includes((0,a.m)(e)))),i&&(y=y.filter(e=>!i.includes((0,a.m)(e)))),m=y.map(t=>{const i=e.states[t],l=(0,r.u)(i),[c,d,h]=(0,o.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),u=(0,n.p$)(e.localize,(0,a.m)(t)),p=(0,s.qC)(e.language,e.translationMetadata.translations),m=c||d||t,y=[h,c?d:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${v}${t}`,primary:m,secondary:y,domain_name:u,sorting_label:[m,y].filter(Boolean).join("_"),search_labels:{entityName:c||null,deviceName:d||null,areaName:h||null,domainName:u||null,friendlyName:l||null,entityId:t},stateObj:i}}),c&&(m=m.filter(e=>{var t;return e.id===p||(null===(t=e.stateObj)||void 0===t?void 0:t.attributes.device_class)&&c.includes(e.stateObj.attributes.device_class)})),d&&(m=m.filter(e=>{var t;return e.id===p||(null===(t=e.stateObj)||void 0===t?void 0:t.attributes.unit_of_measurement)&&d.includes(e.stateObj.attributes.unit_of_measurement)})),l&&(m=m.filter(e=>e.id===p||e.stateObj&&l(e.stateObj))),m}},17022:function(e,t,i){i.d(t,{A1:function(){return a},CY:function(){return s},Fn:function(){return o},Jz:function(){return l},St:function(){return n},VA:function(){return d},WI:function(){return h},iY:function(){return c},xw:function(){return r}});i(16280),i(3362);const a=(e,t)=>e.callWS({type:"media_source/resolve_media",media_content_id:t}),o=(e,t)=>e.callWS({type:"media_source/browse_media",media_content_id:t}),r="__MANUAL_ENTRY__",s=e=>e.startsWith(r),n=e=>e.startsWith("media-source://"),l=e=>e.startsWith("media-source://media_source"),c=e=>e.startsWith("media-source://image_upload"),d=async(e,t,i)=>{const a=new FormData;a.append("media_content_id",t),a.append("file",i);const o=await e.fetchWithAuth("/api/media_source/local_source/upload",{method:"POST",body:a});if(413===o.status)throw new Error(`Uploaded file is too large (${i.name})`);if(200!==o.status)throw new Error("Unknown error");return o.json()},h=async(e,t)=>e.callWS({type:"media_source/local_source/remove",media_content_id:t})},95311:function(e,t,i){i.d(t,{DF:function(){return y},Lo:function(){return x},MH:function(){return u},MM:function(){return g},Qz:function(){return m},Ru:function(){return _},UU:function(){return f},_7:function(){return v},bZ:function(){return p},m0:function(){return h},tD:function(){return w},vX:function(){return b},wY:function(){return C}});var a=i(86518),o=(i(78350),i(74423),i(44114),i(30237),i(18111),i(22489),i(30531),i(7588),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953),i(44537)),r=i(69093),s=i(82286),n=i(24367),l=i(58594);const c=["domain","integration","device_class"],d=["integration","manufacturer","model"],h=(e,t,i,a,o,r,s)=>{const n=[],l=[],c=[];return Object.values(i).forEach(i=>{i.labels.includes(t)&&m(e,o,a,i.area_id,r,s)&&c.push(i.area_id)}),Object.values(a).forEach(i=>{i.labels.includes(t)&&y(e.states,Object.values(o),i,r,s)&&l.push(i.id)}),Object.values(o).forEach(i=>{i.labels.includes(t)&&g(e.states[i.entity_id],r,s)&&n.push(i.entity_id)}),{areas:c,devices:l,entities:n}},u=(e,t,i,a,o)=>{const r=[];return Object.values(i).forEach(i=>{i.floor_id===t&&m(e,e.entities,e.devices,i.area_id,a,o)&&r.push(i.area_id)}),{areas:r}},p=(e,t,i,a,o,r)=>{const s=[],n=[];return Object.values(i).forEach(i=>{i.area_id===t&&y(e.states,Object.values(a),i,o,r)&&n.push(i.id)}),Object.values(a).forEach(i=>{i.area_id===t&&g(e.states[i.entity_id],o,r)&&s.push(i.entity_id)}),{devices:n,entities:s}},v=(e,t,i,a,o)=>{const r=[];return Object.values(i).forEach(i=>{i.device_id===t&&g(e.states[i.entity_id],a,o)&&r.push(i.entity_id)}),{entities:r}},m=(e,t,i,a,o,r)=>!!Object.values(i).some(i=>!(i.area_id!==a||!y(e.states,Object.values(t),i,o,r)))||Object.values(t).some(t=>!(t.area_id!==a||!g(e.states[t.entity_id],o,r))),y=(e,t,i,a,r)=>{var s,n;const c=r?(0,l.fk)(r,t):void 0;if(null!==(s=a.target)&&void 0!==s&&s.device&&!(0,o.e)(a.target.device).some(e=>b(e,i,c)))return!1;if(null!==(n=a.target)&&void 0!==n&&n.entity){return t.filter(e=>e.device_id===i.id).some(t=>{const i=e[t.entity_id];return g(i,a,r)})}return!0},g=(e,t,i)=>{var a;return!!e&&(null===(a=t.target)||void 0===a||!a.entity||(0,o.e)(t.target.entity).some(t=>_(t,e,i)))},b=(e,t,i)=>{const{manufacturer:a,model:o,model_id:r,integration:s}=e;if(a&&t.manufacturer!==a)return!1;if(o&&t.model!==o)return!1;if(r&&t.model_id!==r)return!1;var n;if(s&&i&&(null==i||null===(n=i[t.id])||void 0===n||!n.has(s)))return!1;return!0},_=(e,t,i)=>{var a;const{domain:n,device_class:l,supported_features:c,unit_of_measurement:d,integration:h}=e;if(n){const e=(0,r.t)(t);if(Array.isArray(n)?!n.includes(e):e!==n)return!1}if(l){const e=t.attributes.device_class;if(e&&Array.isArray(l)?!l.includes(e):e!==l)return!1}if(c&&!(0,o.e)(c).some(e=>(0,s.$)(t,e)))return!1;if(d){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(d)?!d.includes(e):e!==d))return!1}return!h||(null==i||null===(a=i[t.entity_id])||void 0===a?void 0:a.domain)===h},f=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const t=e.entity,{domain:i,integration:o,device_class:r}=t,s=(0,a.A)(t,c);return i||o||r?{entity:Object.assign(Object.assign({},s),{},{filter:{domain:i,integration:o,device_class:r}})}:{entity:s}},w=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const t=e.device,{integration:i,manufacturer:o,model:r}=t,s=(0,a.A)(t,d);return i||o||r?{device:Object.assign(Object.assign({},s),{},{filter:{integration:i,manufacturer:o,model:r}})}:{device:s}},x=e=>{let t;var i;if("target"in e)t=(0,o.e)(null===(i=e.target)||void 0===i?void 0:i.entity);else if("entity"in e){var a,r;if(null!==(a=e.entity)&&void 0!==a&&a.include_entities)return;t=(0,o.e)(null===(r=e.entity)||void 0===r?void 0:r.filter)}if(!t)return;const s=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,o.e)(e.domain).filter(e=>(0,n.z)(e)));return[...new Set(s)]},C=(e,t,i,a,r,s={target:{}})=>{if(!t)return[];const n=new Set((0,o.e)(t.entity_id)),l=new Set((0,o.e)(t.device_id)),c=new Set((0,o.e)(t.area_id)),d=new Set((0,o.e)(t.floor_id));return new Set((0,o.e)(t.label_id)).forEach(t=>{const o=h(e,t,r,a,i,s);o.devices.forEach(e=>l.add(e)),o.entities.forEach(e=>n.add(e)),o.areas.forEach(e=>c.add(e))}),d.forEach(t=>{u(e,t,r,s).areas.forEach(e=>c.add(e))}),c.forEach(t=>{const o=p(e,t,a,i,s);o.devices.forEach(e=>l.add(e)),o.entities.forEach(e=>n.add(e))}),l.forEach(t=>{v(e,t,i,s).entities.forEach(e=>n.add(e))}),Array.from(n)}},69596:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{I:function(){return l}});i(62953);var o=i(40445),r=i(88696),s=i(67576),n=e([r]);r=(n.then?(await n)():n)[0];const l=e=>{class t extends e{get matchMinHeightTarget(){return t.DEFAULT_MATCH_TARGET}get _matchMinHeightStyle(){return void 0!==this._matchedMinHeight?{"min-height":`${this._matchedMinHeight}px`}:{}}firstUpdated(e){var t;null===(t=super.firstUpdated)||void 0===t||t.call(this,e),this._attachMatchTarget()}updated(e){var t;null===(t=super.updated)||void 0===t||t.call(this,e),this._attachMatchTarget()}disconnectedCallback(){this._detachMatchTarget(),super.disconnectedCallback()}_attachMatchTarget(){const e=this.matchMinHeightTarget;e!==this._matchTarget&&(this._detachMatchTarget(),e&&(this._matchTarget=e,this._matchResize.observe(e)))}_detachMatchTarget(){var e,t;this._matchTarget&&(null===(e=(t=this._matchResize).unobserve)||void 0===e||e.call(t,this._matchTarget),this._matchTarget=null)}constructor(...e){super(...e),this._matchTarget=null,this._matchResize=new r.P(this,{target:null,callback:e=>{var t;const i=null===(t=e[0])||void 0===t?void 0:t.contentRect.height;i&&(this._matchedMinHeight=i)}})}}return t.DEFAULT_MATCH_TARGET=null,(0,o.Cg)([(0,s.wk)()],t.prototype,"_matchedMinHeight",void 0),t};a()}catch(l){a(l)}})},46391:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(89463),i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(13579),i(33110),i(3362),i(62953);var o=i(40445),r=i(53289),s=i(5124),n=i(67576),l=i(89784),c=i(91450),d=i(22786),h=i(93905),u=i(71727),p=i(68246),v=i(24790),m=i(6030),y=i(63130),g=i(81619),b=i(82474),_=i(38962),f=i(18350),w=i(89865),x=(i(76776),i(89300)),C=(i(11382),i(26300)),$=i(67431),k=i(99766),M=i(10763),E=i(88360),O=i(84025),z=i(38859),j=i(14503),A=i(36918),Z=i(17022),P=i(69596),T=i(64481),q=e([b,_,f,w,x,C,$,k,M,P]);[b,_,f,w,x,C,$,k,M,P]=q.then?(await q)():q;let D,S,V,L,H,I,U,B,F,W,R,Y,N,J,K,G,X,Q,ee=e=>e;const te="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z";class ie extends((0,P.I)(s.WF)){get matchMinHeightTarget(){var e;return this._yamlMode?null:null!==(e=this._uiModeContent)&&void 0!==e?e:null}willUpdate(){var e;!this.hasUpdated&&null!==(e=this._serviceData)&&void 0!==e&&e.action&&"string"!=typeof this._serviceData.action&&(this._serviceData.action="")}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("services"),this.hass.loadBackendTranslation("selector");const t=(0,m.p9)("service");t&&(this._serviceData={action:t,target:{},data:{}},this._yamlMode&&this.updateComplete.then(()=>{var e;return null===(e=this._yamlEditor)||void 0===e?void 0:e.setValue(this._serviceData)})),this._checkUiSupported()}render(){var e,t,i,a,o,n,d,h,v,m;const{target:y,fields:g}=this._fields(this.hass.services,null===(e=this._serviceData)||void 0===e?void 0:e.action),b=[{label:this.hass.localize("ui.panel.config.developer-tools.tabs.actions.ui_mode"),value:"ui"},{label:this.hass.localize("ui.panel.config.developer-tools.tabs.actions.yaml_mode"),value:"yaml"}],_=null!==(t=this._serviceData)&&void 0!==t&&t.action?(0,u.m)(null===(i=this._serviceData)||void 0===i?void 0:i.action):void 0,f=null!==(a=this._serviceData)&&void 0!==a&&a.action?(0,p.Y)(null===(o=this._serviceData)||void 0===o?void 0:o.action):void 0,w=_&&f?null===(n=this.hass.services[_])||void 0===n||null===(n=n[f])||void 0===n?void 0:n.description_placeholders:void 0;return(0,s.qy)(D||(D=ee` <div class="content"> <ha-card> <div class="card-header"> <div class="header-row"> <div class="header-title"> ${0} </div> <ha-button-toggle-group size="small" class="yaml-mode-toggle" .buttons="${0}" .active="${0}" .disabled="${0}" @value-changed="${0}"></ha-button-toggle-group> </div> <p class="secondary"> ${0} </p> </div> ${0} ${0} <div class="card-actions"> ${0} <ha-progress-button raised @click="${0}"> ${0} </ha-progress-button> </div> </ha-card> </div> ${0} ${0} `),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.title"),b,this._yamlMode?"yaml":"ui",!this._uiAvailable,this._modeChanged,this.hass.localize("ui.panel.config.developer-tools.tabs.actions.description"),this._yamlMode?(0,s.qy)(S||(S=ee`<div class="card-content" style="${0}"> <ha-service-picker .hass="${0}" .value="${0}" @value-changed="${0}" show-service-id></ha-service-picker> <ha-yaml-editor id="yaml-editor" .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor> </div>`),(0,l.W)(this._matchMinHeightStyle),this.hass,null===(d=this._serviceData)||void 0===d?void 0:d.action,this._serviceChanged,this._serviceData,this._yamlChanged):(0,s.qy)(V||(V=ee` <ha-service-control .hass="${0}" .value="${0}" .narrow="${0}" show-service-id @value-changed="${0}" class="card-content ui-mode-content"></ha-service-control> `),this.hass,this._serviceData,this.narrow,this._serviceDataChanged),void 0!==this._error?(0,s.qy)(L||(L=ee`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):s.s6,this._uiAvailable?s.s6:(0,s.qy)(H||(H=ee`<span class="error">${0}</span>`),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.no_template_ui_support")),this._callService,this.hass.localize("ui.panel.config.developer-tools.tabs.actions.call_service"),null!==(h=this._response)&&void 0!==h&&h.result?(0,s.qy)(I||(I=ee`<div class="content response"> <ha-card .header="${0}"> <div class="card-content"> <ha-yaml-editor read-only auto-update has-extra-actions .value="${0}"> <ha-button appearance="plain" slot="extra-actions" @click="${0}">${0}</ha-button> </ha-yaml-editor> ${0} </div> </ha-card> </div>`),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.response"),this._response.result,this._copyTemplate,this.hass.localize("ui.panel.config.developer-tools.tabs.actions.copy_clipboard_template"),(0,c.T)(this._response.media)):s.s6,(this._yamlMode?g:this._filterSelectorFields(g)).length?(0,s.qy)(U||(U=ee`<div class="content"> <ha-expansion-panel .header="${0}" outlined .expanded="${0}"> ${0} <table class="attributes"> <tr> <th> ${0} </th> <th> ${0} </th> <th> ${0} </th> </tr> ${0} </table> ${0} </ha-expansion-panel> </div>`),this._yamlMode?this.hass.localize("ui.panel.config.developer-tools.tabs.actions.all_parameters"):this.hass.localize("ui.panel.config.developer-tools.tabs.actions.yaml_parameters"),this._yamlMode,this._yamlMode?(0,s.qy)(B||(B=ee`<div class="description"> <h3> ${0} </h3> ${0} </div>`),y?(0,s.qy)(F||(F=ee` ${0} `),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.accepts_target")):"",null!==(v=this._serviceData)&&void 0!==v&&v.action?(0,s.qy)(W||(W=ee` <a href="${0}" title="${0}" target="_blank" rel="noreferrer"> <ha-icon-button class="help-icon" .path="${0}" .label="${0}"></ha-icon-button> </a>`),(0,A.o)(this.hass,"/integrations/"+(0,u.m)(null===(m=this._serviceData)||void 0===m?void 0:m.action)),this.hass.localize("ui.components.service-control.integration_doc"),te,this.hass.localize("ui.common.help")):""):"",this.hass.localize("ui.panel.config.developer-tools.tabs.actions.column_parameter"),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.column_description"),this.hass.localize("ui.panel.config.developer-tools.tabs.actions.column_example"),(this._yamlMode?g:this._filterSelectorFields(g)).map(e=>(0,s.qy)(R||(R=ee` <tr> <td><pre>${0}</pre></td> <td> ${0} </td> <td> ${0} </td> </tr>`),e.key,this.hass.localize(`component.${_}.services.${f}.fields.${e.key}.description`,w)||e.description,this.hass.localize(`component.${_}.services.${f}.fields.${e.key}.example`,w)||("object"==typeof e.example?(0,s.qy)(Y||(Y=ee`<pre>${0}</pre>`),(0,r.dump)(e.example)):e.example))),this._yamlMode?(0,s.qy)(N||(N=ee`<ha-button appearance="plain" @click="${0}">${0}</ha-button>`),this._fillExampleData,this.hass.localize("ui.panel.config.developer-tools.tabs.actions.fill_example_data")):""):"")}async _copyTemplate(){var e;await(0,y.l)(`{% set ${(null===(e=this._serviceData)||void 0===e?void 0:e.response_variable)||"action_response"} = ${JSON.stringify(this._response.result)} %}`),(0,g.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}async _callService(e){var t,i;const a=e.currentTarget;if(this._yamlMode&&!this._yamlValid)return(0,E.j)(this,"failure"),a.actionError(),void(this._error=this.hass.localize("ui.panel.config.developer-tools.tabs.actions.errors.yaml.invalid_yaml"));const{target:o,fields:r}=this._fields(this.hass.services,null===(t=this._serviceData)||void 0===t?void 0:t.action);if(this._error=this._validateServiceData(this._serviceData,r,o,this._yamlMode,this.hass.localize),void 0!==this._error)return(0,E.j)(this,"failure"),void a.actionError();const[n,l]=this._serviceData.action.split(".",2),c=[];null!==(i=this.hass.services)&&void 0!==i&&null!==(i=i[n])&&void 0!==i&&i[l]&&"response"in this.hass.services[n][l]?(c.push(Object.assign(Object.assign({},this._serviceData),{},{response_variable:"service_result"})),c.push({stop:"done",response_variable:"service_result"})):c.push(this._serviceData),a.progress=!0;try{const e=(await(0,z.d)(this.hass,c)).response;this._response={domain:n,service:l,result:e,media:e&&"media_source_id"in e?(0,Z.A1)(this.hass,e.media_source_id).then(e=>e.mime_type.startsWith("image/")?(0,s.qy)(J||(J=ee`<img src="${0}" alt="Media content">`),e.url):e.mime_type.startsWith("video/")?(0,s.qy)(K||(K=ee` <video controls src="${0}" alt="Video content"></video> `),e.url):e.mime_type.startsWith("audio/")?(0,s.qy)(G||(G=ee` <audio controls src="${0}" alt="Audio content"></audio> `),e.url):(0,s.qy)(X||(X=ee` <a href="${0}" target="_blank" rel="noreferrer"><ha-button> ${0} </ha-button></a> `),e.url,this.hass.localize("ui.panel.config.developer-tools.tabs.actions.open_media"))):void 0}}catch(h){var d;if(3===(null===(d=h.error)||void 0===d?void 0:d.code)&&(0,z.C)(n,l))return;let e;if((0,E.j)(this,"failure"),a.actionError(),h.translation_domain&&h.translation_key){e=(await this.hass.loadBackendTranslation("exceptions",h.translation_domain))(`component.${h.translation_domain}.exceptions.${h.translation_key}.message`,h.translation_placeholders)}return void(this._error=e||this.hass.localize("ui.notification_toast.action_failed",{service:this._serviceData.action})+` ${h.message}`)}finally{a.progress=!1}a.actionSuccess()}_modeChanged(e){e.stopPropagation();const t="yaml"===e.detail.value;t!==this._yamlMode&&(0,T.J)(()=>{this._yamlMode=t,this._yamlValid=!0,this._error=void 0})}_yamlChanged(e){var t;e.detail.isValid?(this._yamlValid=!0,"object"==typeof e.detail.value&&((null===(t=this._serviceData)||void 0===t?void 0:t.action)!==e.detail.value.action&&(this._error=void 0),this._serviceData=(0,O.Rn)(e.detail.value),this._checkUiSupported())):this._yamlValid=!1}_checkUiSupported(){this._serviceData&&Object.entries(this._serviceData).some(([e,t])=>!["data","target"].includes(e)&&(0,v.r)(t))?(this._yamlMode=!0,this._uiAvailable=!1):this._uiAvailable=!0}_serviceDataChanged(e){var t;(null===(t=this._serviceData)||void 0===t?void 0:t.action)!==e.detail.value.action&&(this._error=void 0),this._serviceData=e.detail.value,this._checkUiSupported()}_serviceChanged(e){var t;(e.stopPropagation(),e.detail.value)&&(this._serviceData={action:e.detail.value,data:{}},null===(t=this._yamlEditor)||void 0===t||t.setValue(this._serviceData));this._response=void 0,this._error=void 0,this._checkUiSupported()}_fillExampleData(){var e,t,i,a,o,s;const{fields:n}=this._fields(this.hass.services,null===(e=this._serviceData)||void 0===e?void 0:e.action),l=null!==(t=this._serviceData)&&void 0!==t&&t.action?(0,u.m)(null===(i=this._serviceData)||void 0===i?void 0:i.action):void 0,c=null!==(a=this._serviceData)&&void 0!==a&&a.action?(0,p.Y)(null===(o=this._serviceData)||void 0===o?void 0:o.action):void 0,d={};n.forEach(e=>{if(e.example){let i;try{i=(0,r.Hh)(e.example,{schema:r.rQ})}catch(t){i=this.hass.localize(`component.${l}.services.${c}.fields.${e.key}.example`,l&&c?this.hass.services[l][c].description_placeholders:void 0)||e.example}d[e.key]=i}}),this._serviceData=Object.assign(Object.assign({},this._serviceData),{},{data:d}),null===(s=this._yamlEditor)||void 0===s||s.setValue(this._serviceData),this._checkUiSupported()}static get styles(){return[j.RF,(0,s.AH)(Q||(Q=ee`.content{padding:var(--ha-space-4);max-width:1200px;margin:auto}.card-header{display:flex;flex-direction:column;gap:var(--ha-space-1)}.header-row{display:flex;align-items:center;justify-content:space-between;gap:var(--ha-space-2)}.header-title{flex:1;min-width:0}.secondary{margin:0;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:normal;letter-spacing:normal;color:var(--secondary-text-color)}.card-content{display:flex;align-items:stretch;justify-content:flex-start;flex-direction:column;gap:var(--ha-space-4);margin:var(--ha-space-2);--service-control-padding:0}.card-content ha-yaml-editor{flex:1;display:flex;flex-direction:column}.yaml-mode-toggle{flex-shrink:0}.card-actions{display:flex;justify-content:flex-end;align-items:center;gap:var(--ha-space-2)}.card-actions .error{flex:1;color:var(--error-color)}.attributes{width:100%}.attributes th{text-align:var(--float-start);background-color:var(--card-background-color);border-bottom:1px solid var(--primary-text-color);direction:var(--direction)}.attributes tr{vertical-align:top;direction:ltr}.attributes tr:nth-child(odd){background-color:var(--table-row-background-color,#eee)}.attributes tr:nth-child(2n){background-color:var(--table-row-alternative-background-color,#eee)}.attributes td:nth-child(3){white-space:pre-wrap;word-break:break-word}.attributes td{padding:var(--ha-space-1);vertical-align:middle}.help-icon{color:var(--secondary-text-color)}.description{justify-content:space-between;display:flex;align-items:center}.response img{max-width:100%;height:auto;margin-top:var(--ha-space-6)}`))]}constructor(...e){super(...e),this.narrow=!1,this._uiAvailable=!0,this._yamlValid=!0,this._serviceData={action:"",target:{},data:{}},this._yamlMode=!1,this._filterSelectorFields=(0,d.A)(e=>e.filter(e=>!e.selector)),this._validateServiceData=(e,t,i,a,o)=>{var r,s,n;const l=a?"yaml":"ui";if(null==e||!e.action)return o(`ui.panel.config.developer-tools.tabs.actions.errors.${l}.no_action`);const c=(0,u.m)(e.action),d=(0,p.Y)(e.action);if(!c||!d)return o(`ui.panel.config.developer-tools.tabs.actions.errors.${l}.invalid_action`);const h="string"==typeof e.data&&(0,v.F)(e.data);if(i&&!h&&!e.target&&(null===(r=e.data)||void 0===r||!r.entity_id)&&(null===(s=e.data)||void 0===s||!s.device_id)&&(null===(n=e.data)||void 0===n||!n.area_id))return o(`ui.panel.config.developer-tools.tabs.actions.errors.${l}.no_target`);for(const u of t)if(u.required&&!h&&(!e.data||void 0===e.data[u.key]))return o(`ui.panel.config.developer-tools.tabs.actions.errors.${l}.missing_required_field`,{key:u.key})},this._fields=(0,d.A)((e,t)=>{if(!t)return{target:!1,fields:[]};const i=(0,u.m)(t),a=(0,p.Y)(t);if(!(i in e))return{target:!1,fields:[]};if(!(a in e[i]))return{target:!1,fields:[]};const o="target"in e[i][a],r=e[i][a].fields,s=[],n=e=>{Object.keys(e).forEach(t=>{const i=e[t];i.fields?n(i.fields):s.push(Object.assign({key:t},i))})};return n(r),{target:o,fields:s}})}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],ie.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],ie.prototype,"narrow",void 0),(0,o.Cg)([(0,n.wk)()],ie.prototype,"_uiAvailable",void 0),(0,o.Cg)([(0,n.wk)()],ie.prototype,"_response",void 0),(0,o.Cg)([(0,n.wk)()],ie.prototype,"_error",void 0),(0,o.Cg)([(0,n.wk)(),(0,h.I)({key:"panel-dev-action-state-service-data",state:!0,subscribe:!1})],ie.prototype,"_serviceData",void 0),(0,o.Cg)([(0,n.wk)(),(0,h.I)({key:"panel-dev-action-state-yaml-mode",state:!0,subscribe:!1})],ie.prototype,"_yamlMode",void 0),(0,o.Cg)([(0,n.P)("#yaml-editor")],ie.prototype,"_yamlEditor",void 0),(0,o.Cg)([(0,n.P)(".ui-mode-content")],ie.prototype,"_uiModeContent",void 0),ie=(0,o.Cg)([(0,n.EM)("developer-tools-action")],ie),a()}catch(D){a(D)}})},24367:function(e,t,i){i.d(t,{L:function(){return o},z:function(){return r}});var a=i(23832);const o=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,a.g)(o)},19711:function(e,t,i){i.d(t,{$:function(){return r}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),r=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:o,dialogParams:t})}},53580:function(e,t,i){i.d(t,{mdiHomeAssistant:function(){return a}});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},36918:function(e,t,i){i.d(t,{o:function(){return a}});const a=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]);