"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["70876"],{32421:function(t,s,i){i.a(t,async function(t,e){try{i.r(s);i(3362);var a=i(40445),n=i(96196),r=i(77845),o=i(85404),h=i(65829),p=i(38962),d=i(69150),l=t([o,h,p]);[o,h,p]=l.then?(await l)():l;let c,_,u,y,f,b=t=>t;class g extends n.WF{willUpdate(t){if(super.willUpdate(t),!t.has("stateObj")||!this.stateObj)return;const s=t.get("stateObj");s&&s.entity_id===this.stateObj.entity_id||this._getPipeline()}async _getPipeline(){this._pipeline=void 0,this._errorLoadAssist=void 0;const t=this.stateObj.entity_id;try{const s=await(0,d.mp)(this.hass,t);this.stateObj&&t===this.stateObj.entity_id&&(this._pipeline=s)}catch(s){if(this.stateObj&&t!==this.stateObj.entity_id)return;"not_found"===s.code?this._errorLoadAssist="not_found":(this._errorLoadAssist="unknown",console.error(s))}}render(){return this.hass&&this.stateObj?(0,n.qy)(c||(c=b` ${0} `),this._errorLoadAssist?(0,n.qy)(_||(_=b`<ha-alert alert-type="error"> ${0} </ha-alert>`),this.hass.localize(`ui.dialogs.voice_command.${this._errorLoadAssist}_error_load_assist`)):this._pipeline?(0,n.qy)(u||(u=b` <ha-assist-chat .hass="${0}" .pipeline="${0}" disable-speech></ha-assist-chat> `),this.hass,this._pipeline):(0,n.qy)(y||(y=b`<div class="pipelines-loading"> <ha-spinner size="large"></ha-spinner> </div>`))):n.s6}}g.styles=(0,n.AH)(f||(f=b`:host{display:flex;flex:1}ha-assist-chat{flex:1;min-height:400px}`)),(0,a.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"stateObj",void 0),(0,a.Cg)([(0,r.wk)()],g.prototype,"_pipeline",void 0),(0,a.Cg)([(0,r.wk)()],g.prototype,"_errorLoadAssist",void 0),g=(0,a.Cg)([(0,r.EM)("more-info-conversation")],g),e()}catch(c){e(c)}})},72107:function(t,s,i){i(15823)("Int16",function(t){return function(s,i,e){return t(this,s,i,e)}})}}]);
//# sourceMappingURL=70876.ec36c9126bdbaf17.js.map