"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["8550"],{71154:function(t,i,n){n.a(t,async function(t,s){try{n.r(i),n.d(i,{HuiUpdatesCard:function(){return C}});n(49255),n(18111),n(22489),n(3362),n(62953);var a=n(40445),o=n(96196),e=n(77845),h=n(1087),c=n(91926),l=(n(76776),n(22573),n(80933),n(32248),n(24247)),r=n(37544),d=n(97176),u=n(51989),_=t([l]);l=(_.then?(await _)():_)[0];let g,p,f=t=>t;const v="M20.54,5.23C20.83,5.57 21,6 21,6.5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V6.5C3,6 3.17,5.57 3.46,5.23L4.84,3.55C5.12,3.21 5.53,3 6,3H18C18.47,3 18.88,3.21 19.15,3.55L20.54,5.23M5.12,5H18.87L17.93,4H5.93L5.12,5M12,9.5L6.5,15H10V17H14V15H17.5L12,9.5Z";class C extends o.WF{setConfig(t){this._config=t}getCardSize(){var t;return null!==(t=this._config)&&void 0!==t&&t.vertical?2:1}getGridOptions(){var t;let i=6,n=1;return null!==(t=this._config)&&void 0!==t&&t.vertical&&(n++,i=3),{columns:6,rows:n,min_columns:i,min_rows:n}}_getUpdateEntities(){return this.hass?(0,l.ZS)(this.hass.states,this.hass.locale.language).filter(t=>(0,l.VK)(t,!1)):[]}async _handleAction(t){var i;"tap"!==t.detail.action||(0,d.h)(null===(i=this._config)||void 0===i?void 0:i.tap_action)?(0,r.$)(this,this.hass,this._config,t.detail.action):(0,c.o)("/config/updates")}get _hasCardAction(){var t,i,n,s;return!(null!==(t=this._config)&&void 0!==t&&t.tap_action)||(0,d.h)(null===(i=this._config)||void 0===i?void 0:i.tap_action)||(0,d.h)(null===(n=this._config)||void 0===n?void 0:n.hold_action)||(0,d.h)(null===(s=this._config)||void 0===s?void 0:s.double_tap_action)}willUpdate(t){var i;if(super.willUpdate(t),!this._config||!this.hass)return;const n=this._getUpdateEntities(),s=Boolean(!(null!==(i=this.hass.user)&&void 0!==i&&i.is_admin)||this._config.hide_empty&&0===n.length);s!==this.hidden&&(this.style.display=s?"none":"",this.toggleAttribute("hidden",s),(0,h.r)(this,"card-visibility-changed",{value:!s}))}render(){if(!this._config||!this.hass)return o.s6;const t=this._getUpdateEntities().length,i=this.hass.localize("ui.card.updates.title"),n=t>0?this.hass.localize("ui.card.updates.count_updates",{count:t}):this.hass.localize("ui.card.updates.no_updates");return(0,o.qy)(g||(g=f` <ha-card> <ha-tile-container .vertical="${0}" .interactive="${0}" .actionHandlerOptions="${0}" @action="${0}"> <ha-tile-icon slot="icon" .iconPath="${0}"></ha-tile-icon> <ha-tile-info slot="info" .primary="${0}" .secondary="${0}"></ha-tile-info> </ha-tile-container> </ha-card> `),Boolean(this._config.vertical),this._hasCardAction,{hasHold:(0,d.h)(this._config.hold_action),hasDoubleClick:(0,d.h)(this._config.double_tap_action)},this._handleAction,v,i,n)}constructor(...t){super(...t),this.connectedWhileHidden=!0}}C.styles=[u.c,(0,o.AH)(p||(p=f`:host{--tile-color:var(--info-color)}`))],(0,a.Cg)([(0,e.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,e.wk)()],C.prototype,"_config",void 0),C=(0,a.Cg)([(0,e.EM)("hui-updates-card")],C),s()}catch(g){s(g)}})}}]);
//# sourceMappingURL=8550.e7b66bb9c3e1fee6.js.map