"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["21062"],{68348:function(t,e,a){a.d(e,{u:function(){return n}});a(18111),a(13579),a(26099);var n=function(t){var e;if(t.some(function(t){return"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)}))return!1;var a=t[0];if("TEXTAREA"===a.tagName)return!1;if("HA-SELECT"===(null===(e=a.parentElement)||void 0===e?void 0:e.tagName))return!1;if("INPUT"!==a.tagName)return!0;switch(a.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},31580:function(t,e,a){a.d(e,{J8:function(){return r},Rr:function(){return i},b9:function(){return n},iV:function(){return o}});a(28706),a(94490),a(34782),a(26099),a(58940),a(38781),a(68156);var n=function(t){var e=t;return"string"==typeof t&&(e=parseInt(t,16)),"0x"+e.toString(16).padStart(4,"0")},r=function(t,e){var a=t.user_given_name?t.user_given_name:t.name,n=e.user_given_name?e.user_given_name:e.name;return a.localeCompare(n)},o=function(t,e){var a=t.name,n=e.name;return a.localeCompare(n)},i=function(t){return"".concat(t.name," (Endpoint id: ").concat(t.endpoint_id,", Id: ").concat(n(t.id),", Type: ").concat(t.type,")")}},32168:function(t,e,a){a.a(t,async function(t,n){try{a.r(e),a.d(e,{ZHAGroupsDashboard:function(){return E}});var r,o,i,s,u=a(61397),c=a(50264),l=a(72153),h=a(44734),p=a(43080),d=a(69683),f=a(6454),g=a(25460),m=(a(28706),a(62062),a(26910),a(18111),a(61701),a(69085),a(26099),a(40445)),b=a(96196),v=a(77845),_=a(22786),y=a(91926),A=(a(27661),a(26300),a(84621)),C=a(72553),k=a(14503),w=a(31580),H=a(63670),z=t([C,H]);[C,H]=z.then?(await z)():z;var E=function(t){function e(){var t;(0,h.A)(this,e);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(t=(0,d.A)(this,e,[].concat(n))).narrow=!1,t.isWide=!1,t._groups=[],t._firstUpdatedCalled=!1,t._formattedGroups=(0,_.A)(function(t){var e=t;return e=e.map(function(t){return Object.assign(Object.assign({},t),{},{id:String(t.group_id)})})}),t._columns=(0,_.A)(function(t){return{name:{title:t("ui.panel.config.zha.groups.groups"),sortable:!0,filterable:!0,showNarrow:!0,main:!0,hideable:!1,moveable:!1,direction:"asc",flex:2},group_id:{title:t("ui.panel.config.zha.groups.group_id"),type:"numeric",template:function(t){return(0,b.qy)(r||(r=(0,l.A)([" "," "])),(0,w.b9)(t.group_id))},sortable:!0},members:{title:t("ui.panel.config.zha.groups.members"),type:"numeric",template:function(t){return(0,b.qy)(o||(o=(0,l.A)([" "," "])),t.members.length)},sortable:!0}}}),t}return(0,f.A)(e,t),(0,p.A)(e,[{key:"connectedCallback",value:function(){(0,g.A)(e,"connectedCallback",this,3)([]),this.hass&&this._firstUpdatedCalled&&this._fetchGroups()}},{key:"firstUpdated",value:function(t){(0,g.A)(e,"firstUpdated",this,3)([t]),this.hass&&this._fetchGroups(),this._firstUpdatedCalled=!0}},{key:"render",value:function(){return(0,b.qy)(i||(i=(0,l.A)([' <hass-tabs-subpage-data-table .tabs="','" .hass="','" .narrow="','" .route="','" .columns="','" .data="','" @row-click="','" clickable has-fab> <a href="/config/zha/group-add" slot="fab"> <ha-fab .label="','" extended> <ha-svg-icon slot="icon" .path="','"></ha-svg-icon> </ha-fab> </a> </hass-tabs-subpage-data-table> '])),H.zhaTabs,this.hass,this.narrow,this.route,this._columns(this.hass.localize),this._formattedGroups(this._groups),this._handleRowClicked,this.hass.localize("ui.panel.config.zha.groups.add_group"),"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z")}},{key:"_fetchGroups",value:(a=(0,c.A)((0,u.A)().m(function t(){return(0,u.A)().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,(0,A.pl)(this.hass);case 1:this._groups=t.v.sort(w.iV);case 2:return t.a(2)}},t,this)})),function(){return a.apply(this,arguments)})},{key:"_handleRowClicked",value:function(t){var e=t.detail.id;(0,y.o)("/config/zha/group/".concat(e))}}],[{key:"styles",get:function(){return[k.RF,(0,b.AH)(s||(s=(0,l.A)(["a{color:var(--primary-color)}"])))]}}]);var a}(b.WF);(0,m.Cg)([(0,v.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,m.Cg)([(0,v.MZ)({attribute:!1})],E.prototype,"route",void 0),(0,m.Cg)([(0,v.MZ)({type:Boolean})],E.prototype,"narrow",void 0),(0,m.Cg)([(0,v.MZ)({attribute:"is-wide",type:Boolean})],E.prototype,"isWide",void 0),(0,m.Cg)([(0,v.wk)()],E.prototype,"_groups",void 0),E=(0,m.Cg)([(0,v.EM)("zha-groups-dashboard")],E),n()}catch(N){n(N)}})}}]);
//# sourceMappingURL=21062.644cb350d0bd7fe6.js.map