"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[26410],{1307:function(t,e,n){var i=n(81711);function a(t,e,n,i){if(!n||!n.action||"none"===n.action)return"";var a=i?t.localize("ui.panel.lovelace.cards.picture-elements.hold"):t.localize("ui.panel.lovelace.cards.picture-elements.tap");switch(n.action){case"navigate":a+=" ".concat(t.localize("ui.panel.lovelace.cards.picture-elements.navigate_to",{location:n.navigation_path}));break;case"url":a+=" ".concat(t.localize("ui.panel.lovelace.cards.picture-elements.url",{url_path:n.url_path}));break;case"toggle":a+=" ".concat(t.localize("ui.panel.lovelace.cards.picture-elements.toggle",{name:e}));break;case"call-service":a+="".concat(t.localize("ui.panel.lovelace.cards.picture-elements.perform_action",{name:n.service}));break;case"more-info":a+="".concat(t.localize("ui.panel.lovelace.cards.picture-elements.more_info",{name:e}))}return a}var o=function(t,e){if(null===e.title)return"";if(e.title)return e.title;var n="";if(e.entity&&(n=e.entity in t.states?(0,i.u)(t.states[e.entity]):e.entity),!e.tap_action&&!e.hold_action)return n;var o=e.tap_action?a(t,n,e.tap_action,!1):"",r=e.hold_action?a(t,n,e.hold_action,!0):"";return o+(o&&r?"\n":"")+r};n.d(e,{d:function(){return o}})},77561:function(t,e,n){n.a(t,async function(t,e){try{var i,a,o,r,c=n(61051),s=n(28430),l=n(57567),u=n(25979),h=n(12463),p=n(16472),d=(n(28706),n(23792),n(62062),n(18111),n(61701),n(26099),n(47764),n(62953),n(15697)),f=n(358),g=n(57527),v=n(51209),y=n(49938),b=n(67259),_=n(81711),m=n(18734),w=n(80189),A=n(1307),k=n(14936),x=n(42239),C=n(49511),E=(n(25695),n(8552),n(76730)),z=t([m]);m=(z.then?(await z)():z)[0];var M=function(t){function e(){var t;(0,l.A)(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(t=(0,p.A)(this,e,[].concat(i)))._entityStates={},t}return(0,h.A)(e,t),(0,u.A)(e,[{key:"render",value:function(){var t=this;return(0,g.qy)(i||(i=(0,s.A)([' <ha-chip-set class="ha-scrollbar"> '," </ha-chip-set> "])),(this.configEntities||[]).map(function(e){var n=t._entityStates[e.entity],i=e.show_name&&n||e.name&&!1!==e.show_name?e.name||(n?(0,_.u)(n):""):"";return(0,g.qy)(a||(a=(0,s.A)([" <ha-assist-chip filled @action="," .actionHandler="," .config=",' tabindex="0" .label=',"> "," </ha-assist-chip> "])),t._handleAction,(0,k.T)({hasHold:(0,C.h)(e.hold_action),hasDoubleClick:(0,C.h)(e.double_tap_action)}),e,i,!1!==e.show_icon?(0,g.qy)(o||(o=(0,s.A)([" <state-badge title="," .stateObj="," .overrideIcon="," .overrideImage="," .stateColor=",' slot="icon"></state-badge> '])),(0,A.d)(t.hass,e),n,e.icon,e.image,!0):"")}))}},{key:"_handleAction",value:function(t){(0,x.$)(this,this.hass,t.currentTarget.config,t.detail.action)}}],[{key:"styles",get:function(){return[E.dp,(0,g.AH)(r||(r=(0,s.A)([".ha-scrollbar{padding:12px;padding-top:var(--padding-top,8px);padding-bottom:var(--padding-bottom,8px);white-space:nowrap;box-sizing:border-box;flex-wrap:wrap;width:100%;display:flex;overflow:auto hidden}state-badge{line-height:inherit;color:var(--secondary-text-color);justify-content:center;align-items:center;display:inline-flex}@media (width<=450px),(height<=500px){.ha-scrollbar{flex-wrap:nowrap}}"])))]}}])}(g.WF);(0,d.Cg)([(0,v.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,d.Cg)([(0,v.MZ)({attribute:!1})],M.prototype,"configEntities",void 0),(0,d.Cg)([(0,v.wk)(),(0,f.Fg)({context:w.iN,subscribe:!0}),(0,b.p)({transformer:function(t){var e={};if(t){var n,i=(0,c.A)(this.configEntities||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a.entity]=t[a.entity]}}catch(o){i.e(o)}finally{i.f()}}return(0,y.gu)(this._entityStates,e)},watch:["configEntities"]})],M.prototype,"_entityStates",void 0),M=(0,d.Cg)([(0,v.EM)("hui-buttons-base")],M),e()}catch(S){e(S)}})},29105:function(t,e,n){n.a(t,async function(t,i){try{n.r(e);var a,o=n(28430),r=n(97058),c=n(57567),s=n(25979),l=n(12463),u=n(16472),h=(n(62062),n(18111),n(61701),n(26099),n(15697)),p=n(57527),d=n(51209),f=n(3899),g=n(45602),v=n(13010),y=n(77561),b=t([y]);y=(b.then?(await b)():b)[0];var _=function(t){function e(){return(0,c.A)(this,e),(0,u.A)(this,e,arguments)}return(0,l.A)(e,t),(0,s.A)(e,[{key:"setConfig",value:function(t){this._configEntities=(0,v.L)(t.entities).map(function(t){return(0,r.A)({tap_action:{action:t.entity&&f.FD.has((0,g.m)(t.entity))?"toggle":"more-info"},hold_action:{action:"more-info"}},t)})}},{key:"render",value:function(){return(0,p.qy)(a||(a=(0,o.A)([" <hui-buttons-base .hass="," .configEntities=","></hui-buttons-base> "])),this.hass,this._configEntities)}}],[{key:"getStubConfig",value:function(){return{entities:[]}}}])}(p.WF);(0,h.Cg)([(0,d.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,h.Cg)([(0,d.wk)()],_.prototype,"_configEntities",void 0),_=(0,h.Cg)([(0,d.EM)("hui-buttons-row")],_),n.d(e,{HuiButtonsRow:function(){return _}}),i()}catch(m){i(m)}})}}]);
//# sourceMappingURL=26410.edc48f3ff12a4069.js.map