/*! 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([[22],{167:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n(2);var i=n(28),s=n(4);const a=()=>Object(s.jsx)(i.EuiText,{textAlign:"center"},Object(s.jsx)(i.EuiSpacer,{size:"l"}),Object(s.jsx)(i.EuiLoadingSpinner,{size:"l"}),Object(s.jsx)(i.EuiSpacer,{size:"l"}))},168:function(e,t,n){"use strict";n.d(t,"a",(function(){return AnomalyDetectionEmbeddable}));var i=n(5),s=n.n(i),a=n(72),o=n(10);class AnomalyDetectionEmbeddable extends a.Embeddable{constructor(e,t,n,i){super(e,{defaultTitle:e.title,defaultDescription:e.description},i),s()(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(o.firstValueFrom)(this.anomalyDetectorService.getJobs$(t)),n=new Set(e.map((e=>e.datafeed_config.indices)).flat()),i={};for(const e of n){const t=(await this.dataViewsService.find(`"${e}"`)).find((t=>t.getIndexPattern().toLowerCase().includes(e.toLowerCase())));void 0!==t&&(i[t.id]=t)}this.updateOutput({...this.getOutput(),indexPatterns:Object.values(i)})}catch(e){console.error(`Unable to load data views for ${t}`,e)}}}},272:function(e,t,n){"use strict";n.r(t),n.d(t,"getDefaultSwimlanePanelTitle",(function(){return v})),n.d(t,"AnomalySwimlaneEmbeddable",(function(){return anomaly_swimlane_embeddable_AnomalySwimlaneEmbeddable}));var i=n(5),s=n.n(i),a=n(2),o=n.n(a),r=n(71),d=n.n(r),l=n(6),u=n(10),c=n(21);const b=o.a.lazy((()=>n.e(16).then(n.bind(null,685))));var h=n(187),m=n(123),p=n(167),j=n(168),f=n(4);const v=e=>l.i18n.translate("xpack.ml.swimlaneEmbeddable.title",{defaultMessage:"ML anomaly swim lane for {jobIds}",values:{jobIds:e.join(", ")}});class anomaly_swimlane_embeddable_AnomalySwimlaneEmbeddable extends j.a{constructor(e,t,n){super(e,t[2].anomalyDetectorService,t[1].data.dataViews,n),s()(this,"node",void 0),s()(this,"reload$",new u.Subject),s()(this,"type",m.b),this.services=t}reportsEmbeddableLoad(){return!0}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(f.jsx)(t,null,Object(f.jsx)(c.KibanaThemeProvider,{theme$:n},Object(f.jsx)(c.KibanaContextProvider,{services:{...this.services[0]}},Object(f.jsx)(a.Suspense,{fallback:Object(f.jsx)(p.a,null)},Object(f.jsx)(b,{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[h.a]}}}}]);