UNPKG

iobroker.lovelace

Version:

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

4 lines 101 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["94846"],{50875:function(e,t,i){i.d(t,{Eu:()=>o,hZ:()=>r,o9:()=>l});var a=i(27486),n=i(11259);const s=["#4269d0","#f4bd4a","#ff725c","#6cc5b0","#a463f2","#ff8ab7","#9c6b4e","#97bbf5","#01ab63","#9498a0","#094bad","#c99000","#d84f3e","#49a28f","#048732","#d96895","#8043ce","#7599d1","#7a4c31","#74787f","#6989f4","#ffd444","#ff957c","#8fe9d3","#62cc71","#ffadda","#c884ff","#badeff","#bf8b6d","#b6bac2","#927acc","#97ee3f","#bf3947","#9f5b00","#f48758","#8caed6","#f2b94f","#eff26e","#e43872","#d9b100","#9d7a00","#698cff","#d9d9d9","#00d27e","#d06800","#009f82","#c49200","#cbe8ff","#fecddf","#c27eb6","#8cd2ce","#c4b8d9","#f883b0","#a49100","#f48800","#27d0df","#a04a9b"];function o(e){return s[e%s.length]}function r(e,t){const i=t.getPropertyValue(`--graph-color-${e+1}`)||o(e);return(0,n.Rq)(i)}const l=(0,a.Z)((e=>s.map(((t,i)=>r(i,e)))),((e,t)=>e[0].getPropertyValue("--graph-color-1")===t[0].getPropertyValue("--graph-color-1")))},94947:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{G:()=>d});var n=i(16485),s=i(27486),o=i(27046),r=e([n,o]);[n,o]=r.then?(await r)():r;const l=(0,s.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),d=(e,t,i,a=!0)=>{const n=(0,o.W)(e,i,t);return a?l(t).format(n.value,n.unit):Intl.NumberFormat(t.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};a()}catch(l){a(l)}}))},76002:function(e,t,i){i.d(t,{Q:()=>a});i(19134),i(97003);const a=e=>e.replace(/^_*(.)|_+(.)/g,((e,t,i)=>t?t.toUpperCase():" "+i.toUpperCase()))},85746:function(e,t,i){i.d(t,{V:()=>n});var a=i(87733);const n=(e,t)=>(e=>{switch(e){case"de":case"lb":return!0;default:return!1}})(t)?(0,a.f)(e):e.toLocaleLowerCase(t)},27046:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{W:()=>v});i(19423);var n=i(13809),s=i(29558),o=i(94763),r=i(19631),l=e([r]);r=(l.then?(await l)():l)[0];const c=1e3,h=60,u=60*h;function v(e,t=Date.now(),i,a={}){const l=Object.assign(Object.assign({},f),a||{}),d=(+e-+t)/c;if(Math.abs(d)<l.second)return{value:Math.round(d),unit:"second"};const v=d/h;if(Math.abs(v)<l.minute)return{value:Math.round(v),unit:"minute"};const g=d/u;if(Math.abs(g)<l.hour)return{value:Math.round(g),unit:"hour"};const m=new Date(e),p=new Date(t);m.setHours(0,0,0,0),p.setHours(0,0,0,0);const y=(0,n.j)(m,p);if(0===y)return{value:Math.round(g),unit:"hour"};if(Math.abs(y)<l.day)return{value:y,unit:"day"};const _=(0,r.Bt)(i),b=(0,s.z)(m,{weekStartsOn:_}),k=(0,s.z)(p,{weekStartsOn:_}),w=(0,o.p)(b,k);if(0===w)return{value:y,unit:"day"};if(Math.abs(w)<l.week)return{value:w,unit:"week"};const $=m.getFullYear()-p.getFullYear(),x=12*$+m.getMonth()-p.getMonth();return 0===x?{value:w,unit:"week"}:Math.abs(x)<l.month||0===$?{value:x,unit:"month"}:{value:Math.round($),unit:"year"}}const f={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(d){a(d)}}))},44925:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),o=i(28816);i(65981);let r,l=e=>e;(0,a.Z)([(0,s.Mo)("ha-battery-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"batteryStateObj",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"batteryChargingStateObj",value:void 0},{kind:"method",key:"render",value:function(){var e;return this.batteryStateObj?(0,n.dy)(r||(r=l` <ha-icon .icon="${0}"></ha-icon> `),(0,o.U)(this.batteryStateObj.state,"on"===(null===(e=this.batteryChargingStateObj)||void 0===e?void 0:e.state))):n.Ld}}]}}),n.oi)},20130:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(39785)),o=i(52876),r=i(50778),l=i(57243),d=i(5111);let c,h,u,v=e=>e;(0,a.Z)([(0,r.Mo)("ha-fab")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,l.iv)(c||(c=v`:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`)),"rtl"===d.E.document.dir?(0,l.iv)(h||(h=v`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,l.iv)(u||(u=v``))]}}]}}),s._)},13928:function(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>r});var a=i(61701),n=(i(71695),i(47021),i(50778)),s=i(5111),o=i(37583);let r=(0,a.Z)([(0,n.Mo)("ha-icon-next")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"path",value(){return"rtl"===s.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}]}}),o.HaSvgIcon)},51223:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),o=i(94571),r=i(59847),l=i(45729),d=(i(65981),i(37583),e([l]));l=(d.then?(await d)():d)[0];let c,h,u,v,f=e=>e;(0,a.Z)([(0,s.Mo)("ha-state-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){var e,t;const i=this.icon||this.stateObj&&(null===(e=this.hass)||void 0===e||null===(e=e.entities[this.stateObj.entity_id])||void 0===e?void 0:e.icon)||(null===(t=this.stateObj)||void 0===t?void 0:t.attributes.icon);if(i)return(0,n.dy)(c||(c=f`<ha-icon .icon="${0}"></ha-icon>`),i);if(!this.stateObj)return n.Ld;if(!this.hass)return this._renderFallback();const a=(0,l.gD)(this.hass,this.stateObj,this.stateValue).then((e=>e?(0,n.dy)(h||(h=f`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,n.dy)(u||(u=f`${0}`),(0,o.C)(a))}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,r.N)(this.stateObj);return(0,n.dy)(v||(v=f` <ha-svg-icon .path="${0}"></ha-svg-icon> `),l.Ls[e]||l.Rb)}}]}}),n.oi);t()}catch(c){t(c)}}))},41927:function(e,t,i){i.d(t,{Bg:()=>h,DT:()=>c,SY:()=>l,aJ:()=>o,cz:()=>r,ko:()=>d});var a=i(75278),n=i(96194);let s=function(e){return e[e.ANNOUNCE=1]="ANNOUNCE",e}({});const o=(e,t,i)=>e.connection.subscribeMessage(i,{type:"assist_satellite/intercept_wake_word",entity_id:t}),r=(e,t)=>e.callWS({type:"assist_satellite/test_connection",entity_id:t}),l=(e,t,i)=>e.callService("assist_satellite","announce",i,{entity_id:t}),d=(e,t)=>e.callWS({type:"assist_satellite/get_configuration",entity_id:t}),c=(e,t,i)=>e.callWS({type:"assist_satellite/set_wake_words",entity_id:t,wake_word_ids:i}),h=e=>e&&e.state!==n.nZ&&(0,a.e)(e,s.ANNOUNCE)},43546:function(e,t,i){i.d(t,{Cp:()=>o,TZ:()=>r,W2:()=>s,YY:()=>d,iI:()=>n,j2:()=>l,oT:()=>a});i(19083),i(9359),i(70104),i(77439),i(19423),i(40251),i(97499),i(61006);const a=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}})),n=(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}),o=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),r=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),l=(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})},12068:function(e,t,i){i.d(t,{B:()=>a,l:()=>n});i(71695),i(9359),i(31526),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const a=e=>{const t={};return Object.entries(e).forEach((([e,i])=>{t[e]={value:i.value,items:i.items instanceof Set?Array.from(i.items):i.items}})),t},n=e=>{const t={};return Object.entries(e).forEach((([e,i])=>{t[e]={value:i.value,items:Array.isArray(i.items)?new Set(i.items):i.items}})),t}},6823:function(e,t,i){i.d(t,{ZK:()=>o,iP:()=>s,lf:()=>n,pD:()=>a});const a=e=>e.callWS({type:"diagnostics/list"}),n=(e,t)=>e.callWS({type:"diagnostics/get",domain:t}),s=e=>`/api/diagnostics/config_entry/${e}`,o=(e,t)=>`/api/diagnostics/config_entry/${e}/device/${t}`},25433:function(e,t,i){i.d(t,{MY:()=>p,Yc:()=>v,hb:()=>g,jV:()=>d,o1:()=>f,ri:()=>m,sS:()=>h});i(71695),i(40251),i(19134),i(11740),i(97003),i(88044),i(47021);var a=i(73358),n=i(73850),s=i(59847),o=i(85746),r=i(96194);const l="ui.components.logbook.messages",d=["counter","proximity","sensor","zone"],c={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},h=async(e,t,i)=>u(e,t,void 0,void 0,i),u=(e,t,i,a,n,s)=>{if((a||s)&&(!a||0===a.length)&&(!s||0===s.length))return Promise.resolve([]);const o={type:"logbook/get_events",start_time:t};return i&&(o.end_time=i),null!=a&&a.length&&(o.entity_ids=a),null!=s&&s.length&&(o.device_ids=s),n&&(o.context_id=n),e.callWS(o)},v=(e,t,i,a,n,s)=>{if((n||s)&&(!n||0===n.length)&&(!s||0===s.length))return Promise.reject("No entities or devices");const o={type:"logbook/event_stream",start_time:i,end_time:a};return null!=n&&n.length&&(o.entity_ids=n),null!=s&&s.length&&(o.device_ids=s),e.connection.subscribeMessage((e=>t(e)),o)},f=(e,t)=>({entity_id:e.entity_id,state:t,attributes:{device_class:null==e?void 0:e.attributes.device_class,source_type:null==e?void 0:e.attributes.source_type,has_date:null==e?void 0:e.attributes.has_date,has_time:null==e?void 0:e.attributes.has_time,entity_picture_local:a.iY.has((0,n.M)(e.entity_id))||null==e?void 0:e.attributes.entity_picture_local,entity_picture:a.iY.has((0,n.M)(e.entity_id))||null==e?void 0:e.attributes.entity_picture}}),g=(e,t)=>{for(const i of Object.keys(c)){const a=c[i];if(t.startsWith(a))return t.replace(a,`${e(`ui.components.logbook.${i}`)}`)}return t},m=(e,t,i,n,s)=>{switch(s){case"device_tracker":case"person":return"not_home"===i?t(`${l}.was_away`):"home"===i?t(`${l}.was_at_home`):t(`${l}.was_at_state`,{state:i});case"sun":return t("above_horizon"===i?`${l}.rose`:`${l}.set`);case"binary_sensor":{const s=i===a.uo,r=i===a.lC,d=n.attributes.device_class;if(d&&(s||r))return t(`${l}.${s?"detected_device_classes":"cleared_device_classes"}.${d}`,{device_class:(0,o.V)(t(`component.binary_sensor.entity_component.${d}.name`)||d,e.language)})||t(`${l}.${s?"detected_device_class":"cleared_device_class"}`,{device_class:(0,o.V)(t(`component.binary_sensor.entity_component.${d}.name`)||d,e.language)});break}case"cover":switch(i){case"open":return t(`${l}.was_opened`);case"opening":return t(`${l}.is_opening`);case"closing":return t(`${l}.is_closing`);case"closed":return t(`${l}.was_closed`)}break;case"event":return t(`${l}.detected_event_no_type`);case"lock":switch(i){case"unlocked":return t(`${l}.was_unlocked`);case"locking":return t(`${l}.is_locking`);case"unlocking":return t(`${l}.is_unlocking`);case"opening":return t(`${l}.is_opening`);case"open":return t(`${l}.is_opened`);case"locked":return t(`${l}.was_locked`);case"jammed":return t(`${l}.is_jammed`)}}return i===a.uo?t(`${l}.turned_on`):i===a.lC?t(`${l}.turned_off`):i===r.lz?t(`${l}.became_unknown`):i===r.nZ?t(`${l}.became_unavailable`):e.localize(`${l}.changed_to_state`,{state:n?e.formatEntityState(n,i):i})},p=e=>"sensor"!==(0,s.N)(e)||void 0===e.attributes.unit_of_measurement&&void 0===e.attributes.state_class},48977:function(e,t,i){function a(e){return"strategy"in e}i.d(t,{Oh:()=>s,Q2:()=>n,Tx:()=>a,vj:()=>o});const n=(e,t,i)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:i}),s=(e,t,i)=>e.callWS({type:"lovelace/config/save",url_path:t,config:i}),o=(e,t)=>e.callWS({type:"lovelace/config/delete",url_path:t})},6649:function(e,t,i){i.d(t,{JR:()=>n,Y:()=>s,iM:()=>o,j2:()=>a});i(19423);const a=e=>e.callWS({type:"lovelace/dashboards/list"}),n=(e,t)=>e.callWS(Object.assign({type:"lovelace/dashboards/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},i)),o=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},21168:function(e,t,i){i.d(t,{k:()=>s});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("91552"),i.e("78456"),i.e("24199"),i.e("41258"),i.e("56898"),i.e("78943"),i.e("35671"),i.e("42950"),i.e("65505"),i.e("5080"),i.e("50408"),i.e("7010"),i.e("88482"),i.e("66429"),i.e("18865"),i.e("27090"),i.e("44959"),i.e("80809"),i.e("90296")]).then(i.bind(i,42474)),s=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"ha-voice-assistant-setup-dialog",dialogImport:n,dialogParams:t})}},34515:function(e,t,i){i.r(t);var a=i(61701),n=(i(71695),i(47021),i(31622),i(57243)),s=i(50778);i(54202),i(43344),i(99426);let o,r,l,d,c,h=e=>e;(0,a.Z)([(0,s.Mo)("hass-error-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"toolbar",value(){return!0}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)()],key:"error",value:void 0},{kind:"method",key:"render",value:function(){var e,t;return(0,n.dy)(o||(o=h` ${0} <div class="content"> <ha-alert alert-type="error">${0}</ha-alert> <slot> <mwc-button @click="${0}"> ${0} </mwc-button> </slot> </div> `),this.toolbar?(0,n.dy)(r||(r=h`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,n.dy)(l||(l=h` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,n.dy)(d||(d=h` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)):"",this.error,this._handleBack,null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,n.iv)(c||(c=h`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev{pointer-events:auto}.content{color:var(--primary-text-color);height:calc(100% - var(--header-height));display:flex;padding:16px;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}a{color:var(--primary-color)}ha-alert{margin-bottom:16px}`))]}}]}}),n.oi)},87979:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),o=i(31146),r=(i(54202),i(43344),i(28008));let l,d,c,h,u,v=e=>e;(0,a.Z)([(0,s.Mo)("hass-subpage")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"main-page"})],key:"mainPage",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"backCallback",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"supervisor",value(){return!1}},{kind:"field",decorators:[(0,o.i)(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(l||(l=v` <div class="toolbar"> ${0} <div class="main-title"><slot name="header">${0}</slot></div> <slot name="toolbar-icon"></slot> </div> <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),this.mainPage||null!==(e=history.state)&&void 0!==e&&e.root?(0,n.dy)(d||(d=v` <ha-menu-button .hassio="${0}" .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.supervisor,this.hass,this.narrow):this.backPath?(0,n.dy)(c||(c=v` <a href="${0}"> <ha-icon-button-arrow-prev .hass="${0}"></ha-icon-button-arrow-prev> </a> `),this.backPath,this.hass):(0,n.dy)(h||(h=v` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,this._saveScrollPos)}},{kind:"method",decorators:[(0,s.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.$c,(0,n.iv)(u||(u=v`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin:var(--margin-title);line-height:20px;min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:1px}.content{position:relative;width:100%;height:calc(100% - 1px - var(--header-height));overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}#fab{position:absolute;right:calc(16px + env(safe-area-inset-right));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}:host([narrow]) #fab.tabs{bottom:calc(84px + env(safe-area-inset-bottom))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}`))]}}]}}),n.oi)},59360:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(92745),i(9359),i(56475),i(31526),i(70104),i(40251),i(47021),i(2060),i(57243)),s=i(50778),o=i(35359),r=i(94571),l=i(12077),d=i(12753),c=(i(54977),i(65981),i(7285),i(63318)),h=i(45729),u=i(12939),v=i(20526),f=i(46542),g=i(69615),m=e([f,h]);[f,h]=m.then?(await m)():m;let p,y,_,b,k,w,$,x,C,z=e=>e;(0,a.Z)([(0,s.Mo)("ha-device-entities-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"deviceName",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"entities",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"show-hidden",type:Boolean})],key:"showHidden",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_extDisabledEntityEntries",value:void 0},{kind:"field",key:"_entityRows",value(){return[]}},{kind:"method",key:"shouldUpdate",value:function(e){return e.has("hass")&&1===e.size?(this._entityRows.forEach((e=>{e.hass=this.hass})),!1):(this._entityRows=[],!0)}},{kind:"method",key:"render",value:function(){if(!this.entities.length)return(0,n.dy)(p||(p=z` <ha-card outlined .header="${0}"> <div class="empty card-content"> ${0} </div> </ha-card> `),this.header,this.hass.localize("ui.panel.config.devices.entities.none"));const e=[],t=[];return this.entities.forEach((i=>{i.disabled_by?this._extDisabledEntityEntries?t.push(this._extDisabledEntityEntries[i.entity_id]||i):t.push(i):e.push(i)})),(0,n.dy)(y||(y=z` <ha-card outlined .header="${0}"> ${0} ${0} <div class="card-actions"> <mwc-button @click="${0}"> ${0} </mwc-button> </div> </ha-card> `),this.header,e.length?(0,n.dy)(_||(_=z` <div id="entities" class="move-up"> <mwc-list> ${0} </mwc-list> </div> `),e.map((e=>this.hass.states[e.entity_id]?this._renderEntity(e):this._renderEntry(e)))):n.Ld,t.length?(0,n.dy)(b||(b=z`<div class="${0}"> ${0} </div>`),(0,o.$)({"move-up":!e.length}),this.showHidden?(0,n.dy)(w||(w=z` <mwc-list> ${0} </mwc-list> <button class="show-more" @click="${0}"> ${0} </button> `),t.map((e=>this._renderEntry(e))),this._toggleShowHidden,this.hass.localize("ui.panel.config.devices.entities.show_less")):(0,n.dy)(k||(k=z` <button class="show-more" @click="${0}"> ${0} </button> `),this._toggleShowHidden,this.hass.localize("ui.panel.config.devices.entities.disabled_entities",{count:t.length}))):n.Ld,this._addToLovelaceView,this.hass.localize("ui.panel.config.devices.entities.add_entities_lovelace"))}},{kind:"method",key:"_toggleShowHidden",value:function(){if(this.showHidden=!this.showHidden,!this.showHidden||void 0!==this._extDisabledEntityEntries)return;this._extDisabledEntityEntries={};const e=this.entities.filter((e=>e.disabled_by)),t=async()=>{if(0===e.length)return;const i=e.pop().entity_id,a=await(0,c.L3)(this.hass,i);this._extDisabledEntityEntries[i]=a,this.requestUpdate("_extDisabledEntityEntries"),t()};t(),t(),t()}},{kind:"method",key:"_renderEntity",value:function(e){const t={entity:e.entity_id},i=(0,f.m)(t);if(this.hass){i.hass=this.hass;const a=this.hass.states[e.entity_id];let n=(0,l.K)(a,this.hass)||this.deviceName;e.hidden_by&&(n+=` (${this.hass.localize("ui.panel.config.devices.entities.hidden")})`),t.name=n}return i.entry=e,this._entityRows.push(i),(0,n.dy)($||($=z` <div>${0}</div> `),i)}},{kind:"method",key:"_renderEntry",value:function(e){const t=e.stateName||e.name||e.original_name,i=(0,r.C)((0,h.xA)(this.hass,e));return(0,n.dy)(x||(x=z` <ha-list-item graphic="icon" class="disabled-entry" .entry="${0}" @click="${0}"> <ha-icon slot="graphic" .icon="${0}"></ha-icon> <div class="name"> ${0} </div> </ha-list-item> `),e,this._openEditEntry,i,t?(0,d.N)(t,this.deviceName)||t:e.entity_id)}},{kind:"method",key:"_openEditEntry",value:function(e){const t=e.currentTarget.entry;(0,u.A)(this,{entityId:t.entity_id})}},{kind:"method",key:"_addToLovelaceView",value:function(){const e=this.entities.filter((e=>!e.disabled_by)).map((e=>e.entity_id));(0,g.$)(this,this.hass,(0,v.VG)(this.hass.states,e,{title:this.deviceName}),(0,v.lY)(e,{title:this.deviceName}),e)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(C||(C=z`:host{display:block}ha-icon{margin-left:-8px}.entity-id{color:var(--secondary-text-color)}.buttons{text-align:right;margin:0 0 0 8px}.disabled-entry{color:var(--secondary-text-color)}.move-up{margin-top:-13px}.move-up:has(> mwc-list){margin-top:-24px}:not(.move-up)>mwc-list{margin-top:-24px}.move-up+:not(:has(mwc-list))>button.show-more,mwc-list+button.show-more{margin-top:-12px}#entities>mwc-list{margin:0 16px 0 8px}#entities>paper-icon-item{margin:0}paper-icon-item{min-height:40px;padding:0 16px;cursor:pointer;--paper-item-icon-width:48px}.name{font-size:14px}.name:dir(rtl){margin-inline-start:8px}.empty{text-align:center}button.show-more{color:var(--primary-color);text-align:left;cursor:pointer;background:0 0;border-width:initial;border-style:none;border-color:initial;border-image:initial;padding:16px;font:inherit}button.show-more:focus{outline:0;text-decoration:underline}mwc-list>*{margin:8px 0px}ha-list-item{height:40px;--mdc-ripple-color:transparent}`))}}]}}),n.oi);t()}catch(p){t(p)}}))},25347:function(e,t,i){var a=i(61701),n=(i(71695),i(9359),i(56475),i(70104),i(47021),i(57243)),s=i(50778),o=i(86431),r=i(76002),l=(i(54977),i(28008));let d,c,h,u,v,f,g,m,p,y,_,b=e=>e;(0,a.Z)([(0,s.Mo)("ha-device-info-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"device",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(d||(d=b` <ha-card outlined .header="${0}"> <div class="card-content"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} <slot></slot> </div> <slot name="actions"></slot> </ha-card> `),this.hass.localize("ui.panel.config.devices.device_info",{type:this.hass.localize(`ui.panel.config.devices.type.${this.device.entry_type||"device"}_heading`)}),this.device.model?(0,n.dy)(c||(c=b`<div class="model"> ${0} ${0} </div>`),this.device.model,this.device.model_id?(0,n.dy)(h||(h=b`(${0})`),this.device.model_id):""):this.device.model_id?(0,n.dy)(u||(u=b`<div class="model">${0}</div>`),this.device.model_id):"",this.device.manufacturer?(0,n.dy)(v||(v=b` <div class="manuf"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.manuf",{manufacturer:this.device.manufacturer})):"",this.device.via_device_id?(0,n.dy)(f||(f=b` <div class="extra-info"> ${0} <span class="hub"><a href="/config/devices/device/${0}">${0}</a></span> </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.via"),this.device.via_device_id,this._computeDeviceNameDislay(this.device.via_device_id)):"",this.device.sw_version?(0,n.dy)(g||(g=b` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry."+("service"!==this.device.entry_type||this.device.hw_version?"firmware":"version"),{version:this.device.sw_version})):"",this.device.hw_version?(0,n.dy)(m||(m=b` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.hardware",{version:this.device.hw_version})):"",this.device.serial_number?(0,n.dy)(p||(p=b` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.serial_number",{serial_number:this.device.serial_number})):"",this._getAddresses().map((([e,t])=>(0,n.dy)(y||(y=b` <div class="extra-info"> ${0}: ${0} </div> `),"mac"===e?"MAC":(0,r.Q)(e),t.toUpperCase()))))}},{kind:"method",key:"_getAddresses",value:function(){return this.device.connections.filter((e=>"mac"===e[0]||"bluetooth"===e[0]))}},{kind:"method",key:"_computeDeviceNameDislay",value:function(e){const t=this.hass.devices[e];return t?(0,o.wZ)(t,this.hass):`<${this.hass.localize("ui.panel.config.integrations.config_entry.unknown_via_device")}>`}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,(0,n.iv)(_||(_=b`:host{display:block}ha-card{flex:1 0 100%;min-width:0}.device{width:30%}.extra-info{margin-top:8px;word-wrap:break-word}.manuf,.model{color:var(--secondary-text-color);word-wrap:break-word}`))]}}]}}),n.oi)},65811:function(e,t,i){var a=i(61701),n=(i(71695),i(61893),i(9359),i(56475),i(70104),i(47021),i(87319),i(57243)),s=i(50778),o=i(27486),r=i(86431),l=i(1416);i(54977),i(13928);let d,c,h,u,v=e=>e;(0,a.Z)([(0,s.Mo)("ha-device-via-devices-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"deviceId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_showAll",value(){return!1}},{kind:"field",key:"_viaDevices",value(){return(0,o.Z)(((e,t)=>Object.values(t).filter((t=>t.via_device_id===e)).sort(((e,t)=>(0,l.fe)((0,r.wZ)(e,this.hass),(0,r.wZ)(t,this.hass),this.hass.locale.language)))))}},{kind:"method",key:"render",value:function(){const e=this._viaDevices(this.deviceId,this.hass.devices);return 0===e.length?n.Ld:(0,n.dy)(d||(d=v` <ha-card> <h1 class="card-header"> ${0} </h1> ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.connected_devices.heading"),(this._showAll?e:e.slice(0,10)).map((e=>(0,n.dy)(c||(c=v` <a href="${0}"> <mwc-list-item hasMeta> ${0} <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item> </a> `),`/config/devices/device/${e.id}`,(0,r.wZ)(e,this.hass)))),!this._showAll&&e.length>10?(0,n.dy)(h||(h=v` <button class="show-more" @click="${0}"> ${0} </button> `),this._toggleShowAll,this.hass.localize("ui.panel.config.devices.connected_devices.show_more",{count:e.length-10})):"")}},{kind:"method",key:"_toggleShowAll",value:function(){this._showAll=!this._showAll}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(u||(u=v`:host{display:block}.card-header{padding-bottom:0}a{text-decoration:none;color:var(--primary-text-color)}button.show-more{color:var(--primary-color);text-align:left;cursor:pointer;background:0 0;border-width:initial;border-style:none;border-color:initial;border-image:initial;padding:16px;font:inherit}button.show-more:focus{outline:0;text-decoration:underline}`))}}]}}),n.oi)},53928:function(e,t,i){i.d(t,{J:()=>s});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>i.e("20353").then(i.bind(i,25842)),s=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-device-automation",dialogImport:n,dialogParams:t})}},7199:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),s=(i(19083),i(71695),i(92745),i(61893),i(9359),i(56475),i(1331),i(31526),i(70104),i(52924),i(19423),i(40251),i(19134),i(61006),i(97003),i(88044),i(47021),i(60738)),o=i(57243),r=i(50778),l=i(20552),d=i(27486),c=i(72344),h=i(73358),u=i(86431),v=i(73850),f=i(12077),g=i(59847),m=i(47194),p=i(1416),y=i(34798),_=i(47558),b=(i(44925),i(99426),i(34273),i(41307),i(23334),i(13928),i(37583),i(56032)),k=i(41927),w=i(43546),$=i(75101),x=i(30635),C=i(71857),z=i(6823),A=i(63318),E=i(57816),L=i(93352),S=i(2357),M=i(76131),D=i(21168),j=(i(34515),i(87979),i(28008)),I=i(88238),O=i(58014),P=i(16581),H=i(59360),B=(i(25347),i(65811),i(53928)),Z=i(31993),N=e([b,P,H]);[b,P,H]=N.then?(await N)():N;let V,F,W,T,U,R,Y,G,K,Q,q,X,J,ee,te,ie,ae,ne,se,oe,re,le,de,ce,he,ue,ve,fe,ge,me,pe,ye,_e,be,ke,we,$e,xe,Ce,ze,Ae,Ee,Le=e=>e;const Se="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",Me="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",De="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",je="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Ie="M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z",Oe="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",Pe="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",He="M17,13H13V17H11V13H7V11H11V7H13V11H17M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";(0,a.Z)([(0,r.Mo)("ha-config-device-page")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"entries",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"manifests",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"deviceId",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"showAdvanced",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_related",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_diagnosticDownloadLinks",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_deleteButtons",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_deviceActions",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_deviceAlerts",value:void 0},{kind:"field",decorators:[(0,r.SB)(),(0,s.F_)({context:x.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",key:"_logbookTime",value(){return{recent:86400}}},{kind:"field",key:"_integrations",value(){return(0,d.Z)(((e,t,i)=>{const a={};for(const o of t)a[o.entry_id]=o;const n={};for(const o of i)n[o.domain]=o;const s=e.config_entries.filter((e=>e in a)).map((e=>a[e]));return(0,$.Pk)(s,e.primary_config_entry)}))}},{kind:"field",key:"_entities",value(){return(0,d.Z)(((e,t)=>t.filter((t=>t.device_id===e)).map((e=>Object.assign(Object.assign({},e),{},{stateName:this._computeEntityName(e)}))).sort(((e,t)=>(0,p.$K)(e.stateName||`zzz${e.entity_id}`,t.stateName||`zzz${t.entity_id}`,this.hass.locale.language)))))}},{kind:"field",key:"_deviceIdInList",value(){return(0,d.Z)((e=>[e]))}},{kind:"field",key:"_entityIds",value(){return(0,d.Z)((e=>e.map((e=>e.entity_id))))}},{kind:"field",key:"_entitiesByCategory",value(){return(0,d.Z)((e=>{const t=(0,_.v)(e,(e=>{const t=(0,v.M)(e.entity_id);return h.a5.includes(t)?"assist":"event"===t||"notify"===t?t:e.entity_category?e.entity_category:h.zF.includes(t)?"sensor":"control"}));for(const i of["assist","config","control","diagnostic","event","notify","sensor"])i in t||(t[i]=[]);return t}))}},{kind:"field",key:"_batteryEntity",value(){return(0,d.Z)((e=>(0,A.eD)(this.hass,e)))}},{kind:"field",key:"_batteryChargingEntity",value(){return(0,d.Z)((e=>(0,A.wX)(this.hass,e)))}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(a,"willUpdate",this,3)([e]),(e.has("deviceId")||e.has("devices")||e.has("entries"))&&(this._diagnosticDownloadLinks=void 0,this._deleteButtons=void 0,this._deviceActions=void 0,this._deviceAlerts=void 0),this._diagnosticDownloadLinks&&this._deleteButtons&&this._deviceActions&&this._deviceAlerts||!this.deviceId||!this.entries||(this._diagnosticDownloadLinks=Math.random(),this._deleteButtons=[],this._deviceActions=[],this._deviceAlerts=[],this._getDiagnosticButtons(this._diagnosticDownloadLinks),this._getDeleteActions(),this._getDeviceActions(),this._getDeviceAlerts())}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(a,"firstUpdated",this,3)([e]),(0,Z.O)()}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(a,"updated",this,3)([e]),e.has("deviceId")&&this._findRelated()}},{kind:"method",key:"render",value:function(){var e,t,i,a,n;if(!this.hass||!this.deviceId)return o.Ld;const s=this.hass.devices[this.deviceId];if(!s)return(0,o.dy)(V||(V=Le` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this.hass.localize("ui.panel.config.devices.device_not_found"));const r=(0,u.wZ)(s,this.hass),d=this._integrations(s,this.entries,this.manifests),h=this._entities(this.deviceId,this._entityReg),v=this._entitiesByCategory(h),f=this._batteryEntity(h),p=this._batteryChargingEntity(h),y=f?this.hass.states[f.entity_id]:void 0,_=y?(0,g.N)(y):void 0,b=p?this.hass.states[p.entity_id]:void 0,k=s.area_id?this.hass.areas[s.area_id]:void 0,w=d.map((e=>{var t;return(0,o.dy)(F||(F=Le`<a slot="actions" href="${0}"> <ha-list-item graphic="icon" hasMeta> <img slot="graphic" alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" @error="${0}" @load="${0}"> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a>`),`/config/integrations/integration/${e.domain}#config_entry=${e.entry_id}`,(0,E.Lh)(this.hass.localize,e.domain),(0,I.X1)({domain:e.domain,type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode}),this._onImageError,this._onImageLoad,(0,E.Lh)(this.hass.localize,e.domain))})),$=[...this._deviceActions||[]];Array.isArray(this._diagnosticDownloadLinks)&&$.push(...this._diagnosticDownloadLinks),this._deleteButtons&&$.push(...this._deleteButtons),$.sort(((e,t)=>"warning"===e.classes&&"warning"!==t.classes?1:"warning"!==e.classes&&"warning"===t.classes?-1:0));const x=$.shift();s.disabled_by&&w.push((0,o.dy)(W||(W=Le` <ha-alert alert-type="warning"> ${0} </ha-alert> ${0} `),this.hass.localize("ui.panel.config.devices.enabled_cause",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`),cause:this.hass.localize(`ui.panel.config.devices.disabled_by.${s.disabled_by}`)}),"user"===s.disabled_by?(0,o.dy)(T||(T=Le` <div class="card-actions" slot="actions"> <mwc-button unelevated @click="${0}"> ${0} </mwc-button> </div> `),this._enableDevice,this.hass.localize("ui.common.enable")):"")),this._renderIntegrationInfo(s,d,w);const C=s.disabled_by?this.hass.localize("ui.panel.config.devices.add_prompt_disabled"):this.hass.localize("ui.panel.config.devices.add_prompt_enabled"),z=(0,c.p)(this.hass,"automation")?(0,o.dy)(U||(U=Le` <ha-card outlined> <h1 class="card-header"> ${0} <ha-icon-button @click="${0}" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> </h1> ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.automation.automations_heading"),this._showAutomationDialog,s.disabled_by,s.disabled_by?this.hass.localize("ui.panel.config.devices.automation.create_disable",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}):this.hass.localize("ui.panel.config.devices.automation.create",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),He,null!==(e=this._related)&&void 0!==e&&null!==(e=e.automation)&&void 0!==e&&e.length?(0,o.dy)(R||(R=Le` <div class="items"> ${0} </div> `),this._related.automation.map((e=>{const t=this.hass.states[e];return t?(0,o.dy)(Y||(Y=Le`<a href="${0}"> <ha-list-item hasMeta .automation="${0}"> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a>`),(0,l.o)(t.attributes.id?`/config/automation/edit/${encodeURIComponent(t.attributes.id)}`:`/config/automation/show/${t.entity_id}`),t,(0,m.C)(t)):o.Ld}))):(0,o.dy)(G||(G=Le` <div class="card-content"> ${0} ${0} </div> `),this.hass.localize("ui.panel.config.devices.add_prompt",{name:this.hass.localize("ui.panel.config.devices.automation.automations"),type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),C)):"",A=(0,c.p)(this.hass,"scene")&&h.length?(0,o.dy)(K||(K=Le` <ha-card outlined> <h1 class="card-header"> ${0} <ha-icon-button @click="${0}" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> </h1> ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.scene.scenes_heading"),this._createScene,s.disabled_by,s.disabled_by?this.hass.localize("ui.panel.config.devices.scene.create_disable",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}):this.hass.localize("ui.panel.config.devices.scene.create",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),He,null!==(t=this._related)&&void 0!==t&&null!==(t=t.scene)&&void 0!==t&&t.length?(0,o.dy)(Q||(Q=Le` <div class="items"> ${0} </div> `),this._related.scene.map((e=>{const t=this.hass.states[e];return t&&t.attributes.id?(0,o.dy)(q||(q=Le` <a href="${0}"> <ha-list-item hasMeta .scene="${0}"> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),`/config/scene/edit/${t.attributes.id}`,t,(0,m.C)(t)):(0,o.dy)(X||(X=Le` <ha-tooltip placement="left" .content="${0}"> <ha-list-item hasMeta .scene="${0}"> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </ha-tooltip> `),this.hass.localize("ui.panel.config.devices.cant_edit"),t,(0,m.C)(t))}))):(0,o.dy)(J||(J=Le` <div class="card-content"> ${0} ${0} </div> `),this.hass.localize("ui.panel.config.devices.add_prompt",{name:this.hass.localize("ui.panel.config.devices.scene.scenes"),type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),C)):"",L=(0,c.p)(this.hass,"script")?(0,o.dy)(ee||(ee=Le` <ha-card outlined> <h1 class="card-header"> ${0} <ha-icon-button @click="${0}" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> </h1> ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.script.scripts_heading"),this._showScriptDialog,s.disabled_by,s.disabled_by?this.hass.localize("ui.panel.config.devices.script.create_disable",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}):this.hass.localize("ui.panel.config.devices.script.create",{type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),He,null!==(i=this._related)&&void 0!==i&&null!==(i=i.script)&&void 0!==i&&i.length?(0,o.dy)(te||(te=Le` <div class="items"> ${0} </div> `),this._related.script.map((e=>{const t=this.hass.states[e],i=this._entityReg.find((t=>t.entity_id===e));let a=`/config/script/show/${t.entity_id}`;return i&&(a=`/config/script/edit/${i.unique_id}`),t?(0,o.dy)(ie||(ie=Le` <a href="${0}"> <ha-list-item hasMeta .script="${0}"> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),a,e,(0,m.C)(t)):""}))):(0,o.dy)(ae||(ae=Le` <div class="card-content"> ${0} ${0} </div> `),this.hass.localize("ui.panel.config.devices.add_prompt",{name:this.hass.localize("ui.panel.config.devices.script.scripts"),type:this.hass.localize(`ui.panel.config.devices.type.${s.entry_type||"device"}`)}),C)):"";return(0,o.dy)(ne||(ne=Le` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <ha-icon-button slot="toolbar-icon" .path="${0}" @click="${0}" .label="${0}"></ha-icon-button> <div class="container"> <div class="header fullwidth"> ${0} <div class="header-right"> ${0} ${0} </div> </div> <div class="column"> ${0} <ha-device-info-card .hass="${0}" .device="${0}"> ${0} ${0} </ha-device-info-card> ${0} </div> <div class="column"> ${0} <ha-device-via-devices-card .hass="${0}" .deviceId="${0}"></ha-device-via-devices-card> </div> <div class="column"> ${0} ${0} </div> </div> </hass-subpage>`),this.hass,this.narrow,r,Pe,this._showSettings,this.hass.localize("ui.panel.config.devices.edit_settings"),k?(0,o.dy)(se||(se=Le`<div class="header-name"> <a href="/config/areas/area/${0}">${0}</a> </div>`),k.area_id,this.hass.localize("ui.panel.config.integrations.config_entry.area",{area:k.name||"Unnamed Area"})):"",!y||"binary_sensor"!==_&&isNaN(y.state)?"":(0,o.dy)(oe||(oe=Le` <div class="battery"> ${0} <ha-battery-icon .hass="${0}" .batteryStateObj="${0}" .batteryChargingStateObj="${0}"></ha-battery-icon> </div> `),"sensor"===_?this.hass.formatEntityState(y):o.Ld,this.hass,y,b),d.length?(0,o.dy)(re||(re=Le` <img alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" @load="${0}" @error="${0}"> `),(0,E.Lh)(this.hass.localize,d[0].domain),(0,I.X1)({domain:d[0].domain,type:"logo",darkOptimized:null===(a=this.hass.themes)||void 0===a?void 0:a.darkMode}),this._onImageLoad,this._onImageError):"",null!==(n=this._deviceAlerts)&&void 0!==n&&n.length?(0,o.dy)(le||(le=Le` <div> ${0} </div> `),this._deviceAlerts.map((e=>(0,o.dy)(de||(de=Le` <ha-alert .alertType="${0}"> ${0} </ha-alert> `),e.level,e.text)))):"",this.hass,s,w,x||$.length?(0,o.dy)(ce||(ce=Le` <div class="card-actions" slot="actions"> <div> <a href="${0}" rel="${0}" target="${0}"> <mwc-button class="${0}" .action="${0}" @click="${0}" graphic="icon"> ${0} ${0} ${0} </mwc-button> </a> </div> ${0} </div> `),(0,l.o)(x.href),(0,l.o)(x.target?"noreferrer":void 0),(0,l.o)(x.target),(0,l.o)(x.classes),x.action,this._deviceActionClicked,x.label,x.icon?(0,o.dy)(he||(he=Le` <ha-svg-icon class="${0}" .path="${0}" slot="graphic"></ha-svg-icon> `),(0,l.o)(x.classes),x.icon):"",x.trailingIcon?(0,o.dy)(ue||(ue=Le` <ha-svg-icon .path="${0}" slot="trailingIcon"></ha-svg-icon> `),x.trailingIcon):"",$.length?(0,o.dy)(ve||(ve=Le` <ha-button-menu> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> ${0} </ha-button-menu> `),this.hass.localize("ui.common.menu"),De,$.map((e=>{const t=(0,o.dy)(fe||(fe=Le`<mwc-list-item class="${0}" .action="${0}" @click="${0}" graphic="icon" .hasMeta="${0}"> ${0} ${0} ${0} </mwc-list-item>`),(0,l.o)(e.classes),e.action,this._deviceActionClicked,Boolean(e.trailingIcon),e.label,e.icon?(0,o.dy)(ge||(ge=Le` <ha-svg-icon class="${0}" .path="${0}" slot="graphic"></ha-svg-icon> `),(0,l.o)(e.classes),e.icon):"",e.trailingIcon?(0,o.dy)(me||(me=Le` <ha-svg-icon slot="meta" .path="${0}"></ha-svg-icon> `),e.trailingIcon):"");return e.href?(0,o.dy)(pe||(pe=Le`<a href="${0}" target="${0}" rel="${0}">${0} </a>`),e.href,(0,l.o)(e.target),(0,l.o)(e.target?"noreferrer":void 0),t):t}))):""):"",this.narrow?"":[z,A,L],["control","sensor","notify","event","assist","config","diagnostic"].map((e=>v[e].length>0||0===h.length&&"control"===e?(0,o.dy)(ye||(ye=Le` <ha-device-entities-card .hass="${0}" .header="${0}" .deviceName="${0}" .entities="${0}" .showHidden="${0}"> </ha-device-entities-card> `),this.hass,this.hass.localize(`ui.panel.config.devices.entities.${e}`),r,v[e],null!==s.disabled_by):"")),this.hass,this.deviceId,this.narrow?[z,A,L]:"",(0,c.p)(this.hass,"logbook")?(0,o.dy)(_e||(_e=Le` <ha-card outlined> <h1 class="card-header"> ${0} </h1> <ha-logbook .hass="${0}" .time="${0}" .entityIds="${0}" .deviceIds="${0}" virtualize narrow no-icon></ha-logbook> </ha-card> `),this.hass.localize("panel.logbook"),this.hass,this._logbookTime,this._entityIds(h),this._deviceIdInList(this.deviceId)):"")}},{kind:"method",key:"_getDiagnosticButtons",value:async function(e){if(!(0,c.p)(this.hass,"diagnostics"))return;const t=this.hass.devices[this.deviceId];if(!t)return;let i=await Promise.all(this._integrations(t,this.entries,this.manifests).map((async e=>{if("loaded"!==e.state)return!1;let t;try{t=await(0,z.lf)(this.hass,e.domain)}catch(i){if("not_found"===i.code)return!1;throw i}return!(!t.handlers.device&&!t.handlers.config_entry)&&{link:t.handlers.device?(0,z.ZK)(e.entry_id,this.deviceId):(0,z.iP)(e.entry_id),domain:e.domain}})));i=i.filter(Boolean),this._diagnosticDownloadLinks===e&&i.length>0&&(this._diagnosticDownloadLinks=i.map((e=>({href:e.link,icon:je,action:e=>this._signUrl(e),label:i.length>1?this.hass.localize("ui.panel.config.devices.download_diagnostics_integration",{integration:(0,E.Lh)(this.hass.localize,e.domain)}):this.hass.localize("ui.panel.config.devices.download_diagnostics")}))))}},{kind:"method",key:"_getDeleteActions",value:function(){const e=this.hass.devices[this.deviceId];if(!e)return;const t=[];this._integrations(e,this.entries,this.manifests).forEach((i=>{"loaded"===i.state&&i.supports_remove_device&&t.push({action:async()=>{if(await(0,M.showConfirmationDialog)(this,{text:this._integrations(e,this.entries,this.manifests).length>1?this.hass.localize("ui.panel.config.devices.confirm_delete_integration",{integration:(0,E.Lh)(this.hass.localize,i.domain)}):this.hass.localize("ui.panel.config.devices.confirm_delete"),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),destructive:!0}))try{await(0,C.dl)(this.hass,this.deviceId,i.entry_id)}catch(t){(0,M.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.devices.error_delete"),text:t.message})}},classes:"warning",icon:Me,label:this._integrations(e,this.entries,this.manifests).length>1?this.hass.localize("ui.panel.config.devices.delete_device_integration",{integration:(0,E.Lh)(this.hass.localize,i.domain)}):this.hass.localize("ui.panel.config.devices.delete_device")})})),t.length>0&&(this._deleteButtons=t)}},{kind:"method",key:"_getDeviceActions",value:async function(){var e;const t=this.hass.devices[this.deviceId];if(!t)return;const a=[],n=(null===(e=t.configuration_url)||void 0===e?void 0:e.startsWith("homeassistant://"))||!1,s=n?t.configuration_url.replace("homeassistant://","/"):t.configuration_url;s&&a.push({href:s,target:n?void 0:"_blank",icon:Se,label:this.hass.localize("ui.panel.config.devices.open_configuration_url"),trailingIcon:Oe});const o=this._entities(this.deviceId,this._entityReg).find((e=>"assist_satellite"===(0,v.M)(e.entity_id))),r=this._integrations(t,this.entries,this.manifests).map((e=>e.domain));if(!r.includes("voip")&&o&&(0,k.Bg)(this.hass.states[o.entity_id])&&a.push({action:this._voiceAssistantSetup,label:this.hass.localize("ui.panel.config.devices.set_up_voice_assistant"),icon:Ie}),r.includes("mqtt")){const e=(await i.e("90863").then(i.bind(i,87516))).getMQTTDeviceActions(this,t);a.push(...e)}if(r.includes("zha")){const e=await i.e("80927").then(i.bind(i,45004)),n=await e.getZHADeviceActions(this,this.hass,t);a.push(...n)}if(r.includes("zwave_js")){const e=await i.e("99706").then(i.bind(i,40170)),n=await e.getZwaveDeviceActions(this,this.hass,t);a.push(...n)}if(r.includes("matter")){const e=await i.e("70437").then(i.bind(i,70534)),n=e.getMatterDeviceDefaultActions(this,this.hass,t);a.push(...n),e.getMatterDeviceActions(this,this.hass,t).then((e=>{this._deviceActions=[...e,...this._deviceActions||[]]}))}this._deviceActions=a}},{kind:"method",key:"_getDeviceAlerts",value:async function(){const e=this.hass.devices[this.deviceId];if(!e)return;const t=[];if(this._integrations(e,this.entries,this.manifests).map((e=>e.domain)).includes("zwave_js")){const a=await i.e("53131").then(i.bind(i,26665)),n=await a.getZwaveDeviceAlerts(this.hass,e);t.push(...n)}t.length&&(this._deviceAlerts=t)}},{kind:"method",key:"_computeEntityName",value:function(e){const t=this.hass.devices[this.deviceId];return(0,f.T)(e,this.hass)||(0,u.wZ)(t,this.hass)}},{kind:"method",key:"_onImageLoad",value:function(e){e.target.style.display="inline-block"}},{kind:"method",key:"_onImageError",value:function(e){e.target.style.display="none"}},{kind:"method",key:"_findRelated",value:async function(){this._related=await(0,S.K)(this.hass,"device",this.deviceId)}},{kind:"method",key:"_createScene",value:function(){const e={};this._entities(this.deviceId,this._entityReg).forEach((t=>{e[t.entity_id]=""})),(0,L.mR)({entities:e})}},{kind:"method",key:"_showScriptDialog",value:function(){(0,B.J)(this,{device:this.hass.devices[this.deviceId],entityReg:this._entityReg,script:!0})}},{kind:"method",key:"_showAutomationDialog",value:function(){(0,B.J)(this,{device:this.hass.devices[this.deviceId],entityReg:this._entityReg,script:!1})}},{kind:"method",key:"_renderIntegrationInfo",value:function(e,t,a){const n=t.map((e=>e.domain));n.includes("zha")&&(i.e("72259").then(i.bind(i,39724)),a.push((0,o.dy)(be||(be=Le` <ha-device-info-zha .hass="${0}" .device="${0}"></ha-device-info-zha> `),this.hass,e))),n.includes("zwave_js")&&(i.e("4253").then(i.bind(i,66705)),a.push((0,o.dy)(ke||(ke=Le` <ha-device-info-zwave_js .hass="${0}" .device="${0}"></ha-device-info-zwave_js> `),this.hass,e))),n.includes("matter")&&(i.e("35949").then(i.bind(i,17547)),a.push((0,o.dy)(we||(we=Le` <ha-device-info-matter .hass="${0}" .device="${0}"></ha-device-info-matter> `),this.hass,e)))}},{kind:"method",key:"_showSettings",value:async function(){const e=this.hass.devices[this.deviceId];(0,Z.r)(this,{device:e,updateEntry:async t=>{const i=e.name_by_user||e.name,a=t.name_by_user;if("user"===t.disabled_by&&"user"!==e.disabled_by){for(const o of e.config_entries)if(!Object.values(this.hass.devices).some((t=>t.id!==e.id&&t.config_entries.includes(o)))){const e=this.entries.find((e=>e.entry_id===o));if(e&&!e.disabled_by&&await(0,M.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.devices.confirm_disable_config_entry",{entry_name:e.title}),confirmText:this.hass.localize("ui.common.yes"),dismissText:this.hass.localize("ui.common.no")})){let e;try{e=await(0,$.Ny)(this.hass,o)}catch(d){return void(0,M.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_entry.disable_error"),text:d.message})}e.require_restart&&(0,M.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_entry.disable_restart_confirm")}),delete t.disabled_by}}}else null!==t.disabled_by&&"user"!==t.disabled_by&&delete t.disabled_by;try{await(0,C.t1)(this.hass,this.deviceId,t)}catch(d){return void(0,M.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.devices.update_device_error"),text:d.message})}if(!i||!a||i===a)return;const n=this._entities(this.deviceId,this._entityReg);let s=!1,r=[];if(this.showAdvanced){const e=(0,y.l)(i),t=(0,y.l)(a);r=n.map((i=>{const a=i.entity_id;if(a.includes(e)){const i=a.replace(e,t);return{oldId:a,newId:i}}return{oldId:a}}));const l=r.filter((e=>e.newId)).map((e=>(0,o.dy)($e||($e=Le`<tr> <td>${0}</td> <td>${0}</td> </tr>`),e.oldId,e.newId))),d=r.filter((e=>!e.newId)).map((e=>(0,o.dy)(xe||(xe=Le`<li>${0}</li>`),e.oldId)));l.length?s=await(0,M.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.devices.confirm_rename_entity_ids"),text:(0,o.dy)(Ce||(Ce=Le`${0} <br><br> <ha-expansion-panel outlined> <span slot="header">${0}</span> <div style="overflow:auto"> <table style="width:100%;text-align:var(--float-start)"> <tr> <th> ${0} </th> <th> ${0} </th> </tr> ${0} </table> </div> </ha-expansion-panel> ${0} `),this.hass.localize("ui.panel.config.devices.confirm_rename_entity_ids_warning"),this.hass.localize("ui.panel.config.devices.confirm_rename_entity_will_rename",{count:l.length}),this.hass.localize("ui.panel.config.devices.confirm_rename_old"),this.hass.localize("ui.panel.config.devices.confirm_rename_new"),l,d.length?(0,o.dy)(ze||(ze=Le`<ha-expansion-panel outlined> <span slot="header">${0}</span> ${0}</ha-expansion-panel>`),this.hass.localize("ui.panel.config.devices.confirm_rename_entity_wont_rename",{count:d.length,deviceSlug:e}),d):o.Ld),confirmText:this.hass.localize("ui.common.rename"),dismissText:this.hass.localize("ui.common.no"),warning:!0}):d.length&&await(0,M.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.devices.confirm_rename_entity_no_renamable_entity_ids"),text:(0,o.dy)(Ae||(Ae=Le`<ha-expansion-panel outlined> <span slot="header">${0}</span> ${0} </ha-expansion-panel>`),this.hass.localize("ui.panel.config.devices.confirm_rename_entity_wont_rename",{deviceSlug:e,count:d.length}),d)})}const l=n.map((e=>{const t=e.name||e.stateName;let n,o,l,d=!1;if(e.has_entity_name&&!e.name?l=!1:!e.has_entity_name||e.name!==i&&e.name!==a?t&&t.includes(i)?(l=!0,o=t.replace(i,a)):l=!1:(l=!0,o=null),s){var c;const t=null===(c=r)||void 0===c?void 0:c.find((t=>t.oldId===e.entity_id));null!=t&&t.newId&&(d=!0,n=t.newId)}if(void 0!==o||void 0!==n)return(0,A.Nv)(this.hass,e.entity_id,{name:l?o:void 0,new_entity_id:d?n:void 0})}));await Promise.all(l)}})}},{kind:"method",key:"_enableDevice",value:async function(){await(0,C.t1)(this.hass,this.deviceId,{disabled_by:null})}},{kind:"method",key:"_signUrl",value:async function(e){const t=e.currentTarget.closest("a"),i=await(0,w.iI)(this.hass,t.getAttribute("href"));(0,O.N)(i.path)}},{kind:"method",key:"_deviceActionClicked",value:function(e){e.currentTarget.action&&(e.preventDefault(),e.currentTarget.action(e))}},{kind:"field",key:"_voiceAssistantSetup",value(){return()=>{(0,D.k)(this,{deviceId:this.deviceId})}}},{kind:"get",static:!0,key:"styles",value:function(){return[j.Qx,(0,o.iv)(Ee||(Ee=Le`.container{display:flex;flex-wrap:wrap;margin:auto;max-width:1000px;margin-top:32px;margin-bottom:32px}.card-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px}.card-header ha-icon-button{margin-right:-8px;margin-inline-end:-8px;margin-inline-start:initial;color:var(--primary-color);height:auto;direction:var(--direction)}.device-info{padding:16px}h1{margin:0;font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);letter-spacing:var(--paper-font-headline_-_letter-spacing);line-height:var(--paper-font-headline_-_line-height);opacity:var(--dark-primary-opacity)}.header{display:flex;justify-content:space-between}.header-name{display:flex;align-items:center;padding-left:8px;padding-inline-start:8px;direction:var(--direction)}.column,.fullwidth{padding:8px;box-sizing:border-box}.column{width:33%;flex-grow:1}.fullwidth{width:100%;flex-grow:1}.header-right{align-self:center}.header-right img{height:30px}.header-right{display:flex}.header-right:first-child{width:100%;justify-content:flex-end}.header-right>:not(:first-child){margin-left:16px;margin-inline-start:16px;margin-inline-end:initial;direction:var(--direction)}.battery{align-self:center;align-items:center;display:flex;white-space:nowrap}.column>:not(:first-child){margin-top:16px}:host([narrow]) .column{width:100%}:host([narrow]) .container{margin-top:0}a{text-decoration:none;color:var(--primary-color)}ha-card a{color:var(--primary-text-color)}ha-svg-icon[slot=trailingIcon]{display:block;width:18px;height:18px;margin-inline-start:8px;margin-inline-end:initial}ha-svg-icon[slot=meta]{width:18px;height:18px}.items{padding-bottom:16px}ha-card:has(ha-logbook){padding-bottom:var(--ha-card-border-radius,12px)}ha-logbook{height:400px}:host([narrow]) ha-logbook{height:235px}.card-actions{display:flex;justify-content:space-between;align-items:center}`))]}}]}}),o.oi);t()}catch(V){t(V)}}))},77148:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),s=(i(19083),i(71695),i(92745),i(9359),i(68107),i(56475),i(1331),i(31526),i(70104),i(52924),i(19423),i(40251),i(18917),i(19134),i(11740),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47706),i(47021),i(71513),i(75656),i(50100),i(18084),i(60738)),o=i(57243),r=i(18672),l=i(50778),d=i(27486),c=i(75011),h=i(64214),u=i(68958),v=i(86431),f=i(59847),g=i(46355),m=i(83523),p=i(35076),y=(i(10504),i(44925),i(99426),i(34273),i(48103),i(20130),i(76268),i(43082),i(87315)),_=(i(86735),i(9425),i(23334),i(51868),i(7843),i(4573),i(82100)),b=i(75101),k=i(30635),w=i(12068),$=i(71857),x=i(63318),C=i(63860),z=i(76131),A=i(38419),E=i(6736),L=i(28008),S=i(88238),M=i(61107),D=i(82967),j=(i(44536),i(84361)),I=i(26345),O=e([y,A,r,h]);[y,A,r,h]=O.then?(await O)():O;let P,H,B,Z,N,V,F,W,T,U,R,Y,G,K,Q,q,X,J,ee,te,ie,ae,ne,se,oe=e=>e;const re="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",le="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",de="M7,10L12,15L17,10H7Z",ce="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",he="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",ue="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z";(0,a.Z)([(0,l.Mo)("ha-config-devices-dashboard")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"entries",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_subEntries",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,s.F_)({context:k.we,subscribe:!0})],key:"entities",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"manifests",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_searchParms",value(){return new URLSearchParams(window.location.search)}},{kind:"field",decorators:[(0,l.SB)()],key:"_selected",value(){return[]}},{kind:"field",decorators:[(0,u.t)({storage:"sessionStorage",key:"devices-table-search",state:!0,subscribe:!1})],key:"_filter",value(){var e;return(null===(e=history.state)||void 0===e?void 0:e.filter)||""}},{kind:"field",decorators:[(0,u.t)({storage:"sessionStorage",key:"devices-table-filters-full",state:!0,subscribe:!1,serializer:w.B,deserializer:w.l})],key:"_filters",value(){return{}}},{kind:"field",decorators:[(0,l.SB)()],key:"_expandedFilter",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_labels",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"devices-table-sort",state:!1,subscribe:!1})],key:"_activeSorting",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"devices-table-grouping",state:!1,subscribe:!1})],key:"_activeGrouping",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"devices-table-collapsed",state:!1,subscribe:!1})],key:"_activeCollapsed",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"devices-table-column-order",state:!1,subscribe:!1})],key:"_activeColumnOrder",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"devices-table-hidden-columns",state:!1,subscribe:!1})],key:"_activeHiddenColumns",value:void 0},{kind:"field",key:"_sizeController",value(){return new r.Z(this,{callback:e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.contentRect.width}})}},{kind:"field",key:"_ignoreLocationChange",value(){return!1}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}},{kind:"field",key:"_locationChanged",value(){return()=>{this._ignoreLocationChange?this._ignoreLocationChange=!1:window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_popState",value(){return()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_states",value(){return(0,d.Z)((e=>[{value:"disabled",label:e("ui.panel.config.devices.data_table.disabled_by")}]))}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),this.hasUpdated||this._setFiltersFromUrl()}},{kind:"method",key:"_setFiltersFromUrl",value:function(){var e,t;const i=this._searchParms.get("domain"),a=this._searchParms.get("config_entry"),n=this._searchParms.get("sub_entry"),s=this._searchParms.has("label");(i||a||s)&&(this._filter=(null===(e=history.state)||void 0===e?void 0:e.filter)||"",this._filters={"ha-filter-states":{value:[...(null===(t=this._filters["ha-filter-states"])||void 0===t?void 0:t.value)||[],"disabled"],items:void 0},"ha-filter-integrations":{value:i?[i]:[],items:void 0},config_entry:{value:a?[a]:[],items:void 0},sub_entry:{value:n?[n]:[],items:void 0}},this._filterLabel())}},{kind:"method",key:"_filterLabel",value:function(){const e=this._searchParms.get("label");e&&(this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-labels":{value:[e],items:void 0}}))}},{kind:"method",key:"_clearFilter",value:function(){this._filters={}}},{kind:"field",key:"_devicesAndFilterDomains",value(){return(0,d.Z)(((e,t,i,a,n,s,o,r)=>{var l;let d=Object.values(e).map((e=>Object.assign(Object.assign({},e),{},{label_entries:[]})));const c={};for(const v of i)v.device_id&&(v.device_id in c||(c[v.device_id]=[]),c[v.device_id].push(v));const h={};for(const v of t)h[v.entry_id]=v;const u={};for(const v of n)u[v.domain]=v;let f;const g=new Set;Object.entries(s).forEach((([e,i])=>{if("config_entry"===e&&Array.isArray(i.value)&&i.value.length){d=d.filter((e=>e.config_entries.some((e=>i.value.includes(e)))));const e=t.filter((e=>e.entry_id&&i.value.includes(e.entry_id)));e.forEach((e=>{g.add(e.domain)})),1===e.length&&(f=e[0])}else if("sub_entry"===e&&Array.isArray(i.value)&&i.value.length){var a;if(!Array.isArray(null===(a=this._filters.config_entry)||void 0===a?void 0:a.value)||1!==this._filters.config_entry.value.length)return;const e=this._filters.config_entry.value[0];d=d.filter((t=>t.config_entries_subentries[e]&&i.value.some((i=>t.config_entries_subentries[e].includes(i))))),this._subEntries||this._loadSubEntries(e)}else if("ha-filter-integrations"===e&&Array.isArray(i.value)&&i.value.length){const e=t.filter((e=>i.value.includes(e.domain))).map((e=>e.entry_id));d=d.filter((t=>t.config_entries.some((t=>e.includes(t))))),i.value.forEach((e=>g.add(e)))}else"ha-filter-labels"===e&&Array.isArray(i.value)&&i.value.length?d=d.filter((e=>e.labels.some((e=>i.value.includes(e))))):i.items&&(d=d.filter((e=>i.items.has(e.id))))}));const m=null===(l=s["ha-filter-states"])||void 0===l?void 0:l.value;(null==m?void 0:m.length)&&m.includes("disabled")||(d=d.filter((e=>!e.disabled_by)));return{devicesOutput:d.map((e=>{var t;const i=(0,b.Pk)(e.config_entries.filter((e=>e in h)).map((e=>h[e])),e.primary_config_entry),n=(r&&(null==e?void 0:e.labels)||[]).map((e=>r.find((t=>t.label_id===e))));return Object.assign(Object.assign({},e),{},{name:(0,v.wZ)(e,this.hass,c[e.id]),model:e.model||`<${o("ui.panel.config.devices.data_table.unknown")}>`,manufacturer:e.manufacturer||`<${o("ui.panel.config.devices.data_table.unknown")}>`,area:e.area_id&&a[e.area_id]?a[e.area_id].name:"—",integration:i.length?i.map((e=>o(`component.${e.domain}.title`)||e.domain)).join(", "):this.hass.localize("ui.panel.config.devices.data_table.no_integration"),domains:i.map((e=>e.domain)),battery_entity:[this._batteryEntity(e.id,c),this._batteryChargingEntity(e.id,c)],battery_level:null===(t=this.hass.states[this._batteryEntity(e.id,c)||""])||void 0===t?void 0:t.state,label_entries:n})})),filteredConfigEntry:f,filteredDomains:g}}))}},{kind:"field",key:"_columns",value(){return(0,d.Z)((e=>({icon:{title:"",label:e("ui.panel.config.devices.data_table.icon"),type:"icon",moveable:!1,showNarrow:!0,template:e=>{var t;return e.domains.length?(0,o.dy)(P||(P=oe`<img alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}">`),(0,S.X1)({domain:e.domains[0],type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode})):""}},name:{title:e("ui.panel.config.devices.data_table.device"),main:!0,sortable:!0,filterable:!0,direction:"asc",grows:!0,flex:2,minWidth:"150px",extraTemplate:e=>(0,o.dy)(H||(H=oe` ${0} `),e.label_entries.length?(0,o.dy)(B||(B=oe` <ha-data-table-labels .labels="${0}"></ha-data-table-labels> `),e.label_entries):o.Ld)},manufacturer:{title:e("ui.panel.config.devices.data_table.manufacturer"),sortable:!0,filterable:!0,groupable:!0,minWidth:"120px"},model:{title:e("ui.panel.config.devices.data_table.model"),sortable:!0,filterable:!0,minWidth:"120px"},area:{title:e("ui.panel.config.devices.data_table.area"),sortable:!0,filterable:!0,groupable:!0,minWidth:"120px"},integration:{title:e("ui.panel.config.devices.data_table.integration"),sortable:!0,filterable:!0,groupable:!0,minWidth:"120px"},battery_entity:{title:e("ui.panel.config.devices.data_table.battery"),showNarrow:!0,sortable:!0,type:"numeric",maxWidth:"101px",minWidth:"101px",valueColumn:"battery_level",template:e=>{const t=e.battery_entity,i=t&&t[0]?this.hass.states[t[0]]:void 0,a=i?(0,f.N)(i):void 0,n=t&&t[1]?this.hass.states[t[1]]:void 0;return!i||"binary_sensor"!==a&&isNaN(i.state)?"—":(0,o.dy)(Z||(Z=oe` ${0} <ha-battery-icon .hass="${0}" .batteryStateObj="${0}" .batteryChargingStateObj="${0}"></ha-battery-icon> `),"sensor"===a?this.hass.formatEntityState(i):o.Ld,this.hass,i,n)}},created_at:{title:e("ui.panel.config.generic.headers.created_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.created_at?(0,h.yD)(new Date(1e3*e.created_at),this.hass.locale,this.hass.config):"—"},modified_at:{title:e("ui.panel.config.generic.headers.modified_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.modified_at?(0,h.yD)(new Date(1e3*e.modified_at),this.hass.locale,this.hass.config):"—"},disabled_by:{title:e("ui.panel.config.devices.picker.state"),type:"icon",defaultHidden:!0,sortable:!0,filterable:!0,minWidth:"80px",maxWidth:"80px",template:e=>e.disabled_by?(0,o.dy)(N||(N=oe` <div tabindex="0" style="display:inline-block;position:relative"> <ha-tooltip placement="left" .content="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-tooltip> </div> `),this.hass.localize("ui.panel.config.entities.picker.status.disabled"),ue):"—"},labels:{title:"",hidden:!0,filterable:!0,template:e=>e.label_entries.map((e=>e.name)).join(" ")}})))}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,C.f4)(this.hass.connection,(e=>{this._labels=e}))]}},{kind:"method",key:"render",value:function(){var e,t,i,a,n,s,r,l,d,h;const{devicesOutput:u}=this._devicesAndFilterDomains(this.hass.devices,this.entries,this.entities,this.hass.areas,this.manifests,this._filters,this.hass.localize,this._labels),v=this._sizeController.value&&this._sizeController.value<700||!this._sizeController.value&&"docked"===this.hass.dockedSidebar,f=(0,o.dy)(V||(V=oe`${0} <ha-md-menu-item .value="${0}" .clickAction="${0}"> <div slot="headline"> ${0} </div> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${0}"> <div slot="headline"> ${0} </div> </ha-md-menu-item>`),Object.values(this.hass.areas).map((e=>(0,o.dy)(F||(F=oe`<ha-md-menu-item .value="${0}" .clickAction="${0}"> ${0} <div slot="headline">${0}</div> </ha-md-menu-item>`),e.area_id,this._handleBulkArea,e.icon?(0,o.dy)(W||(W=oe`<ha-icon slot="start" .icon="${0}"></ha-icon>`),e.icon):(0,o.dy)(T||(T=oe`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),he),e.name))),null,this._handleBulkArea,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.no_area"),this._bulkCreateArea,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.add_area")),g=(0,o.dy)(U||(U=oe`${0} <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${0}"> <div slot="headline"> ${0} </div></ha-md-menu-item>`),null===(e=this._labels)||void 0===e?void 0:e.map((e=>{const t=e.color?(0,c.I)(e.color):void 0,i=this._selected.every((t=>{var i;return null===(i=this.hass.devices[t])||void 0===i?void 0:i.labels.includes(e.label_id)})),a=!i&&this._selected.some((t=>{var i;return null===(i=this.hass.devices[t])||void 0===i?void 0:i.labels.includes(e.label_id)}));return(0,o.dy)(R||(R=oe`<ha-md-menu-item .value="${0}" .action="${0}" @click="${0}" keep-open> <ha-checkbox slot="start" .checked="${0}" .indeterminate="${0}" reducedTouchTarget></ha-checkbox> <ha-label style="${0}"> ${0} ${0} </ha-label> </ha-md-menu-item>`),e.label_id,i?"remove":"add",this._handleBulkLabel,i,a,t?`--color: ${t}`:"",e.icon?(0,o.dy)(Y||(Y=oe`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):o.Ld,e.name)})),this._bulkCreateLabel,this.hass.localize("ui.panel.config.labels.add_label"));return(0,o.dy)(G||(G=oe` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" .backPath="${0}" .tabs="${0}" .route="${0}" .searchLabel="${0}" .columns="${0}" .data="${0}" selectable .selected="${0}" @selection-changed="${0}" .filter="${0}" has-filters .filters="${0}" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .initialSorting="${0}" .columnOrder="${0}" .hiddenColumns="${0}" @columns-changed="${0}" @clear-filter="${0}" @search-changed="${0}" @sorting-changed="${0}" @grouping-changed="${0}" @collapsed-changed="${0}" @row-click="${0}" clickable has-fab class="${0}"> <ha-integration-overflow-menu .hass="${0}" slot="toolbar-icon"></ha-integration-overflow-menu> <ha-fab slot="fab" .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> ${0} <ha-filter-floor-areas .hass="${0}" type="device" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-floor-areas> <ha-filter-integrations .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-integrations> <ha-filter-states .hass="${0}" .value="${0}" .states="${0}" .label="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-states> <ha-filter-labels .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-labels> ${0} ${0} </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this._searchParms.has("historyBack")?void 0:"/config",D.configSections.devices,this.route,this.hass.localize("ui.panel.config.devices.picker.search",{number:u.length}),this._columns(this.hass.localize),u,this._selected.length,this._handleSelectionChanged,this._filter,Object.values(this._filters).filter((e=>Array.isArray(e.value)?e.value.length:e.value&&Object.values(e.value).some((e=>Array.isArray(e)?e.length:e)))).length,this._activeGrouping,this._activeCollapsed,this._activeSorting,this._activeColumnOrder,this._activeHiddenColumns,this._handleColumnsChanged,this._clearFilter,this._handleSearchChange,this._handleSortingChanged,this._handleGroupingChanged,this._handleCollapseChanged,this._handleRowClicked,this.narrow?"narrow":"",this.hass,this.hass.localize("ui.panel.config.devices.add_device"),this._addDevice,ce,Array.isArray(null===(t=this._filters.config_entry)||void 0===t?void 0:t.value)&&null!==(i=this._filters.config_entry)&&void 0!==i&&i.value.length?(0,o.dy)(K||(K=oe`<ha-alert slot="filter-pane"> ${0} ${0}${0} </ha-alert>`),this.hass.localize("ui.panel.config.devices.filtering_by_config_entry"),(null===(a=this.entries)||void 0===a||null===(a=a.find((e=>e.entry_id===this._filters.config_entry.value[0])))||void 0===a?void 0:a.title)||this._filters.config_entry.value[0],1===this._filters.config_entry.value.length&&Array.isArray(null===(n=this._filters.sub_entry)||void 0===n?void 0:n.value)&&this._filters.sub_entry.value.length?(0,o.dy)(Q||(Q=oe` (${0})`),(null===(s=this._subEntries)||void 0===s||null===(s=s.find((e=>e.subentry_id===this._filters.sub_entry.value[0])))||void 0===s?void 0:s.title)||this._filters.sub_entry.value[0]):o.Ld):o.Ld,this.hass,null===(r=this._filters["ha-filter-floor-areas"])||void 0===r?void 0:r.value,this._filterChanged,"ha-filter-floor-areas"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(l=this._filters["ha-filter-integrations"])||void 0===l?void 0:l.value,this._filterChanged,"ha-filter-integrations"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(d=this._filters["ha-filter-states"])||void 0===d?void 0:d.value,this._states(this.hass.localize),this.hass.localize("ui.panel.config.devices.picker.state"),this._filterChanged,"ha-filter-states"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(h=this._filters["ha-filter-labels"])||void 0===h?void 0:h.value,this._filterChanged,"ha-filter-labels"===this._expandedFilter,this.narrow,this._filterExpanded,this.narrow?o.Ld:(0,o.dy)(q||(q=oe`<ha-md-button-menu slot="selection-bar"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-md-button-menu> ${0}`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),de,g,v?o.Ld:(0,o.dy)(X||(X=oe`<ha-md-button-menu slot="selection-bar"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-md-button-menu>`),this.hass.localize("ui.panel.config.devices.picker.bulk_actions.move_area"),de,f)),this.narrow||v?(0,o.dy)(J||(J=oe`<ha-md-button-menu has-overflow slot="selection-bar"> ${0} ${0} <ha-sub-menu> <ha-md-menu-item slot="item"> <div slot="headline"> ${0} </div> <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-md-menu-item> <ha-menu slot="menu">${0}</ha-menu> </ha-sub-menu> </ha-md-button-menu>`),this.narrow?(0,o.dy)(ee||(ee=oe`<ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip>`),this.hass.localize("ui.panel.config.automation.picker.bulk_action"),de):(0,o.dy)(te||(te=oe`<ha-icon-button .path="${0}" .label="${0}" slot="trigger"></ha-icon-button>`),le,this.hass.localize("ui.panel.config.automation.picker.bulk_action")),this.narrow?(0,o.dy)(ie||(ie=oe` <ha-sub-menu> <ha-md-menu-item slot="item"> <div slot="headline"> ${0} </div> <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-md-menu-item> <ha-menu slot="menu">${0}</ha-menu> </ha-sub-menu>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),re,g):o.Ld,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.move_area"),re,f):o.Ld)}},{kind:"method",key:"_loadSubEntries",value:async function(e){this._subEntries=await(0,b.$H)(this.hass,e)}},{kind:"method",key:"_filterExpanded",value:function(e){e.detail.expanded?this._expandedFilter=e.target.localName:this._expandedFilter===e.target.localName&&(this._expandedFilter=void 0)}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.target.localName;this._filters=Object.assign(Object.assign({},this._filters),{},{[t]:e.detail})}},{kind:"method",key:"_batteryEntity",value:function(e,t){const i=(0,x.eD)(this.hass,t[e]||[]);return i?i.entity_id:void 0}},{kind:"method",key:"_batteryChargingEntity",value:function(e,t){const i=(0,x.wX)(this.hass,t[e]||[]);return i?i.entity_id:void 0}},{kind:"method",key:"_handleRowClicked",value:function(e){const t=e.detail.id;this._ignoreLocationChange=!0,(0,m.c)(`/config/devices/device/${t}`)}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value,history.replaceState({filter:this._filter},"")}},{kind:"method",key:"_addDevice",value:function(){const{filteredConfigEntry:e,filteredDomains:t}=this._devicesAndFilterDomains(this.hass.devices,this.entries,this.entities,this.hass.areas,this.manifests,this._filters,this.hass.localize,this._labels);1===t.size&&g.S.includes([...t][0])?(0,g.D)(this,this.hass,[...t][0],{config_entry:null==e?void 0:e.entry_id}):(0,j.E)(this,{domain:this._searchParms.get("domain")||void 0})}},{kind:"method",key:"_handleSelectionChanged",value:function(e){this._selected=e.detail.value}},{kind:"field",key:"_handleBulkArea",value(){return e=>{const t=e.value;this._bulkAddArea(t)}}},{kind:"method",key:"_bulkAddArea",value:async function(e){const t=[];this._selected.forEach((i=>{t.push((0,$.t1)(this.hass,i,{area_id:e}))}));const i=await Promise.allSettled(t);if((0,p.M)(i)){const e=(0,p.a)(i);(0,z.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.dy)(ae||(ae=oe`<pre>
${0}</pre>`),e.map((e=>e.reason.message||e.reason.code||e.reason)).join("\r\n"))})}}},{kind:"field",key:"_bulkCreateArea",value(){return()=>{(0,M.E)(this,{createEntry:async e=>{const t=await(0,_.Lo)(this.hass,e);return this._bulkAddArea(t.area_id),t}})}}},{kind:"method",key:"_handleBulkLabel",value:async function(e){const t=e.currentTarget.value,i=e.currentTarget.action;this._bulkLabel(t,i)}},{kind:"method",key:"_bulkLabel",value:async function(e,t){const i=[];this._selected.forEach((a=>{i.push((0,$.t1)(this.hass,a,{labels:"add"===t?this.hass.devices[a].labels.concat(e):this.hass.devices[a].labels.filter((t=>t!==e))}))}));const a=await Promise.allSettled(i);if((0,p.M)(a)){const e=(0,p.a)(a);(0,z.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.dy)(ne||(ne=oe`<pre>
${0}</pre>`),e.map((e=>e.reason.message||e.reason.code||e.reason)).join("\r\n"))})}}},{kind:"field",key:"_bulkCreateLabel",value(){return()=>{(0,I.T)(this,{createEntry:async e=>{const t=await(0,C.jo)(this.hass,e);return this._bulkLabel(t.label_id,"add"),t}})}}},{kind:"method",key:"_handleSortingChanged",value:function(e){this._activeSorting=e.detail}},{kind:"method",key:"_handleGroupingChanged",value:function(e){this._activeGrouping=e.detail.value}},{kind:"method",key:"_handleCollapseChanged",value:function(e){this._activeCollapsed=e.detail.value}},{kind:"method",key:"_handleColumnsChanged",value:function(e){this._activeColumnOrder=e.detail.columnOrder,this._activeHiddenColumns=e.detail.hiddenColumns}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,o.iv)(se||(se=oe`:host{display:block}hass-tabs-subpage-data-table{--data-table-row-height:60px}hass-tabs-subpage-data-table.narrow{--data-table-row-height:72px}ha-button-menu{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}.clear{color:var(--primary-color);padding-left:8px;padding-inline-start:8px;text-transform:uppercase;direction:var(--direction)}ha-assist-chip{--ha-assist-chip-container-shape:10px}ha-md-button-menu ha-assist-chip{--md-assist-chip-trailing-space:8px}ha-label{--ha-label-background-color:var(--color, var(--grey-color));--ha-label-background-opacity:0.5}`)),L.Qx]}}]}}),(0,E.f)(o.oi));t()}catch(P){t(P)}}))},39388:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),s=i(72621),o=(i(71695),i(40251),i(47021),i(50778)),r=i(75101),l=i(57816),d=i(24312),c=i(7199),h=i(77148),u=e([c,h]);[c,h]=u.then?(await u)():u;(0,n.Z)([(0,o.Mo)("ha-config-devices")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"showAdvanced",value(){return!1}},{kind:"field",key:"routerOptions",value(){return{defaultPage:"dashboard",routes:{dashboard:{tag:"ha-config-devices-dashboard",cache:!0},device:{tag:"ha-config-device-page"}}}}},{kind:"field",decorators:[(0,o.SB)()],key:"_configEntries",value(){return[]}},{kind:"field",decorators:[(0,o.SB)()],key:"_manifests",value(){return[]}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),this._loadData()}},{kind:"method",key:"updatePageEl",value:function(e){e.hass=this.hass,"device"===this._currentPage&&(e.deviceId=this.routeTail.path.substr(1)),e.entries=this._configEntries,e.manifests=this._manifests,e.narrow=this.narrow,e.isWide=this.isWide,e.showAdvanced=this.showAdvanced,e.route=this.routeTail}},{kind:"method",key:"_loadData",value:async function(){this._configEntries=await(0,r.pB)(this.hass),this._manifests=await(0,l.F3)(this.hass)}}]}}),d.n);a()}catch(v){a(v)}}))},20526:function(e,t,i){i.d(t,{oU:()=>p,lY:()=>g,VG:()=>m,AP:()=>y});i(19083),i(71695),i(92745),i(61893),i(84283),i(9359),i(56475),i(1331),i(31526),i(70104),i(19423),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(81804),i(47021);var a=i(73358),n=i(73850),s=i(59847),o=i(47194);var r=i(12753),l=i(1416),d=i(82100),c=i(57816),h=i(4242),u=i(96530);const v=new Set(["automation","configurator","device_tracker","event","geo_location","notify","persistent_notification","script","sun","tag","todo","zone",...a.a5]),f=new Set(["backup","mobile_app"]),g=(e,t)=>Object.assign({type:"grid",cards:e.map((e=>({type:"tile",entity:e,show_entity_picture:["camera","image","person"].includes((0,n.M)(e))||void 0})))},t),m=(e,t,i,s=!0)=>{const d=[],c=[],h=i.title?i.title.toLowerCase():void 0,u=[];for(const a of t){const t=e[a],i=(0,n.M)(a);if("alarm_control_panel"===i){const e={type:"alarm-panel",entity:a};d.push(e)}else if("camera"===i){const e={type:"picture-entity",entity:a};d.push(e)}else if("image"===i){const e={type:"picture",image_entity:a};d.push(e)}else if("climate"===i){var v,f,g;const t={type:"thermostat",entity:a,features:(null!==(v=null===(f=e[a])||void 0===f||null===(f=f.attributes)||void 0===f||null===(f=f.hvac_modes)||void 0===f?void 0:f.length)&&void 0!==v?v:0)>1?[{type:"climate-hvac-modes",hvac_modes:null===(g=e[a])||void 0===g||null===(g=g.attributes)||void 0===g?void 0:g.hvac_modes}]:void 0};d.push(t)}else if("humidifier"===i){const e={type:"humidifier",entity:a,features:[{type:"humidifier-toggle"}]};d.push(e)}else if("media_player"===i){const e={type:"media-control",entity:a};d.push(e)}else if("plant"===i){const e={type:"plant-status",entity:a};d.push(e)}else if("weather"===i){const e={type:"weather-forecast",entity:a,show_forecast:!1};d.push(e)}else if(!s||"scene"!==i&&"script"!==i){let e;const i=h&&t&&(e=(0,r.N)((0,o.C)(t),h))?{entity:a,name:e}:a;c.push(i)}else{const e={entity:a,show_icon:!0,show_name:!0};let i;h&&t&&(i=(0,r.N)((0,o.C)(t),h))&&(e.name=i),u.push(e)}}if(c.sort(((t,i)=>{const s="string"==typeof t?t:t.entity,r="string"==typeof i?i:i.entity,d=a.zF.includes((0,n.M)(s))?"sensor":"control";return d!==(a.zF.includes((0,n.M)(r))?"sensor":"control")?"sensor"===d?1:-1:(0,l.$K)("string"==typeof t?e[t]?(0,o.C)(e[t]):"":t.name||"","string"==typeof i?e[i]?(0,o.C)(e[i]):"":i.name||"")})),0===c.length&&u.length>0)return m(e,t,i,!1);if(c.length>0||u.length>0){const e=Object.assign({type:"entities",entities:c},i);u.length>0&&(e.footer={type:"buttons",entities:u}),d.unshift(e)}return d.length<2?d:[{type:"grid",square:!1,columns:1,cards:d}]},p=(e,t)=>{const i=[];for(const a of t){const e={type:"entity",entity:a};i.push(e)}return i},y=(e,t,i,a,r,g,p,y,_)=>{const b=((e,t)=>{const i={},a=new Set(Object.values(t).filter((e=>e.entity_category||e.platform&&f.has(e.platform)||e.hidden)).map((e=>e.entity_id)));for(const n of Object.keys(e)){const t=e[n];v.has((0,s.N)(t))||a.has(t.entity_id)||(i[n]=e[n])}return i})(a,i),k={};for(const n of Object.keys(b)){const e=b[n];e.attributes.order&&(k[n]=e.attributes.order)}const w=((e,t,i,a)=>{const n=Object.assign({},a),s={},o={};for(const l of Object.values(i)){var r;const i=l.area_id||l.device_id&&(null===(r=t[l.device_id])||void 0===r?void 0:r.area_id);i&&i in e&&l.entity_id in n?(i in s||(s[i]=[]),s[i].push(n[l.entity_id]),delete n[l.entity_id]):l.device_id&&l.device_id in t&&l.entity_id in n&&(l.device_id in o||(o[l.device_id]=[]),o[l.device_id].push(n[l.entity_id]),delete n[l.entity_id])}for(const[l,d]of Object.entries(o))1===d.length&&(n[d[0].entity_id]=d[0],delete o[l]);return{areasWithEntities:s,devicesWithEntities:o,otherEntities:n}})(e,t,i,b);if(null!=p&&p.hidden)for(const n of p.hidden)delete w.areasWithEntities[n];y&&(w.devicesWithEntities={},w.otherEntities={});const $=(e=>{const t=[],i={};return Object.keys(e).forEach((a=>{const s=e[a];"group"===(0,n.M)(a)?t.push(s):i[a]=s})),t.forEach((e=>e.attributes.entity_id.forEach((e=>{delete i[e]})))),{groups:t,ungrouped:i}})(w.otherEntities);$.groups.sort(((e,t)=>k[e.entity_id]-k[t.entity_id]));const x=[];for(const n of $.groups)x.push(...m(a,n.attributes.entity_id,{title:(0,o.C)(n),show_header_toggle:"hidden"!==n.attributes.control}));const C=((e,t,i,a,n)=>{const r={};for(const o of Object.keys(n)){const e=n[o],t=(0,s.N)(e);t in r||(r[t]=[]),r[t].push(e.entity_id)}const d=[];if("person"in r){const e=[];if(1===r.person.length)d.push({type:"entities",entities:r.person});else{let t,i="";for(const a of r.person){const s=n[a];let o=s.attributes.entity_picture;if(!o){if(void 0===t){const e=getComputedStyle(document.body);t=encodeURIComponent(e.getPropertyValue("--light-primary-color").trim()),i=encodeURIComponent((e.getPropertyValue("--text-light-primary-color")||e.getPropertyValue("--primary-text-color")).trim())}o=`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' width='50' height='50' style='background-color:${t}'%3E%3Cg%3E%3Ctext font-family='roboto' x='50%25' y='50%25' text-anchor='middle' stroke='${i}' font-size='1.3em' dy='.3em'%3E${(0,h.fm)(s.attributes.friendly_name||"")}%3C/text%3E%3C/g%3E%3C/svg%3E`}e.push({type:"picture-entity",entity:a,aspect_ratio:"1",show_name:!1,image:o})}d.push({type:"grid",square:!0,columns:3,cards:e})}delete r.person}const v=[];for(const s of u.y)s in r&&(v.push(...r[s]),delete r[s]);const f={};for(const s of Object.keys(r))f[s]=(0,c.Lh)(e,s);v.length&&(r._helpers=v,f._helpers=e("ui.panel.lovelace.strategy.original-states.helpers")),Object.keys(r).sort(((e,t)=>(0,l.$K)(f[e],f[t]))).forEach((e=>{d.push(...m(n,r[e].sort(((e,t)=>(0,l.$K)((0,o.C)(n[e]),(0,o.C)(n[t])))),{title:f[e]}))}));const g={path:t,title:i,cards:d};return a&&(g.icon=a),g})(r,"default_view","Home",undefined,$.ungrouped),z=[],A=Object.keys(w.areasWithEntities).sort((0,d.a)(e,null==p?void 0:p.order));for(const n of A){const t=w.areasWithEntities[n],i=e[n];z.push(...m(a,t.map((e=>e.entity_id)),{title:i.name}))}const E=[],L=Object.entries(w.devicesWithEntities).sort(((e,i)=>{const a=t[e[0]],n=t[i[0]];return(0,l.$K)(a.name_by_user||a.name||"",n.name_by_user||n.name||"")}));for(const[n,s]of L){const e=t[n];E.push(...m(a,s.map((e=>e.entity_id)),{title:e.name_by_user||e.name||r("ui.panel.config.devices.unnamed_device",{type:r(`ui.panel.config.devices.type.${e.entry_type||"device"}`)})}))}let S;if(g&&!_){const e=g.energy_sources.find((e=>"grid"===e.type));e&&e.flow_from.length>0&&(S={title:r("ui.panel.lovelace.cards.energy.energy_distribution.title_today"),type:"energy-distribution",link_dashboard:!0})}return C.cards.unshift(...z,...x,...S?[S]:[]),C.cards.push(...E),C}},40249:function(e,t,i){i.d(t,{ED:()=>u,Fr:()=>o,N2:()=>s,Tw:()=>c,Xm:()=>h});i(52247),i(19083),i(71695),i(40251),i(61006),i(47021);var a=i(36522),n=i(17951);const s=(e,t)=>({type:"error",error:e,origConfig:t}),o=(e,t)=>({type:"error",error:e,origConfig:t}),r=(e,t)=>{const i=document.createElement(e);return i.setConfig(t),i},l=(e,t,a)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([i.e("35671"),i.e("2142"),i.e("8795"),i.e("32146"),i.e("31241"),i.e("35152"),i.e("63055"),i.e("70147"),i.e("79931"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("3371"),i.e("1466"),i.e("38326"),i.e("10745"),i.e("70639"),i.e("72974"),i.e("86915"),i.e("51098")]).then(i.bind(i,72814)),customElements.whenDefined("hui-error-badge").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(o(t,a)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([i.e("35671"),i.e("2142"),i.e("8795"),i.e("32146"),i.e("31241"),i.e("35152"),i.e("63055"),i.e("70147"),i.e("79931"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("3371"),i.e("1466"),i.e("38326"),i.e("10745"),i.e("70639"),i.e("72974"),i.e("86915"),i.e("98170")]).then(i.bind(i,5031)),customElements.whenDefined("hui-error-heading-badge").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,a)):(e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.all([i.e("2142"),i.e("8795"),i.e("9962")]).then(i.bind(i,5252)),customElements.whenDefined("hui-error-card").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(s(t,a)),d=e=>(0,n.IT)(e)?(0,n.V0)(e):void 0,c=(e,t,i,a,n,s)=>{try{return h(e,t,i,a,n,s)}catch(o){return console.error(e,t.type,o),l(e,o.message,t)}},h=(e,t,i,n,s,o)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||o||s&&"entity"in t))throw new Error("No card type configured");const c=t.type?d(t.type):void 0;if(c)return((e,t,i)=>{if(customElements.get(t))return r(t,i);const n=l(e,`Custom element doesn't exist: ${t}.`,i);if(!t.includes("-"))return n;n.style.display="None";const s=window.setTimeout((()=>{n.style.display=""}),2e3);return customElements.whenDefined(t).then((()=>{clearTimeout(s),(0,a.B)(n,"ll-rebuild")})),n})(e,c,t);let h;if(s&&!t.type&&t.entity){h=`${s[t.entity.split(".",1)[0]]||s._domain_not_found}-entity`}else h=t.type||o;if(void 0===h)throw new Error("No type specified");const u=`hui-${h}-${e}`;if(n&&h in n)return n[h](),((e,t)=>{if(customElements.get(e))return r(e,t);const i=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(i),(0,a.B)(i,"ll-upgrade"),i.setConfig(t)}catch(e){(0,a.B)(i,"ll-rebuild")}})),i})(u,t);if(i&&i.has(h))return r(u,t);throw new Error(`Unknown type encountered: ${h}`)},u=async(e,t,i,a)=>{const n=d(e);if(n){const e=customElements.get(n);if(e)return e;if(!n.includes("-"))throw new Error(`Custom element not found: ${n}`);return new Promise(((e,t)=>{setTimeout((()=>t(new Error(`Custom element not found: ${n}`))),2e3),customElements.whenDefined(n).then((()=>e(customElements.get(n))))}))}const s=`hui-${e}-${t}`,o=customElements.get(s);if(i&&i.has(e))return o;if(a&&e in a)return o||a[e]().then((()=>customElements.get(s)));throw new Error(`Unknown type: ${e}`)}},46542:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{T:()=>b,m:()=>_});i(71695),i(40251),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);var n=i(72053),s=i(35659),o=i(52809),r=i(40165),l=i(82114),d=i(21474),c=i(31087),h=i(90296),u=i(42135),v=i(40806),f=i(40249),g=e([n,s,o,r,l,d,c,h,u,v]);[n,s,o,r,l,d,c,h,u,v]=g.then?(await g)():g;const m=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),p={"button-entity":()=>i.e("44821").then(i.bind(i,35154)),"climate-entity":()=>i.e("79702").then(i.bind(i,54222)),"cover-entity":()=>i.e("50764").then(i.bind(i,4806)),"date-entity":()=>Promise.all([i.e("46379"),i.e("50013")]).then(i.bind(i,61351)),"datetime-entity":()=>Promise.all([i.e("46379"),i.e("41258"),i.e("35671"),i.e("3134"),i.e("38336"),i.e("99113")]).then(i.bind(i,67429)),"event-entity":()=>Promise.resolve().then(i.bind(i,72053)),"group-entity":()=>i.e("83537").then(i.bind(i,40445)),"input-button-entity":()=>i.e("5380").then(i.bind(i,57548)),"humidifier-entity":()=>i.e("84999").then(i.bind(i,88916)),"input-datetime-entity":()=>Promise.all([i.e("46379"),i.e("41258"),i.e("35671"),i.e("38336"),i.e("55119")]).then(i.bind(i,67223)),"input-number-entity":()=>Promise.all([i.e("46379"),i.e("84605")]).then(i.bind(i,90516)),"input-select-entity":()=>Promise.all([i.e("41258"),i.e("35671"),i.e("66868")]).then(i.bind(i,43)),"input-text-entity":()=>Promise.all([i.e("46379"),i.e("14673")]).then(i.bind(i,22623)),"lock-entity":()=>i.e("99689").then(i.bind(i,65751)),"number-entity":()=>Promise.all([i.e("46379"),i.e("88187")]).then(i.bind(i,77288)),"select-entity":()=>Promise.all([i.e("41258"),i.e("35671"),i.e("86857")]).then(i.bind(i,64827)),"text-entity":()=>Promise.all([i.e("46379"),i.e("86449")]).then(i.bind(i,90689)),"time-entity":()=>Promise.all([i.e("46379"),i.e("41258"),i.e("35671"),i.e("38336"),i.e("63586")]).then(i.bind(i,4671)),"timer-entity":()=>i.e("7618").then(i.bind(i,45363)),"update-entity":()=>i.e("58400").then(i.bind(i,97604)),"valve-entity":()=>i.e("96347").then(i.bind(i,97937)),conditional:()=>i.e("79220").then(i.bind(i,24272)),"weather-entity":()=>Promise.all([i.e("44251"),i.e("28565")]).then(i.bind(i,51973)),divider:()=>i.e("73576").then(i.bind(i,70568)),section:()=>i.e("26438").then(i.bind(i,93665)),weblink:()=>i.e("41871").then(i.bind(i,69819)),cast:()=>i.e("45006").then(i.bind(i,15638)),buttons:()=>Promise.all([i.e("59821"),i.e("73644")]).then(i.bind(i,58574)),attribute:()=>Promise.resolve().then(i.bind(i,90296)),text:()=>i.e("52767").then(i.bind(i,68291))},y={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},_=e=>(0,f.Tw)("row",e,m,p,y,void 0),b=e=>(0,f.ED)(e,"row",m,p);a()}catch(m){a(m)}}))},69615:function(e,t,i){i.d(t,{$:()=>l});i(71695),i(9359),i(56475),i(40251),i(47021);var a=i(48977),n=i(6649),s=i(76131),o=i(53380),r=i(74941);const l=async(e,t,i,l,d)=>{var c,h;t.loadFragmentTranslation("lovelace");const u=await(0,n.j2)(t),v=u.filter((e=>"storage"===e.mode)),f=null===(c=t.panels.lovelace)||void 0===c||null===(c=c.config)||void 0===c?void 0:c.mode;if("storage"!==f&&!v.length)return void(0,o.f)(e,{cardConfig:i,entities:d,yaml:!0});let g,m=null;if("storage"===f)try{g=await(0,a.Q2)(t.connection,null,!1)}catch(p){}if(!g&&v.length)for(const n of v)try{g=await(0,a.Q2)(t.connection,n.url_path,!1),m=n.url_path;break}catch(p){}g?v.length||null!==(h=g.views)&&void 0!==h&&h.length?v.length||1!==g.views.length?(0,r.i)(e,{lovelaceConfig:g,urlPath:m,allowDashboardChange:!0,actionLabel:t.localize("ui.common.next"),dashboards:u,viewSelectedCallback:(n,s,r)=>{(0,o.f)(e,{cardConfig:i,sectionConfig:l,lovelaceConfig:s,saveConfig:async e=>{try{await(0,a.Oh)(t,n,e)}catch(i){alert(t.localize("ui.panel.lovelace.add_entities.saving_failed"))}},path:[r],entities:d})}}):(0,o.f)(e,{cardConfig:i,sectionConfig:l,lovelaceConfig:g,saveConfig:async e=>{try{await(0,a.Oh)(t,null,e)}catch(p){alert(t.localize("ui.panel.lovelace.add_entities.saving_failed"))}},path:[0],entities:d}):(0,s.showAlertDialog)(e,{text:"You don't have any Lovelace views, first create a view in Lovelace."}):u.length>v.length?(0,o.f)(e,{cardConfig:i,sectionConfig:l,entities:d,yaml:!0}):(0,s.showAlertDialog)(e,{text:"You don't seem to be in control of any dashboard, please take control first."})}},53380:function(e,t,i){i.d(t,{f:()=>s});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("35671"),i.e("2142"),i.e("29570"),i.e("65505"),i.e("8795"),i.e("71588"),i.e("92139"),i.e("32146"),i.e("31241"),i.e("47399"),i.e("68581"),i.e("63055"),i.e("70147"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("1466"),i.e("38326"),i.e("80809"),i.e("70639"),i.e("92368"),i.e("39043"),i.e("37457"),i.e("80312"),i.e("96827")]).then(i.bind(i,22958)),s=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:n,dialogParams:t})}},74941:function(e,t,i){i.d(t,{i:()=>n});i(71695),i(40251),i(47021);var a=i(36522);const n=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e("97983"),i.e("41258"),i.e("35671"),i.e("7010"),i.e("5851")]).then(i.bind(i,67271)),dialogParams:t})}},58014:function(e,t,i){i.d(t,{N:()=>n,G:()=>s});var a=i(18117);const n=(e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)},s=e=>{var t;return!(e=>!!e.auth.external&&a.G)(e)||!(null===(t=e.auth.external)||void 0===t||!t.config.downloadFileSupported)}},18117:function(e,t,i){i.d(t,{G:()=>a});i(19134),i(5740);const a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);
//# sourceMappingURL=94846.8fba5c9a178afcfe.js.map