UNPKG

iobroker.lovelace

Version:

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

1 lines 29.4 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[79524],{69558:function(e,t,i){i.d(t,{_:function(){return a}});i(16280),i(18111),i(7588),i(62953);var n=i(5124),r=i(54495);const a=(0,r.u$)(class extends r.WL{update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach(([e,t])=>{this._element[e]=t}),n.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!==r.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},69093:function(e,t,i){i.d(t,{t:function(){return r}});var n=i(71727);const r=e=>(0,n.m)(e.entity_id)},82286:function(e,t,i){i.d(t,{$:function(){return n}});const n=(e,t)=>r(e.attributes,t),r=(e,t)=>0!==(e.supported_features&t)},52763:function(e,t,i){i.a(e,async function(e,n){try{i.d(t,{U:function(){return E}});i(74423),i(18111),i(7588),i(61701),i(3362),i(62953);var r=i(40445),a=i(5124),o=i(67576),s=i(69558),l=i(1087),d=i(38962),c=(i(11399),e([d]));d=(c.then?(await c)():c)[0];let h,u,p,m,_,b,f,v,g,y=e=>e;const P={boolean:()=>i.e(81347).then(i.bind(i,46990)),constant:()=>i.e(65733).then(i.bind(i,90820)),float:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(51868),i.e(62574),i.e(16113)]).then(i.bind(i,20676)),grid:()=>i.e(60761).then(i.bind(i,70208)),expandable:()=>i.e(45001).then(i.bind(i,40003)),integer:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(21543),i.e(86712),i.e(62574),i.e(12145)]).then(i.bind(i,20036)),multi_select:()=>Promise.all([i.e(72850),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(58303),i.e(71739),i.e(78219)]).then(i.bind(i,36182)),positive_time_period_dict:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(67943),i.e(62574),i.e(16508),i.e(21486)]).then(i.bind(i,89422)),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(99463),i.e(62574),i.e(26092),i.e(39005),i.e(35873),i.e(63577)]).then(i.bind(i,63804)),string:()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(84725),i.e(62574),i.e(6762)]).then(i.bind(i,54753)),optional_actions:()=>Promise.all([i.e(72850),i.e(39763),i.e(34995),i.e(67395)]).then(i.bind(i,8456))},C=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,w=(e,t)=>e&&t.name?e[t.name]:null,$=(e,t)=>e&&t.name?e[t.name]:null;class E extends a.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let i,n=!0;var r,a;(this.schema.forEach((e,r)=>{var a;const o=t[r];if(!o)return;let s=!0;if("reportValidity"in o&&"function"==typeof o.reportValidity)s=o.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(null!==(a=e.type)&&void 0!==a?a:""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=C(this.data,e);s=null!=t&&""!==t}s||(n=!1,i||(i=o))}),i)&&(null===(r=(a=i).focus)||void 0===r||r.call(a));return n}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{var t;"selector"in e||null===(t=P[e.type])||void 0===t||t.call(P)})}render(){return(0,a.qy)(h||(h=y` <div class="root" part="root"> ${0} ${0} </div> `),this.error&&this.error.base?(0,a.qy)(u||(u=y` <ha-alert alert-type="error"> ${0} </ha-alert> `),this._computeError(this.error.base,this.schema)):"",this.schema.map(e=>{var t;const i=w(this.error,e),n=$(this.warning,e);return(0,a.qy)(p||(p=y` ${0} ${0} `),i?(0,a.qy)(m||(m=y` <ha-alert own-margin alert-type="error"> ${0} </ha-alert> `),this._computeError(i,e)):n?(0,a.qy)(_||(_=y` <ha-alert own-margin alert-type="warning"> ${0} </ha-alert> `),this._computeWarning(n,e)):"","selector"in e?(0,a.qy)(b||(b=y`<ha-selector .schema="${0}" .hass="${0}" .narrow="${0}" .name="${0}" .selector="${0}" .value="${0}" .label="${0}" .disabled="${0}" .placeholder="${0}" .helper="${0}" .localizeValue="${0}" .required="${0}" .context="${0}"></ha-selector>`),e,this.hass,this.narrow,e.name,e.selector,C(this.data,e),this._computeLabel(e,this.data),e.disabled||this.disabled||!1,e.required?void 0:e.default,this._computeHelper(e),this.localizeValue,e.required||!1,this._generateContext(e)):(0,s._)(this.fieldElementName(e.type),Object.assign({schema:e,data:C(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:null===(t=this.hass)||void 0===t?void 0:t.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e)},this.getFormProperties())))}))}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t=Object.assign({},this.context);if(e.context)for(const[i,n]of Object.entries(e.context))t[i]=this.data[n];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const i=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data=Object.assign(Object.assign({},this.data),i),(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?(0,a.qy)(f||(f=y`<ul> ${0} </ul>`),e.map(e=>(0,a.qy)(v||(v=y`<li> ${0} </li>`),this.computeError?this.computeError(e,t):e))):this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}E.shadowRootOptions={mode:"open",delegatesFocus:!0},E.styles=(0,a.AH)(g||(g=y`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`)),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],E.prototype,"narrow",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"data",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"schema",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"error",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"warning",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],E.prototype,"disabled",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"computeError",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"computeWarning",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"computeLabel",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"computeHelper",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"localizeValue",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],E.prototype,"context",void 0),(0,r.Cg)([(0,o.P)(".root")],E.prototype,"_root",void 0),E=(0,r.Cg)([(0,o.EM)("ha-form")],E),n()}catch(h){n(h)}})},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 n=i(40445),r=i(5124),a=i(67576),o=i(22786),s=i(69558),l=i(95311);let d,c=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 r.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,r.qy)(d||(d=c` ${0} `),(0,s._)(`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,o.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,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],p.prototype,"narrow",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"name",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"selector",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"value",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"label",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"helper",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"localizeValue",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"placeholder",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean})],p.prototype,"required",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,n.Cg)([(0,a.P)("#selector",!0)],p.prototype,"_selectorElement",void 0),p=(0,n.Cg)([(0,a.EM)("ha-selector")],p)},95311:function(e,t,i){i.d(t,{DF:function(){return b},Lo:function(){return C},MH:function(){return u},MM:function(){return f},Qz:function(){return _},Ru:function(){return g},UU:function(){return y},_7:function(){return m},bZ:function(){return p},m0:function(){return h},tD:function(){return P},vX:function(){return v},wY:function(){return w}});var n=i(86518),r=(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)),a=i(69093),o=i(82286),s=i(24367),l=i(58594);const d=["domain","integration","device_class"],c=["integration","manufacturer","model"],h=(e,t,i,n,r,a,o)=>{const s=[],l=[],d=[];return Object.values(i).forEach(i=>{i.labels.includes(t)&&_(e,r,n,i.area_id,a,o)&&d.push(i.area_id)}),Object.values(n).forEach(i=>{i.labels.includes(t)&&b(e.states,Object.values(r),i,a,o)&&l.push(i.id)}),Object.values(r).forEach(i=>{i.labels.includes(t)&&f(e.states[i.entity_id],a,o)&&s.push(i.entity_id)}),{areas:d,devices:l,entities:s}},u=(e,t,i,n,r)=>{const a=[];return Object.values(i).forEach(i=>{i.floor_id===t&&_(e,e.entities,e.devices,i.area_id,n,r)&&a.push(i.area_id)}),{areas:a}},p=(e,t,i,n,r,a)=>{const o=[],s=[];return Object.values(i).forEach(i=>{i.area_id===t&&b(e.states,Object.values(n),i,r,a)&&s.push(i.id)}),Object.values(n).forEach(i=>{i.area_id===t&&f(e.states[i.entity_id],r,a)&&o.push(i.entity_id)}),{devices:s,entities:o}},m=(e,t,i,n,r)=>{const a=[];return Object.values(i).forEach(i=>{i.device_id===t&&f(e.states[i.entity_id],n,r)&&a.push(i.entity_id)}),{entities:a}},_=(e,t,i,n,r,a)=>!!Object.values(i).some(i=>!(i.area_id!==n||!b(e.states,Object.values(t),i,r,a)))||Object.values(t).some(t=>!(t.area_id!==n||!f(e.states[t.entity_id],r,a))),b=(e,t,i,n,a)=>{var o,s;const d=a?(0,l.fk)(a,t):void 0;if(null!==(o=n.target)&&void 0!==o&&o.device&&!(0,r.e)(n.target.device).some(e=>v(e,i,d)))return!1;if(null!==(s=n.target)&&void 0!==s&&s.entity){return t.filter(e=>e.device_id===i.id).some(t=>{const i=e[t.entity_id];return f(i,n,a)})}return!0},f=(e,t,i)=>{var n;return!!e&&(null===(n=t.target)||void 0===n||!n.entity||(0,r.e)(t.target.entity).some(t=>g(t,e,i)))},v=(e,t,i)=>{const{manufacturer:n,model:r,model_id:a,integration:o}=e;if(n&&t.manufacturer!==n)return!1;if(r&&t.model!==r)return!1;if(a&&t.model_id!==a)return!1;var s;if(o&&i&&(null==i||null===(s=i[t.id])||void 0===s||!s.has(o)))return!1;return!0},g=(e,t,i)=>{var n;const{domain:s,device_class:l,supported_features:d,unit_of_measurement:c,integration:h}=e;if(s){const e=(0,a.t)(t);if(Array.isArray(s)?!s.includes(e):e!==s)return!1}if(l){const e=t.attributes.device_class;if(e&&Array.isArray(l)?!l.includes(e):e!==l)return!1}if(d&&!(0,r.e)(d).some(e=>(0,o.$)(t,e)))return!1;if(c){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(c)?!c.includes(e):e!==c))return!1}return!h||(null==i||null===(n=i[t.entity_id])||void 0===n?void 0:n.domain)===h},y=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const t=e.entity,{domain:i,integration:r,device_class:a}=t,o=(0,n.A)(t,d);return i||r||a?{entity:Object.assign(Object.assign({},o),{},{filter:{domain:i,integration:r,device_class:a}})}:{entity:o}},P=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const t=e.device,{integration:i,manufacturer:r,model:a}=t,o=(0,n.A)(t,c);return i||r||a?{device:Object.assign(Object.assign({},o),{},{filter:{integration:i,manufacturer:r,model:a}})}:{device:o}},C=e=>{let t;var i;if("target"in e)t=(0,r.e)(null===(i=e.target)||void 0===i?void 0:i.entity);else if("entity"in e){var n,a;if(null!==(n=e.entity)&&void 0!==n&&n.include_entities)return;t=(0,r.e)(null===(a=e.entity)||void 0===a?void 0:a.filter)}if(!t)return;const o=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,r.e)(e.domain).filter(e=>(0,s.z)(e)));return[...new Set(o)]},w=(e,t,i,n,a,o={target:{}})=>{if(!t)return[];const s=new Set((0,r.e)(t.entity_id)),l=new Set((0,r.e)(t.device_id)),d=new Set((0,r.e)(t.area_id)),c=new Set((0,r.e)(t.floor_id));return new Set((0,r.e)(t.label_id)).forEach(t=>{const r=h(e,t,a,n,i,o);r.devices.forEach(e=>l.add(e)),r.entities.forEach(e=>s.add(e)),r.areas.forEach(e=>d.add(e))}),c.forEach(t=>{u(e,t,a,o).areas.forEach(e=>d.add(e))}),d.forEach(t=>{const r=p(e,t,n,i,o);r.devices.forEach(e=>l.add(e)),r.entities.forEach(e=>s.add(e))}),l.forEach(t=>{m(e,t,i,o).entities.forEach(e=>s.add(e))}),Array.from(s)}},24367:function(e,t,i){i.d(t,{L:function(){return r},z:function(){return a}});var n=i(23832);const r=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],a=(0,n.g)(r)},41231:function(e,t,i){i.a(e,async function(e,n){try{i.r(t),i.d(t,{DialogPanelDetail:function(){return y}});i(3362),i(42762),i(62953);var r=i(40445),a=i(5124),o=i(67576),s=i(22786),l=i(1087),d=i(18350),c=(i(93444),i(29823)),h=(i(70947),i(52763)),u=i(26300),p=(i(67094),i(72554)),m=i(14503),_=e([d,c,h,u,p]);[d,c,h,u,p]=_.then?(await _)():_;let b,f=e=>e;const v="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",g="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z";class y extends a.WF{showDialog(e){this._params=e,this._error=void 0,this._data={title:e.title,icon:e.icon,require_admin:e.requireAdmin,show_in_sidebar:e.showInSidebar},this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._data=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params||!this._data)return a.s6;const e=!this._data.title||!this._data.title.trim();return(0,a.qy)(b||(b=f` <ha-dialog .open="${0}" prevent-scrim-close header-title="${0}" @closed="${0}"> <ha-dropdown slot="headerActionItems" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> <ha-form autofocus .schema="${0}" .data="${0}" .hass="${0}" .error="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.config.lovelace.dashboards.panel_detail.edit_panel"),this._dialogClosed,this.hass.localize("ui.common.menu"),v,this._resetPanel,g,this.hass.localize("ui.panel.config.lovelace.dashboards.panel_detail.reset_to_default"),this._schema(this._params.isDefault,this._data.require_admin),this._data,this.hass,this._error,this._computeLabel,this._computeHelper,this._valueChanged,this.closeDialog,this.hass.localize("ui.common.cancel"),this._updatePanel,e||this._submitting,this.hass.localize("ui.panel.config.lovelace.dashboards.detail.update"))}_valueChanged(e){this._error=void 0,this._data=e.detail.value}async _handleError(e){let t;if(null!=e&&e.translation_domain&&null!=e&&e.translation_key){t=(await this.hass.loadBackendTranslation("exceptions",e.translation_domain))(`component.${e.translation_domain}.exceptions.${e.translation_key}.message`,e.translation_placeholders)}this._error={base:t||(null==e?void 0:e.message)||"Unknown error"}}async _resetPanel(){this._submitting=!0;try{await this._params.updatePanel({title:null,icon:null,require_admin:null,show_in_sidebar:null}),this.closeDialog()}catch(e){this._handleError(e)}finally{this._submitting=!1}}async _updatePanel(){this._submitting=!0;try{const e={};this._data.title!==this._params.title&&(e.title=this._data.title),(this._data.icon||void 0)!==this._params.icon&&(e.icon=this._data.icon||null),this._data.require_admin!==this._params.requireAdmin&&(e.require_admin=this._data.require_admin),this._data.show_in_sidebar!==this._params.showInSidebar&&(e.show_in_sidebar=this._data.show_in_sidebar),Object.keys(e).length>0&&await this._params.updatePanel(e),this.closeDialog()}catch(e){this._handleError(e)}finally{this._submitting=!1}}constructor(...e){super(...e),this._submitting=!1,this._open=!1,this._schema=(0,s.A)((e,t)=>[{name:"title",required:!0,selector:{text:{}}},{name:"icon",required:!1,selector:{icon:{}}},{name:"require_admin",required:!0,disabled:e&&!t,selector:{boolean:{}}},{name:"show_in_sidebar",required:!0,selector:{boolean:{}}}]),this._computeLabel=e=>this.hass.localize(`ui.panel.config.lovelace.dashboards.panel_detail.${e.name}`),this._computeHelper=e=>"require_admin"===e.name&&e.disabled?this.hass.localize("ui.panel.config.lovelace.dashboards.panel_detail.require_admin_helper"):""}}y.styles=m.nA,(0,r.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_params",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_data",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_error",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_submitting",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_open",void 0),y=(0,r.Cg)([(0,o.EM)("dialog-panel-detail")],y),n()}catch(b){n(b)}})},48646:function(e,t,i){var n=i(69565),r=i(28551),a=i(1767),o=i(50851);e.exports=function(e,t){t&&"string"==typeof e||r(e);var i=o(e);return a(r(void 0!==i?n(i,e):e))}},78350:function(e,t,i){var n=i(46518),r=i(70259),a=i(79306),o=i(48981),s=i(26198),l=i(1469);n({target:"Array",proto:!0},{flatMap:function(e){var t,i=o(this),n=s(i);return a(e),t=l(i,0),r(t,i,i,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},30237:function(e,t,i){i(6469)("flatMap")},30531:function(e,t,i){var n=i(46518),r=i(69565),a=i(79306),o=i(28551),s=i(1767),l=i(48646),d=i(19462),c=i(9539),h=i(96395),u=i(30684),p=i(84549);var m=!h&&!u("flatMap",function(){}),_=!h&&!m&&p("flatMap",TypeError),b=h||m||_||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(t){return!0}}(),f=d(function(){for(var e,t,i=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=o(r(t.next,t.iterator))).done)return e.value;this.inner=null}catch(a){c(i,"throw",a)}if(e=o(r(this.next,i)),this.done=!!e.done)return;try{this.inner=l(n(e.value,this.counter++),!1)}catch(a){c(i,"throw",a)}}});n({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function(e){o(this);try{a(e)}catch(t){c(this,"throw",t)}return _?r(_,this,e):new f(s(this),{mapper:e,inner:null})}})},54495:function(e,t,i){i.d(t,{OA:function(){return n.OA},WL:function(){return n.WL},u$:function(){return n.u$}});var n=i(42017)}}]);