/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.ml_bundle_jsonpfunction=window.ml_bundle_jsonpfunction||[]).push([[21],{167:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n(2);var s=n(28),i=n(4);const a=()=>Object(i.jsx)(s.EuiText,{textAlign:"center"},Object(i.jsx)(s.EuiSpacer,{size:"l"}),Object(i.jsx)(s.EuiLoadingSpinner,{size:"l"}),Object(i.jsx)(s.EuiSpacer,{size:"l"}))},168:function(e,t,n){"use strict";n.d(t,"a",(function(){return AnomalyDetectionEmbeddable}));var s=n(5),i=n.n(s),a=n(72),r=n(10);class AnomalyDetectionEmbeddable extends a.Embeddable{constructor(e,t,n,s){super(e,{defaultTitle:e.title,defaultDescription:e.description},s),i()(this,"deferEmbeddableLoad",!0),this.anomalyDetectorService=t,this.dataViewsService=n,this.initializeOutput(e).finally((()=>{this.setInitializationFinished()}))}async initializeOutput(e){const{jobIds:t}=e;try{const e=await Object(r.firstValueFrom)(this.anomalyDetectorService.getJobs$(t)),n=new Set(e.map((e=>e.datafeed_config.indices)).flat()),s={};for(const e of n){const t=(await this.dataViewsService.find(`"${e}"`)).find((t=>t.getIndexPattern().toLowerCase().includes(e.toLowerCase())));void 0!==t&&(s[t.id]=t)}this.updateOutput({...this.getOutput(),indexPatterns:Object.values(s)})}catch(e){console.error(`Unable to load data views for ${t}`,e)}}}},274:function(e,t,n){"use strict";n.r(t),n.d(t,"getDefaultExplorerChartsPanelTitle",(function(){return f})),n.d(t,"AnomalyChartsEmbeddable",(function(){return anomaly_charts_embeddable_AnomalyChartsEmbeddable}));var s=n(5),i=n.n(s),a=n(2),r=n.n(a),o=n(71),d=n.n(o),l=n(6),c=n(10),u=n(21);const h=r.a.lazy((()=>Promise.all([n.e(1),n.e(15)]).then(n.bind(null,682))));var b=n(123),p=n(167),m=n(168),j=n(4);const f=e=>l.i18n.translate("xpack.ml.anomalyChartsEmbeddable.title",{defaultMessage:"ML anomaly charts for {jobIds}",values:{jobIds:e.join(", ")}});class anomaly_charts_embeddable_AnomalyChartsEmbeddable extends m.a{constructor(e,t,n){super(e,t[2].anomalyDetectorService,t[1].data.dataViews,n),i()(this,"node",void 0),i()(this,"reload$",new c.Subject),i()(this,"type",b.a),this.services=t}onLoading(){this.renderComplete.dispatchInProgress(),this.updateOutput({loading:!0,error:void 0})}onError(e){this.renderComplete.dispatchError(),this.updateOutput({loading:!1,error:{name:e.name,message:e.message}})}onRenderComplete(){this.renderComplete.dispatchComplete(),this.updateOutput({loading:!1,error:void 0})}render(e){super.render(e),this.node=e,this.node.setAttribute("data-shared-item","");const t=this.services[0].i18n.Context,n=this.services[0].theme.theme$;d.a.render(Object(j.jsx)(t,null,Object(j.jsx)(u.KibanaThemeProvider,{theme$:n},Object(j.jsx)(u.KibanaContextProvider,{services:{...this.services[0]}},Object(j.jsx)(a.Suspense,{fallback:Object(j.jsx)(p.a,null)},Object(j.jsx)(h,{id:this.input.id,embeddableContext:this,embeddableInput:this.getInput$(),services:this.services,refresh:this.reload$.asObservable(),onInputChange:this.updateInput.bind(this),onOutputChange:this.updateOutput.bind(this),onRenderComplete:this.onRenderComplete.bind(this),onLoading:this.onLoading.bind(this),onError:this.onError.bind(this)}))))),e)}destroy(){super.destroy(),this.node&&d.a.unmountComponentAtNode(this.node)}reload(){this.reload$.next()}supportedTriggers(){return[]}}}}]);