"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[25053],{37342:function(t,i,e){e.a(t,async function(t,s){try{e.r(i);var n,a,r,o,h,p=e(28430),c=e(36854),l=e(98117),u=e(57567),d=e(25979),_=e(12463),f=e(16472),y=e(92297),v=(e(26099),e(3362),e(15697)),A=e(358),b=e(57527),g=e(51209),k=e(49938),j=e(80189),O=e(18279),w=e(15466),m=e(88457),C=e(75763),L=t([O,w,m]);[O,w,m]=L.then?(await L)():L;var x=function(t){function i(){return(0,u.A)(this,i),(0,f.A)(this,i,arguments)}return(0,_.A)(i,t),(0,d.A)(i,[{key:"willUpdate",value:function(t){if((0,y.A)(i,"willUpdate",this,3)([t]),t.has("stateObj")&&this.stateObj){var e=t.get("stateObj");e&&e.entity_id===this.stateObj.entity_id||this._getPipeline()}}},{key:"_getPipeline",value:(e=(0,l.A)((0,c.A)().m(function t(){var i,e,s;return(0,c.A)().w(function(t){for(;;)switch(t.p=t.n){case 0:return this._pipeline=void 0,this._errorLoadAssist=void 0,i=this.stateObj.entity_id,t.p=1,t.n=2,(0,C.mp)(this._api,i);case 2:e=t.v,this.stateObj&&i===this.stateObj.entity_id&&(this._pipeline=e),t.n=5;break;case 3:if(t.p=3,s=t.v,!this.stateObj||i===this.stateObj.entity_id){t.n=4;break}return t.a(2);case 4:"not_found"===s.code?this._errorLoadAssist="not_found":(this._errorLoadAssist="unknown",console.error(s));case 5:return t.a(2)}},t,this,[[1,3]])})),function(){return e.apply(this,arguments)})},{key:"render",value:function(){return this._localize&&this.stateObj?(0,b.qy)(n||(n=(0,p.A)([" "," "])),this._errorLoadAssist?(0,b.qy)(a||(a=(0,p.A)(['<ha-alert alert-type="error"> '," </ha-alert>"])),this._localize("ui.dialogs.voice_command.".concat(this._errorLoadAssist,"_error_load_assist"))):this._pipeline?(0,b.qy)(r||(r=(0,p.A)([" <ha-assist-chat .pipeline="," disable-speech></ha-assist-chat> "])),this._pipeline):(0,b.qy)(o||(o=(0,p.A)(['<div class="pipelines-loading"> <ha-spinner size="large"></ha-spinner> </div>'])))):b.s6}}]);var e}(b.WF);x.styles=(0,b.AH)(h||(h=(0,p.A)([":host{flex:1;display:flex}ha-assist-chat{flex:1;min-height:400px}"]))),(0,v.Cg)([(0,g.MZ)({attribute:!1})],x.prototype,"stateObj",void 0),(0,v.Cg)([(0,g.wk)()],x.prototype,"_pipeline",void 0),(0,v.Cg)([(0,g.wk)()],x.prototype,"_errorLoadAssist",void 0),(0,v.Cg)([(0,g.wk)(),(0,k.IW)()],x.prototype,"_localize",void 0),(0,v.Cg)([(0,g.wk)(),(0,A.Fg)({context:j.Ie,subscribe:!0})],x.prototype,"_api",void 0),x=(0,v.Cg)([(0,g.EM)("more-info-conversation")],x),s()}catch(q){s(q)}})},72107:function(t,i,e){e(15823)("Int16",function(t){return function(i,e,s){return t(this,i,e,s)}})}}]);
//# sourceMappingURL=25053.941c802e6e8f41d1.js.map