export const __webpack_id__="8611";export const __webpack_ids__=["8611"];export const __webpack_modules__={38542:function(e,t,r){r.a(e,async function(e,i){try{r.r(t),r.d(t,{FlowPreviewGeneric:()=>c});var s=r(69868),o=r(84922),_=r(11991),a=r(38534),d=r(99264),n=r(51849),p=r(44017),h=(r(94124),e([d]));d=(h.then?(await h)():h)[0];class c extends o.WF{disconnectedCallback(){super.disconnectedCallback(),this._unsub&&(this._unsub.then(e=>e()),this._unsub=void 0)}willUpdate(e){e.has("stepData")&&this._debouncedSubscribePreview()}render(){return this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.qy`<entity-preview-row .hass="${this.hass}" .stateObj="${this._preview}"></entity-preview-row>`}async _subscribePreview(){if(this._unsub&&((await this._unsub)(),this._unsub=void 0),"config_flow"===this.flowType||"options_flow"===this.flowType||"config_subentries_flow"===this.flowType){this._error=void 0;try{this._unsub=(0,a.Q)(this.hass,this.domain,this.flowId,this.flowType,this.stepData,this._setPreview),await this._unsub,(0,p.r)(this,"set-flow-errors",{errors:{}})}catch(e){"string"==typeof e.message?this._error=e.message:(this._error=void 0,(0,p.r)(this,"set-flow-errors",e.message)),this._unsub=void 0,this._preview=void 0}}}constructor(...e){super(...e),this._setPreview=e=>{if(e.error)return this._error=e.error,void(this._preview=void 0);const t=(new Date).toISOString();this._preview={entity_id:`${this.stepId}.___flow_preview___`,last_changed:t,last_updated:t,context:{id:"",parent_id:null,user_id:null},...e}},this._debouncedSubscribePreview=(0,n.s)(()=>{this._subscribePreview()},250)}}(0,s.__decorate)([(0,_.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,s.__decorate)([(0,_.MZ)({attribute:!1})],c.prototype,"flowType",void 0),(0,s.__decorate)([(0,_.MZ)()],c.prototype,"domain",void 0),(0,s.__decorate)([(0,_.MZ)({attribute:!1})],c.prototype,"stepId",void 0),(0,s.__decorate)([(0,_.MZ)({attribute:!1})],c.prototype,"flowId",void 0),(0,s.__decorate)([(0,_.MZ)({attribute:!1})],c.prototype,"stepData",void 0),(0,s.__decorate)([(0,_.wk)()],c.prototype,"_preview",void 0),(0,s.__decorate)([(0,_.wk)()],c.prototype,"_error",void 0),c=(0,s.__decorate)([(0,_.EM)("flow-preview-generic")],c),i()}catch(e){i(e)}})}};
//# sourceMappingURL=8611.48def62cfdb5cfa2.js.map