"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[66710],{59989:function(t,a,e){e.a(t,async function(t,n){try{e.r(a);var o,i=e(28430),c=e(97058),l=e(57567),s=e(25979),r=e(12463),u=e(40227),h=e(16472),d=(e(28706),e(62062),e(26099),e(15697)),_=e(57527),f=e(51209),v=e(90789),p=e(49588),m=e(148),g=e(55682),y=e(62672),b=e(58076),k=e(11071),A=e(26041),C=e(30013),q=e(13263),z=t([g,b]);[g,b]=z.then?(await z)():z;var H=["navigate","url","assist","perform-action","none"],V=(0,p.kp)(C.H,(0,p.Ik)({label:(0,p.lq)((0,p.Yj)()),description:(0,p.lq)((0,p.Yj)()),icon:(0,p.lq)((0,p.Yj)()),color:(0,p.lq)((0,p.Yj)()),vertical:(0,p.lq)((0,p.zM)()),tap_action:(0,p.lq)(A.kn),hold_action:(0,p.lq)(A.kn),double_tap_action:(0,p.lq)(A.kn)})),w=function(t){function a(){var t;(0,l.A)(this,a);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=(0,h.A)(this,a,[].concat(n)))._navInfo=new y.q((0,u.A)(t)),t._serviceInfo=new b.G((0,u.A)(t)),t._schema=(0,v.A)(function(t,a,e){return[{name:"tap_action",required:!0,selector:{ui_action:{actions:H}}},{name:"content",flatten:!0,type:"expandable",expanded:!0,iconPath:"M4,9H20V11H4V9M4,13H14V15H4V13Z",schema:[{name:"",type:"grid",schema:[{name:"label",selector:{text:{placeholder:a}}},{name:"description",selector:{text:{}}}]},{name:"",type:"grid",schema:[{name:"icon",selector:{icon:{placeholder:e||"mdi:link"}}},{name:"color",selector:{ui_color:{default_color:"primary"}}}]},{name:"content_layout",required:!0,selector:{select:{mode:"box",options:["horizontal","vertical"].map(function(a){return{label:t("ui.panel.lovelace.editor.card.tile.content_layout_options.".concat(a)),value:a,image:{src:"/static/images/form/tile_content_layout_".concat(a,".svg"),src_dark:"/static/images/form/tile_content_layout_".concat(a,"_dark.svg"),flip_rtl:!0}}})}}}]},{name:"additional_interactions",type:"expandable",flatten:!0,iconPath:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",schema:[{name:"hold_action",selector:{ui_action:{default_action:"none",actions:H}}},{name:"double_tap_action",selector:{ui_action:{default_action:"none",actions:H}}}]}]}),t._computeLabelCallback=function(a){switch(a.name){case"label":case"content_layout":case"additional_interactions":return t.hass.localize("ui.panel.lovelace.editor.card.shortcut.".concat(a.name));case"description":return t.hass.localize("ui.panel.lovelace.editor.card.shortcut.card_description");default:return t.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(a.name))}},t}return(0,r.A)(a,t),(0,s.A)(a,[{key:"setConfig",value:function(t){(0,p.vA)(t,V),this._config=t}},{key:"willUpdate",value:function(t){if((t.has("hass")||t.has("_config"))&&this.hass){var a,e=null===(a=this._config)||void 0===a?void 0:a.tap_action;this._navInfo.update(this.hass,"navigate"===(null==e?void 0:e.action)?e.navigation_path:void 0),this._serviceInfo.updateService("perform-action"===(null==e?void 0:e.action)||"call-service"===(null==e?void 0:e.action)?e.perform_action||e.service:void 0)}}},{key:"render",value:function(){if(!this.hass||!this._config)return _.s6;var t=(0,k.J)(this.hass,this._config.tap_action,this._navInfo.info,this._serviceInfo.info),a=(0,c.A)((0,c.A)({},this._config),{},{content_layout:this._config.vertical?"vertical":"horizontal"});return(0,_.qy)(o||(o=(0,i.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,a,this._schema(this.hass.localize,t.label,t.icon),this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(t){if(t.stopPropagation(),this._config&&this.hass){var a=(0,c.A)({},t.detail.value);a.content_layout&&(a.vertical="vertical"===a.content_layout,delete a.content_layout),(0,m.r)(this,"config-changed",{config:a})}}}])}(_.WF);w.styles=q.U,(0,d.Cg)([(0,f.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,d.Cg)([(0,f.wk)()],w.prototype,"_config",void 0),w=(0,d.Cg)([(0,f.EM)("hui-shortcut-card-editor")],w),e.d(a,{HuiShortcutCardEditor:function(){return w}}),n()}catch(I){n(I)}})},30013:function(t,a,e){var n=e(49588),o=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())});e.d(a,{H:function(){return o}})}}]);
//# sourceMappingURL=66710.ef131670eba06485.js.map