/*! 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. */!function(e){function t(t){for(var n,r,s=t[0],o=t[1],c=0,u=[];c`${i}edit/${t?encodeURIComponent(e):e}`,o=()=>`${i}${r}`,c=(e,t=!0)=>`${i}${r}/${t?encodeURIComponent(e):e}`,a=e=>`${i}${e?`?pipeline=${encodeURIComponent(e)}`:""}`,u=()=>`${i}csv_create`,l={list:a(),edit:s(":name",!1),create:o(),clone:c(":sourceName",!1),createFromCsv:u()},d=({inspectedPipelineName:e}={})=>a(e),p=({pipelineName:e})=>s(e,!0),f=()=>o(),h=({clonedPipelineName:e})=>c(e,!0),g=()=>u()},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return g}));var i=n(0),r=n.n(i);const s=new class documentation_DocumentationService{constructor(){r()(this,"esDocBasePath",""),r()(this,"ingestNodeUrl",""),r()(this,"processorsUrl",""),r()(this,"handlingFailureUrl",""),r()(this,"createPipelineUrl",""),r()(this,"createPipelineCSVUrl",""),r()(this,"simulatePipelineApiUrl",""),r()(this,"enrichDataUrl",""),r()(this,"geoMatchUrl",""),r()(this,"dissectKeyModifiersUrl",""),r()(this,"classificationUrl",""),r()(this,"regressionUrl",""),r()(this,"documentationUrl","")}setup(e){const{DOC_LINK_VERSION:t,ELASTIC_WEBSITE_URL:n,links:i}=e,r=`${n}guide/en`;this.esDocBasePath=`${r}/elasticsearch/reference/${t}`,this.ingestNodeUrl=i.ingest.pipelines,this.processorsUrl=i.ingest.processors,this.handlingFailureUrl=i.ingest.pipelineFailure,this.createPipelineUrl=i.ingest.pipelines,this.createPipelineCSVUrl=i.ingest.csvPipelines,this.simulatePipelineApiUrl=i.apis.simulatePipeline,this.enrichDataUrl=i.ingest.enrich,this.geoMatchUrl=i.ingest.geoMatch,this.dissectKeyModifiersUrl=i.ingest.dissectKeyModifiers,this.classificationUrl=i.ingest.inferenceClassification,this.regressionUrl=i.ingest.inferenceRegression,this.documentationUrl=i.ingest.inference}getEsDocsBasePath(){return this.esDocBasePath}getIngestNodeUrl(){return this.ingestNodeUrl}getProcessorsUrl(){return this.processorsUrl}getHandlingFailureUrl(){return this.handlingFailureUrl}getCreatePipelineUrl(){return this.createPipelineUrl}getCreatePipelineCSVUrl(){return this.createPipelineCSVUrl}getSimulatePipelineApiUrl(){return this.simulatePipelineApiUrl}getEnrichDataUrl(){return this.enrichDataUrl}getGeoMatchUrl(){return this.geoMatchUrl}getDissectKeyModifiersUrl(){return this.dissectKeyModifiersUrl}getClassificationUrl(){return this.classificationUrl}getRegressionUrl(){return this.regressionUrl}getDocumentationUrl(){return this.documentationUrl}};var o=n(13),c=n(5);const a=new class ui_metric_UiMetricService{constructor(){r()(this,"usageCollection",void 0)}setup(e){this.usageCollection=e}track(e){if(!this.usageCollection)return;const{reportUiCounter:t}=this.usageCollection;t(c.a,o.METRIC_TYPE.COUNT,e)}trackUiMetric(e){return this.track(e)}};var u=n(2),l=n(10);const d=new class api_ApiService{constructor(){r()(this,"client",void 0),r()(this,"uiMetricService",void 0)}useRequest(e){if(!this.client)throw new Error("Api service has not be initialized.");return Object(l.I)(this.client,e)}sendRequest(e){if(!this.client)throw new Error("Api service has not be initialized.");return Object(l.C)(this.client,e)}trackUiMetric(e){if(!this.uiMetricService)throw new Error("UI metric service has not be initialized.");return this.uiMetricService.trackUiMetric(e)}setup(e,t){this.client=e,this.uiMetricService=t}useLoadPipelines(){return this.useRequest({path:u.a,method:"get"})}useLoadPipeline(e){return this.useRequest({path:`${u.a}/${encodeURIComponent(e)}`,method:"get"})}async createPipeline(e){const t=await this.sendRequest({path:u.a,method:"post",body:JSON.stringify(e)});return this.trackUiMetric(c.c),t}async updatePipeline(e){const{name:t,...n}=e,i=await this.sendRequest({path:`${u.a}/${encodeURIComponent(t)}`,method:"put",body:JSON.stringify(n)});return this.trackUiMetric(c.g),i}async deletePipelines(e){const t=this.sendRequest({path:`${u.a}/${e.map((e=>encodeURIComponent(e))).join(",")}`,method:"delete"});return this.trackUiMetric(e.length>1?c.e:c.d),t}async simulatePipeline(e){const t=await this.sendRequest({path:`${u.a}/simulate`,method:"post",body:JSON.stringify(e)});return this.trackUiMetric(c.f),t}async loadDocument(e,t){return await this.sendRequest({path:`${u.a}/documents/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,method:"get"})}async parseCsv(e){return await this.sendRequest({path:`${u.a}/parse_csv`,method:"post",body:JSON.stringify(e)})}};var p=n(7);const f=p.i18n.translate("xpack.ingestPipelines.breadcrumb.pipelinesLabel",{defaultMessage:"Ingest Pipelines"}),h=new class breadcrumbs_BreadcrumbService{constructor(){r()(this,"breadcrumbs",{home:[{text:f}],create:[{text:f,href:"/"},{text:p.i18n.translate("xpack.ingestPipelines.breadcrumb.createPipelineLabel",{defaultMessage:"Create pipeline"})}],edit:[{text:f,href:"/"},{text:p.i18n.translate("xpack.ingestPipelines.breadcrumb.editPipelineLabel",{defaultMessage:"Edit pipeline"})}]}),r()(this,"setBreadcrumbsHandler",void 0)}setup(e){this.setBreadcrumbsHandler=e}setBreadcrumbs(e){if(!this.setBreadcrumbsHandler)throw new Error("Breadcrumb service has not been initialized");const t=this.breadcrumbs[e]?[...this.breadcrumbs[e]]:[...this.breadcrumbs.home];this.setBreadcrumbsHandler(t)}},g=new class FileReaderService{readFile(e,t){return new Promise(((n,i)=>{if(e&&e.size){const r=new FileReader;r.readAsArrayBuffer(e),r.onload=()=>{const e=new TextDecoder,s=r.result;if(null===s||"string"==typeof s)return i();const o=e.decode(s.slice(0,t));""===o?i():n(o)}}else i()}))}}},function(e,t,n){"use strict";n.d(t,"H",(function(){return a}));var i=n(6);n.d(t,"b",(function(){return i.CodeEditor}));var r=n(1);n.d(t,"a",(function(){return r.AuthorizationProvider})),n.d(t,"m",(function(){return r.SectionError})),n.d(t,"n",(function(){return r.SectionLoading})),n.d(t,"C",(function(){return r.sendRequest})),n.d(t,"D",(function(){return r.useAuthorizationContext})),n.d(t,"I",(function(){return r.useRequest})),n.d(t,"u",(function(){return r.WithPrivileges})),n.d(t,"v",(function(){return r.XJson})),n.d(t,"h",(function(){return r.JsonEditor})),n.d(t,"w",(function(){return r.attemptToURIDecode})),n.d(t,"t",(function(){return r.ViewApiRequestFlyout}));var s=n(3);n.d(t,"d",(function(){return s.FIELD_TYPES})),n.d(t,"E",(function(){return s.useForm})),n.d(t,"f",(function(){return s.Form})),n.d(t,"B",(function(){return s.getUseField})),n.d(t,"s",(function(){return s.UseField})),n.d(t,"r",(function(){return s.UseArray})),n.d(t,"F",(function(){return s.useFormContext})),n.d(t,"g",(function(){return s.FormDataProvider})),n.d(t,"z",(function(){return s.getFieldValidityAndErrorMessage})),n.d(t,"G",(function(){return s.useFormData}));var o=n(11);n.d(t,"x",(function(){return o.fieldFormatters})),n.d(t,"y",(function(){return o.fieldValidators}));var c=n(4);n.d(t,"A",(function(){return c.getFormRow})),n.d(t,"e",(function(){return c.Field})),n.d(t,"i",(function(){return c.JsonEditorField})),n.d(t,"q",(function(){return c.ToggleField})),n.d(t,"c",(function(){return c.ComboBoxField})),n.d(t,"l",(function(){return c.NumericField})),n.d(t,"o",(function(){return c.SelectField})),n.d(t,"p",(function(){return c.TextField})),n(12),n.d(t,"j",(function(){return i.KibanaContextProvider})),n.d(t,"k",(function(){return i.KibanaThemeProvider}));const a=()=>Object(i.useKibana)()},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/esUiShared/static/forms/helpers");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/esUiShared/static/validators/string");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){n(16),__kbnBundles__.define("plugin/ingestPipelines/public",n,17)},function(e,t,n){n.p=window.__kbnPublicPath__.ingestPipelines},function(e,t,n){"use strict";n.r(t),n.d(t,"plugin",(function(){return l}));var i=n(0),r=n.n(i),s=n(7),o=n(2),c=n(9),a=n(8);let u;!function(e){e.LIST="pipelines_list",e.EDIT="pipeline_edit",e.CREATE="pipeline_create",e.CLONE="pipeline_clone"}(u||(u={}));class locator_IngestPipelinesLocatorDefinition{constructor(e){r()(this,"id","INGEST_PIPELINES_APP_LOCATOR"),r()(this,"getLocation",(async e=>{const t=await this.deps.managementAppLocator.getLocation({sectionId:"ingest",appId:o.c});let n="";switch(e.page){case u.EDIT:n=Object(a.e)({pipelineName:e.pipelineId});break;case u.CREATE:n=Object(a.d)();break;case u.LIST:n=Object(a.f)({inspectedPipelineName:e.pipelineId});break;case u.CLONE:n=Object(a.b)({clonedPipelineName:e.pipelineId})}return{...t,path:"/"===n?t.path:t.path+n}})),this.deps=e}}class plugin_IngestPipelinesPlugin{constructor(){r()(this,"license",null),r()(this,"licensingSubscription",void 0)}setup(e,t){const{management:i,usageCollection:r,share:a}=t,{http:u,getStartServices:l}=e;c.e.setup(r),c.a.setup(u,c.e);const d=s.i18n.translate("xpack.ingestPipelines.appTitle",{defaultMessage:"Ingest Pipelines"});i.sections.section.ingest.registerApp({id:o.c,order:1,title:d,mount:async t=>{const[i]=await l(),{chrome:{docTitle:r}}=i;r.change(d);const{mountManagementSection:s}=await n.e(1).then(n.bind(null,147)),o=await s(e,{...t,license:this.license});return()=>{r.reset(),o()}}}),a.url.locators.create(new locator_IngestPipelinesLocatorDefinition({managementAppLocator:i.locator}))}start(e,{licensing:t}){this.licensingSubscription=null==t?void 0:t.license$.subscribe((e=>{this.license=e}))}stop(){var e;null===(e=this.licensingSubscription)||void 0===e||e.unsubscribe()}}function l(){return new plugin_IngestPipelinesPlugin}},function(e,t){e.exports=__kbnSharedDeps__.React},function(e,t){e.exports=__kbnSharedDeps__.EmotionReact},function(e,t){e.exports=__kbnSharedDeps__.ElasticEui},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.Uuid},function(e,t){e.exports=__kbnSharedDeps__.KbnMonaco},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t){e.exports=__kbnSharedDeps__.IoTs}]);