/*! 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,a,c=t[0],o=t[1],r=0,l=[];rObject(i.useRequest)(a,{...e,path:o(e.path)})},function(e,t){e.exports=__kbnSharedDeps__.React},function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"p",(function(){return a})),n.d(t,"o",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"j",(function(){return s})),n.d(t,"m",(function(){return l})),n.d(t,"k",(function(){return d})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return f})),n.d(t,"l",(function(){return m})),n.d(t,"c",(function(){return p})),n.d(t,"e",(function(){return x})),n.d(t,"d",(function(){return y})),n.d(t,"g",(function(){return g})),n.d(t,"f",(function(){return b}));const i={hot:"100",warm:"50",cold:"0",frozen:"0"},a={max_age:"30d",max_primary_shard_size:"50gb"},c={name:"",phases:{hot:{actions:{rollover:a}}}},o="index_lifecycle_management",r="app_load",s="policy_create",l="policy_update",d="policy_delete",u="policy_attach_index",f="policy_attach_index_template",m="policy_detach_index",p="config_cold_phase",x="config_warm_phase",y="config_set_priority",g="index_retry_step",b="edit_click"},function(e,t,n){"use strict";let i,a;function c(e,t){i=e,a=t}n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var i=n(7);let a=(e,t)=>{};function c(e){e&&(a=e.reportUiCounter.bind(e,i.b))}function o(e){return[{metric:i.c,isTracked:()=>Boolean(e.cold)},{metric:i.e,isTracked:()=>Boolean(e.warm)},{metric:i.d,isTracked:()=>{const t=e.hot&&e.hot.actions.set_priority&&e.hot.actions.set_priority.priority!==parseInt(i.n.hot,10),n=e.warm&&e.warm.actions.set_priority&&e.warm.actions.set_priority.priority!==parseInt(i.n.warm,10),a=e.cold&&e.cold.actions.set_priority&&e.cold.actions.set_priority.priority!==parseInt(i.n.cold,10);return t||n||a}}].reduce(((e,{metric:t,isTracked:n})=>(n()&&e.push(t),e)),[])}},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t,n){"use strict";n.d(t,"j",(function(){return r})),n.d(t,"i",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"k",(function(){return u})),n.d(t,"g",(function(){return f})),n.d(t,"c",(function(){return m})),n.d(t,"f",(function(){return p})),n.d(t,"e",(function(){return x})),n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return g})),n.d(t,"l",(function(){return b})),n.d(t,"m",(function(){return h}));var i=n(14),a=n(7),c=n(9),o=n(5);const r=()=>Object(o.e)({path:"nodes/list",method:"get",initialData:{nodesByAttributes:{},nodesByRoles:{}}}),s=e=>Object(o.e)({path:`nodes/${e}/details`,method:"get"}),l=(e=!1)=>Object(o.e)({path:"templates",query:{legacy:e},method:"get",initialData:[]});async function d(){return await Object(o.c)("policies")}const u=()=>Object(o.e)({path:"policies",method:"get"});async function f(e){return await Object(o.d)("policies",e)}async function m(e){const t=await Object(o.b)(`policies/${encodeURIComponent(e)}`);return Object(c.c)(i.METRIC_TYPE.COUNT,a.k),t}const p=async e=>{const t=await Object(o.d)("index/retry",{indexNames:e});return Object(c.c)(i.METRIC_TYPE.COUNT,a.g),t},x=async e=>{const t=await Object(o.d)("index/remove",{indexNames:e});return Object(c.c)(i.METRIC_TYPE.COUNT,a.l),t},y=async e=>{const t=await Object(o.d)("index/add",e);return Object(c.c)(i.METRIC_TYPE.COUNT,a.h),t},g=async(e,t=!1)=>{const n=await Object(o.d)("template",e,{legacy:t});return Object(c.c)(i.METRIC_TYPE.COUNT,a.i),n},b=()=>Object(o.e)({path:"snapshot_policies",method:"get",initialData:[]}),h=()=>Object(o.e)({path:"snapshot_repositories",method:"get"})},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return c}));var i=n(2);const a=Object.freeze({warm:["data_warm","data_hot"],cold:["data_cold","data_warm","data_hot"],frozen:["data_frozen","data_cold","data_warm","data_hot"]}),c="enterprise",o={ID:"index_lifecycle_management",minimumLicenseType:"basic",TITLE:i.i18n.translate("xpack.indexLifecycleMgmt.appTitle",{defaultMessage:"Index Lifecycle Policies"})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return s}));var i=n(17);const a={list:"/policies",edit:"/policies/edit/:policyName?",create:"/policies/edit"},c=e=>encodeURI(`/policies/edit/${encodeURIComponent(e)}`),o=()=>a.create,r=()=>a.list,s=(e,t)=>t("management",{path:`/data/index_management${Object(i.getIndexListUri)(`ilm.policy="${e}"`,!0)}`})},function(e,t){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(8);function a(e,t){const n=function(e,t){if(e&&e.body){var n;const{error:i,statusCode:a,message:c,attributes:o}=e.body;return{title:t,text:`${a}: ${i}. ${null!=o&&null!==(n=o.causes)&&void 0!==n&&n.length?o.causes[o.causes.length-1]:c}`}}}(e,t);if(n)return i.c.addDanger(n);i.a.add(e,t)}},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/esUiShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/indexManagement/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t){e.exports=__kbnSharedDeps__.MomentTimezone},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){n(22),__kbnBundles__.define("plugin/indexLifecycleManagement/public",n,23)},function(e,t,n){n.p=window.__kbnPublicPath__.indexLifecycleManagement},function(e,t,n){"use strict";n.r(t),n.d(t,"plugin",(function(){return C})),n.d(t,"ILM_LOCATOR_ID",(function(){return S}));var i=n(4),a=n.n(i),c=n(18),o=n(2),r=n(12),s=n(5),l=n(9),d=n(8);const u=function(){const e=[{text:o.i18n.translate("xpack.indexLifecycleMgmt.breadcrumb.homeLabel",{defaultMessage:"Index Lifecycle Management"}),href:"/policies"}];return{policies:e,editPolicy:[...e,{text:o.i18n.translate("xpack.indexLifecycleMgmt.breadcrumb.editPolicyLabel",{defaultMessage:"Edit policy"}),href:void 0}]}}();class breadcrumbs_BreadcrumbService{constructor(){a()(this,"setBreadcrumbsHandler",void 0)}setup(e){this.setBreadcrumbsHandler=e}setBreadcrumbs(e){if(!this.setBreadcrumbsHandler)throw new Error("BreadcrumbService#setup() must be called first!");const t=u[e]?[...u[e]]:[...u.policies],n=t.pop();t.push({...n,href:void 0}),this.setBreadcrumbsHandler(t)}}var f=n(6),m=n.n(f),p=n(10),x=n(1),y=n(11),g=n(19),b=n.n(g),h=n(3),M=n(13),_=n(0);class index_lifecycle_summary_IndexLifecycleSummary extends f.Component{constructor(e){super(e),a()(this,"toggleStackPopover",(()=>{this.setState({showStackPopover:!this.state.showStackPopover})})),a()(this,"closeStackPopover",(()=>{this.setState({showStackPopover:!1})})),a()(this,"togglePhaseExecutionPopover",(()=>{this.setState({showPhaseExecutionPopover:!this.state.showPhaseExecutionPopover})})),a()(this,"closePhaseExecutionPopover",(()=>{this.setState({showPhaseExecutionPopover:!1})})),this.state={showStackPopover:!1,showPhaseExecutionPopover:!1}}renderPhaseExecutionPopoverButton(e){const t=Object(_.jsx)(x.EuiLink,{onClick:this.togglePhaseExecutionPopover},Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Show definition",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"}));return Object(_.jsx)(f.Fragment,{key:"phaseDefinition"},Object(_.jsx)(x.EuiDescriptionListTitle,{key:"phaseDefinition_title"},Object(_.jsx)("strong",null,Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Phase definition",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionDescriptionTitle"}))),Object(_.jsx)(x.EuiDescriptionListDescription,{key:"phaseDefinition_desc"},Object(_.jsx)(x.EuiPopover,{key:"phaseExecutionPopover",id:"phaseExecutionPopover",button:t,isOpen:this.state.showPhaseExecutionPopover,closePopover:this.closePhaseExecutionPopover},Object(_.jsx)(x.EuiPopoverTitle,null,Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Phase definition",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.phaseDefinitionTitle"})),Object(_.jsx)(x.EuiCodeBlock,{language:"json"},JSON.stringify(e.phase_execution,null,2)))))}buildRows(){const{index:{ilm:e}}=this.props,t=[["policy",o.i18n.translate("xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.lifecyclePolicyHeader",{defaultMessage:"Lifecycle policy"})],["phase",o.i18n.translate("xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentPhaseHeader",{defaultMessage:"Current phase"})],["action",o.i18n.translate("xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionHeader",{defaultMessage:"Current action"})],["action_time_millis",o.i18n.translate("xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionTimeHeader",{defaultMessage:"Current action time"})],["failed_step",o.i18n.translate("xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.failedStepHeader",{defaultMessage:"Failed step"})]],n={left:[],right:[]};return t.forEach((([t,i],a)=>{const c=e[t];let o;o="action_time_millis"===t?b()(c).format("YYYY-MM-DD HH:mm:ss"):"policy"===t?Object(_.jsx)(x.EuiLink,{href:this.props.getUrlForApp("management",{path:`data/index_lifecycle_management/${Object(M.e)(c)}`})},c):c,o=o||"-";const r=Object(_.jsx)(f.Fragment,{key:String(a)},Object(_.jsx)(x.EuiDescriptionListTitle,{key:t},Object(_.jsx)("strong",null,i)),Object(_.jsx)(x.EuiDescriptionListDescription,{key:t+"_desc"},o));a%2==0?n.left.push(r):n.right.push(r)})),e.phase_execution&&n.right.push(this.renderPhaseExecutionPopoverButton(e)),n}render(){const{index:{ilm:e}}=this.props;if(!e.managed)return null;const{left:t,right:n}=this.buildRows();return Object(_.jsx)(m.a.Fragment,null,Object(_.jsx)(x.EuiTitle,{size:"s"},Object(_.jsx)("h3",null,Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Index lifecycle management",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryTitle"}))),e.step_info&&e.step_info.type?Object(_.jsx)(m.a.Fragment,null,Object(_.jsx)(x.EuiSpacer,{size:"s"}),Object(_.jsx)(x.EuiCallOut,{color:"danger",title:Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Index lifecycle error",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"}),iconType:"cross"},e.step_info.type,": ",e.step_info.reason)):null,e.step_info&&e.step_info.message?Object(_.jsx)(m.a.Fragment,null,Object(_.jsx)(x.EuiSpacer,{size:"s"}),Object(_.jsx)(x.EuiCallOut,{color:"primary",title:Object(_.jsx)(h.FormattedMessage,{defaultMessage:"Action status",id:"xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.actionStatusTitle"})},e.step_info.message)):null,Object(_.jsx)(x.EuiSpacer,{size:"m"}),Object(_.jsx)(x.EuiFlexGroup,null,Object(_.jsx)(x.EuiFlexItem,null,Object(_.jsx)(x.EuiDescriptionList,{type:"column"},t)),Object(_.jsx)(x.EuiFlexItem,null,Object(_.jsx)(x.EuiDescriptionList,{type:"column"},n))))}}var j=n(15);class add_lifecycle_confirm_modal_AddLifecyclePolicyConfirmModal extends f.Component{constructor(e){super(e),a()(this,"addPolicy",(async()=>{const{indexName:e,closeModal:t,reloadIndices:n}=this.props,{selectedPolicyName:i,selectedAlias:a}=this.state;if(i)try{const c={indexName:e,policyName:i,alias:a};await Object(y.a)(c),t(),d.c.addSuccess(o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.addPolicyToIndexSuccess",{defaultMessage:"Added policy {policyName} to index {indexName}.",values:{policyName:i,indexName:e}})),n()}catch(e){Object(j.a)(e,o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.addPolicyToIndexError",{defaultMessage:"Error adding policy to index"}))}else this.setState({policyErrorMessage:o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.noPolicySelectedErrorMessage",{defaultMessage:"You must select a policy."})})})),a()(this,"renderAliasFormElement",(e=>{const{selectedAlias:t}=this.state,{index:n}=this.props;if(!e||!Object(p.get)(e,"policy.phases.hot.actions.rollover"))return null;const{aliases:i}=n;if("none"===i)return Object(_.jsx)(f.Fragment,null,Object(_.jsx)(x.EuiSpacer,{size:"m"}),Object(_.jsx)(x.EuiCallOut,{style:{maxWidth:400},title:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.indexHasNoAliasesWarningTitle",defaultMessage:"Index has no aliases"}),color:"warning"},Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.indexHasNoAliasesWarningMessage",defaultMessage:"Policy {policyName} is configured for rollover, but index {indexName} does not have an alias, which is required for rollover.",values:{policyName:null==e?void 0:e.name,indexName:n.name}})));const a=i.map((e=>({text:e,value:e})));return a.unshift({text:o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.chooseAliasMessage",{defaultMessage:"Choose an alias"}),value:""}),Object(_.jsx)(x.EuiFormRow,{label:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.chooseAliasLabel",defaultMessage:"Index rollover alias"})},Object(_.jsx)(x.EuiSelect,{options:a,value:t,onChange:e=>{this.setState({selectedAlias:e.target.value})}}))})),this.state={policies:[],selectedPolicyName:"",selectedAlias:""}}renderForm(){const{policies:e,selectedPolicyName:t,policyErrorMessage:n}=this.state,i=t?e.find((e=>e.name===t)):void 0,a=e.map((({name:e})=>({value:e,text:e})));return a.unshift({value:"",text:o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.choosePolicyMessage",{defaultMessage:"Select a lifecycle policy"})}),Object(_.jsx)(x.EuiForm,null,Object(_.jsx)(x.EuiFormRow,{isInvalid:!!n,error:n,label:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.choosePolicyLabel",defaultMessage:"Lifecycle policy"})},Object(_.jsx)(x.EuiSelect,{options:a,value:t,onChange:e=>{this.setState({policyErrorMessage:void 0,selectedPolicyName:e.target.value})}})),this.renderAliasFormElement(i))}async componentDidMount(){try{const e=await Object(y.d)();this.setState({policies:e})}catch(e){Object(j.a)(e,o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.loadPolicyError",{defaultMessage:"Error loading policy list"})),this.props.closeModal()}}render(){const{policies:e}=this.state,{indexName:t,closeModal:n,getUrlForApp:i}=this.props,a=Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.modalTitle",defaultMessage:'Add lifecycle policy to "{indexName}"',values:{indexName:t}});return e.length?Object(_.jsx)(x.EuiConfirmModal,{title:a,onCancel:n,onConfirm:this.addPolicy,cancelButtonText:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.cancelButtonText",defaultMessage:"Cancel"}),confirmButtonText:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.addPolicyButtonText",defaultMessage:"Add policy"})},this.renderForm()):Object(_.jsx)(x.EuiModal,{onClose:n},Object(_.jsx)(x.EuiModalHeader,null,Object(_.jsx)(x.EuiModalHeaderTitle,null,a)),Object(_.jsx)(x.EuiModalBody,null,Object(_.jsx)(x.EuiCallOut,{style:{maxWidth:400},title:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.noPoliciesWarningTitle",defaultMessage:"No index lifecycle policies defined"}),color:"warning"},Object(_.jsx)("p",null,Object(_.jsx)(x.EuiLink,{href:i("management",{path:"data/index_lifecycle_management/policies/edit"})},Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.defineLifecyclePolicyLinkText",defaultMessage:"Define lifecycle policy"}))))))}}class remove_lifecycle_confirm_modal_RemoveLifecyclePolicyConfirmModal extends f.Component{constructor(...e){super(...e),a()(this,"removePolicy",(async()=>{const{indexNames:e,closeModal:t,reloadIndices:n}=this.props;try{await Object(y.e)(e),t(),d.c.addSuccess(o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.removePolicySuccess",{defaultMessage:"Removed lifecycle policy from {count, plural, one {index} other {indices}}",values:{count:e.length}})),n()}catch(e){Object(j.a)(e,o.i18n.translate("xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.removePolicyToIndexError",{defaultMessage:"Error removing policy"}))}}))}render(){const{closeModal:e,indexNames:t}=this.props;return Object(_.jsx)(x.EuiConfirmModal,{title:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.modalTitle",defaultMessage:"Remove lifecycle policy from {count, plural, one {index} other {indices}}",values:{count:t.length}}),onCancel:e,onConfirm:this.removePolicy,cancelButtonText:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.cancelButtonText",defaultMessage:"Cancel"}),buttonColor:"danger",confirmButtonText:Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.removePolicyButtonText",defaultMessage:"Remove policy"})},Object(_.jsx)(f.Fragment,null,Object(_.jsx)("p",null,Object(_.jsx)(h.FormattedMessage,{id:"xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.removeMessage",defaultMessage:"You are about to remove the index lifecycle policy from {count, plural, one {this index} other {these indices}}. This operation cannot be undone.",values:{count:t.length}})),Object(_.jsx)("ul",null,t.map((e=>Object(_.jsx)("li",{key:e},e))))))}}const L="ilm.step",O=({indices:e})=>{if(!Object(p.every)(e,(e=>e.ilm&&e.ilm.failed_step)))return null;const t=e.map((({name:e})=>e));return{requestMethod:y.f,icon:"play",indexNames:[t],buttonLabel:o.i18n.translate("xpack.indexLifecycleMgmt.retryIndexLifecycleActionButtonLabel",{defaultMessage:"Retry lifecycle step"}),successMessage:o.i18n.translate("xpack.indexLifecycleMgmt.retryIndexLifecycleAction.retriedLifecycleMessage",{defaultMessage:"Called retry lifecycle step for: {indexNames}",values:{indexNames:t.map((e=>`"${e}"`)).join(", ")}})}},v=({indices:e,reloadIndices:t})=>{if(!Object(p.every)(e,(e=>e.ilm&&e.ilm.managed)))return null;const n=e.map((({name:e})=>e));return{renderConfirmModal:e=>Object(_.jsx)(remove_lifecycle_confirm_modal_RemoveLifecyclePolicyConfirmModal,{indexNames:n,closeModal:e,reloadIndices:t}),icon:"stopFilled",indexNames:[n],buttonLabel:o.i18n.translate("xpack.indexLifecycleMgmt.removeIndexLifecycleActionButtonLabel",{defaultMessage:"Remove lifecycle policy"})}},P=({indices:e,reloadIndices:t,getUrlForApp:n})=>{if(1!==e.length)return null;const i=e[0];if(i.ilm&&i.ilm.managed)return null;const a=i.name;return{renderConfirmModal:e=>Object(_.jsx)(add_lifecycle_confirm_modal_AddLifecyclePolicyConfirmModal,{indexName:a,closeModal:e,index:i,reloadIndices:t,getUrlForApp:n}),icon:"plusInCircle",buttonLabel:o.i18n.translate("xpack.indexLifecycleMgmt.addLifecyclePolicyActionButtonLabel",{defaultMessage:"Add lifecycle policy"})}},k=e=>{const{Query:t}=x.EuiSearchBar;if(!e.length)return null;const n=e.filter((e=>"ERROR"===Object(p.get)(e,L))).length;return n?{type:"warning",filter:t.parse(`${L}:ERROR`),filterLabel:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtBanner.filterLabel",{defaultMessage:"Show errors"}),title:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtBanner.errorMessage",{defaultMessage:"{ numIndicesWithLifecycleErrors, number}\n {numIndicesWithLifecycleErrors, plural, one {index has} other {indices have} }\n lifecycle errors",values:{numIndicesWithLifecycleErrors:n}})}:null},E=(e,t)=>Object(_.jsx)(index_lifecycle_summary_IndexLifecycleSummary,{index:e,getUrlForApp:t}),T=e=>Object(p.some)(e,(e=>e.ilm&&e.ilm.managed))?[{type:"field_value_selection",name:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.lifecycleStatusLabel",{defaultMessage:"Lifecycle status"}),multiSelect:!1,field:"ilm.managed",options:[{value:!0,view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.managedLabel",{defaultMessage:"Managed"})},{value:!1,view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.unmanagedLabel",{defaultMessage:"Unmanaged"})}]},{type:"field_value_selection",field:"ilm.phase",name:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.lifecyclePhaseLabel",{defaultMessage:"Lifecycle phase"}),multiSelect:"or",options:[{value:"hot",view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.hotLabel",{defaultMessage:"Hot"})},{value:"warm",view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.warmLabel",{defaultMessage:"Warm"})},{value:"frozen",view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.frozenLabel",{defaultMessage:"Frozen"})},{value:"cold",view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.coldLabel",{defaultMessage:"Cold"})},{value:"delete",view:o.i18n.translate("xpack.indexLifecycleMgmt.indexMgmtFilter.deleteLabel",{defaultMessage:"Delete"})}]}]:[],S="ILM_LOCATOR_ID";class locator_IlmLocatorDefinition{constructor(e){a()(this,"id",S),a()(this,"getLocation",(async e=>{const t=await this.deps.managementAppLocator.getLocation({sectionId:"data",appId:r.b.ID});switch(e.page){case"policy_create":return{...t,path:t.path+Object(M.d)()};case"policy_edit":return{...t,path:t.path+Object(M.e)(e.policyName)};case"policies_list":return{...t,path:t.path+Object(M.c)()}}})),this.deps=e}}class plugin_IndexLifecycleManagementPlugin{constructor(e){a()(this,"breadcrumbService",new breadcrumbs_BreadcrumbService),this.initializerContext=e}setup(e,t){const{ui:{enabled:i}}=this.initializerContext.config.get();if(i){const{http:i,notifications:{toasts:u},fatalErrors:f,getStartServices:m}=e,{usageCollection:p,management:x,indexManagement:y,home:g,cloud:b}=t;Object(s.a)(i),Object(l.b)(p),Object(d.b)(u,f),x.sections.section.data.registerApp({id:r.b.ID,title:r.b.TITLE,order:2,mount:async({element:e,history:t,setBreadcrumbs:i,theme$:a})=>{const[o,{licensing:s}]=await m(),{chrome:{docTitle:l},i18n:{Context:d},application:u,docLinks:f,executionContext:p}=o,x=await Object(c.firstValueFrom)(s.license$);l.change(r.b.TITLE),this.breadcrumbService.setup(i);const{renderApp:y}=await n.e(1).then(n.bind(null,84)),g=y(e,d,t,u,this.breadcrumbService,x,a,f,p,b);return()=>{l.reset(),g()}}}),g&&g.featureCatalogue.register({id:r.b.ID,title:o.i18n.translate("xpack.indexLifecycleMgmt.featureCatalogueTitle",{defaultMessage:"Manage index lifecycles"}),description:o.i18n.translate("xpack.indexLifecycleMgmt.featureCatalogueDescription",{defaultMessage:"Define lifecycle policies to automatically perform operations as an index ages."}),icon:"indexRollupApp",path:"/app/management/data/index_lifecycle_management",showOnHomePage:!0,category:"admin",order:640}),y&&((a=y.extensionsService).addAction(O),a.addAction(v),a.addAction(P),a.addBanner(k),a.addSummary(E),a.addFilter(T)),t.share.url.locators.create(new locator_IlmLocatorDefinition({managementAppLocator:t.management.locator}))}var a}start(){}stop(){}}const C=e=>new plugin_IndexLifecycleManagementPlugin(e)},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/esUiShared/static/forms/hook_form_lib");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t,n){n.r(t);var i=__kbnBundles__.get("plugin/esUiShared/static/forms/components");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.Moment},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("entry/core/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t){e.exports=__kbnSharedDeps__.Uuid}]);