!function(e){function t(t){for(var n,o,i=t[0],a=t[1],s=0,d=[];s{let n,r=[];try{r=t.map((t=>({input:t,output:e(t)})))}catch(e){n=i.i18n.translate("indexPatternFieldEditor.defaultErrorMessage",{defaultMessage:"An error occurred while trying to use this format configuration: {message}",values:{message:e.message}})}return{error:n,samples:r}},c={sampleInputs:[],sampleConverterType:"text",error:void 0,samples:[],sampleInputsByType:{}};class DefaultFormatEditor extends a.PureComponent{constructor(...e){super(...e),o()(this,"state",c),o()(this,"onChange",((e={})=>{const{onChange:t,formatParams:n}=this.props;t({...n,...e})}))}static getDerivedStateFromProps(e,t){const{format:n,formatParams:r,onError:o}=e,{sampleInputsByType:i,sampleInputs:a,sampleConverterType:s}=t,l=n.getConverterFor(s),d="object"==typeof i&&r.type?i[r.type]||[]:a,c=u(l,d);return o(c.error),c}render(){return Object(d.jsx)(s.a.Fragment,null)}}o()(DefaultFormatEditor,"formatId",l.a)},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));const r="index_pattern_field_editor",o="indexPatternFieldEditorFlyout"},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/components");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="default"},function(e,t){e.exports=__kbnSharedDeps__.EmotionCache},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/data/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){e.exports=n(16)(1466)},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t,n){"use strict";var r=n(12),o=n(7);n.d(t,"a",(function(){return o.defaultState})),r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="number"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41),o=n(1),i=r.__importDefault(n(44));t.default=function(e,t){var n=o.useState(t),r=n[0],a=n[1];return i.default((function(){var t=e.subscribe(a);return function(){return t.unsubscribe()}}),[e]),r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(1),o=n.n(r),i=n(3),a=n(2),s=n(0);const l=e=>{let t="",n="";if(e){const r=1===e.length;t=r?i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmModal.deleteSingleTitle",{defaultMessage:"Remove field '{name}'",values:{name:e[0]}}):i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmModal.deleteMultipleTitle",{defaultMessage:"Remove {count} fields",values:{count:e.length}}),n=r?i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmationModal.removeButtonLabel",{defaultMessage:"Remove field"}):i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmationModal.removeMultipleButtonLabel",{defaultMessage:"Remove fields"})}return{modalTitle:t,confirmButtonText:n,cancelButtonText:i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmationModal.cancelButtonLabel",{defaultMessage:"Cancel"}),warningMultipleFields:i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmModal.multipleDeletionDescription",{defaultMessage:"You are about to remove these runtime fields:"}),typeConfirm:i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmModal.typeConfirm",{defaultMessage:"Enter REMOVE to confirm"}),warningRemovingFields:i.i18n.translate("indexPatternFieldEditor.deleteRuntimeField.confirmModal.warningRemovingFields",{defaultMessage:"Removing fields can break searches and visualizations that rely on this field."})}};function d({fieldsToDelete:e,closeModal:t,confirmDelete:n}){const i=l(e),{modalTitle:d,confirmButtonText:u,cancelButtonText:c,warningMultipleFields:f}=i,m=Boolean(e.length>1),[p,_]=Object(r.useState)("");return Object(s.jsx)(a.EuiConfirmModal,{title:d,"data-test-subj":"runtimeFieldDeleteConfirmModal",onCancel:t,onConfirm:n,cancelButtonText:c,buttonColor:"danger",confirmButtonText:u,confirmButtonDisabled:"REMOVE"!==(null==p?void 0:p.toUpperCase())},Object(s.jsx)(a.EuiCallOut,{color:"warning",title:i.warningRemovingFields,iconType:"warning",size:"s"},m&&Object(s.jsx)(o.a.Fragment,null,Object(s.jsx)("p",null,f),Object(s.jsx)("ul",null,e.map((e=>Object(s.jsx)("li",{key:e},e)))))),Object(s.jsx)(a.EuiSpacer,null),Object(s.jsx)(a.EuiFormRow,{label:i.typeConfirm},Object(s.jsx)(a.EuiFieldText,{value:p,onChange:e=>_(e.target.value),"data-test-subj":"deleteModalConfirmText"})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return field_format_editor_FormatSelectEditor})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return F})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return v})),n.d(t,"g",(function(){return x})),n.d(t,"h",(function(){return S})),n.d(t,"i",(function(){return C})),n.d(t,"j",(function(){return P})),n.d(t,"k",(function(){return w})),n.d(t,"l",(function(){return k})),n.d(t,"m",(function(){return G})),n.d(t,"n",(function(){return L}));var r=n(4),o=n.n(r),i=n(2),a=n(40),s=n(3),l=n(14),d=n(1),u=n.n(d),c=n(18),f=n(0);const m=Object(c.memoize)((e=>e?u.a.lazy((()=>e().then((e=>({default:e}))))):null));class format_editor_FormatEditor extends d.PureComponent{constructor(e){var t;super(e),this.state={EditorComponent:m(null!==(t=e.fieldFormatEditors.getById(e.fieldFormatId))&&void 0!==t?t:null)}}static getDerivedStateFromProps(e){var t;return{EditorComponent:m(null!==(t=e.fieldFormatEditors.getById(e.fieldFormatId))&&void 0!==t?t:null)}}render(){const{EditorComponent:e}=this.state,{fieldType:t,fieldFormat:n,fieldFormatParams:r,onChange:o,onError:a}=this.props;return Object(f.jsx)(u.a.Fragment,null,e?Object(f.jsx)(u.a.Suspense,{fallback:Object(f.jsx)("div",{style:{minHeight:430,marginTop:8}},Object(f.jsx)(i.EuiDelayRender,null,Object(f.jsx)(i.EuiSkeletonText,{lines:4})))},Object(f.jsx)(e,{fieldType:t,format:n,formatParams:r,onChange:o,onError:a})):null)}}const p=(e,t,n)=>{const r=n.getByFieldType(e).map((({id:e,title:t})=>({id:e,title:t})));return[{id:"",defaultFieldFormat:t,title:s.i18n.translate("indexPatternFieldEditor.defaultFormatDropDown",{defaultMessage:"- Default -"})},...r]};class field_format_editor_FormatSelectEditor extends d.PureComponent{constructor(e){super(e),o()(this,"onFormatChange",((e,t)=>this.props.onChange(e?{id:e,params:t||{}}:void 0))),o()(this,"onFormatParamsChange",(e=>{const{fieldFormatId:t}=this.state;this.onFormatChange(t,e)}));const{fieldFormats:t,esTypes:n}=e,r=Object(a.a)(n[0]||"keyword");this.state={fieldTypeFormats:p(r,t.getDefaultType(r,n),t),kbnType:r}}render(){const{fieldFormatEditors:e,onError:t,value:n,fieldFormats:r,esTypes:o}=this.props,a=null==n?void 0:n.id,{kbnType:s}=this.state,{fieldTypeFormats:d}=this.state,c=d[0].defaultFieldFormat.title,m=null!=n&&n.id?r.getInstance(null==n?void 0:n.id,null==n?void 0:n.params):r.getDefaultInstance(s,o),p=m.params(),_=c?Object(f.jsx)(l.FormattedMessage,{id:"indexPatternFieldEditor.defaultFormatHeader",defaultMessage:"Format (Default: {defaultFormat})",values:{defaultFormat:Object(f.jsx)(i.EuiCode,null,c)}}):Object(f.jsx)(l.FormattedMessage,{id:"indexPatternFieldEditor.formatHeader",defaultMessage:"Format"});return Object(f.jsx)(u.a.Fragment,null,Object(f.jsx)(i.EuiFormRow,{label:_},Object(f.jsx)(i.EuiSelect,{value:a||"",options:d.map((e=>({value:e.id||"",text:e.title}))),"data-test-subj":"editorSelectedFormatId",onChange:e=>{this.onFormatChange(e.target.value)}})),a?Object(f.jsx)(format_editor_FormatEditor,{fieldType:s,fieldFormat:m,fieldFormatId:a,fieldFormatParams:p,fieldFormatEditors:e,onChange:e=>{this.onFormatChange(a,e)},onError:t}):null)}}var _=n(27);const b=()=>n.e(2).then(n.bind(null,89)).then((e=>e.BytesFormatEditor));b.formatId=_.a;var E=n(28);const F=()=>n.e(13).then(n.bind(null,90)).then((e=>e.ColorFormatEditor));F.formatId=E.a;var g=n(29);const h=()=>n.e(4).then(n.bind(null,91)).then((e=>e.DateFormatEditor));h.formatId=g.a;var y=n(30);const O=()=>n.e(5).then(n.bind(null,92)).then((e=>e.DateNanosFormatEditor));O.formatId=y.a,n(19);var T=n(31);const v=()=>n.e(6).then(n.bind(null,93)).then((e=>e.DurationFormatEditor));v.formatId=T.a;var j=n(32);const x=()=>n.e(7).then(n.bind(null,94)).then((e=>e.GeoPointFormatEditor));x.formatId=j.a;var N=n(33);const S=()=>n.e(8).then(n.bind(null,95)).then((e=>e.HistogramFormatEditor));S.formatId=N.a;var D=n(20);const C=()=>n.e(9).then(n.bind(null,61)).then((e=>e.NumberFormatEditor));C.formatId=D.a;var R=n(34);const P=()=>n.e(3).then(n.bind(null,96)).then((e=>e.PercentFormatEditor));P.formatId=R.a;var M=n(35);const w=()=>n.e(14).then(n.bind(null,97)).then((e=>e.StaticLookupFormatEditor));w.formatId=M.a;var A=n(36);const k=()=>n.e(10).then(n.bind(null,98)).then((e=>e.StringFormatEditor));k.formatId=A.a;var I=n(37);const G=()=>n.e(11).then(n.bind(null,101)).then((e=>e.TruncateFormatEditor));G.formatId=I.a;var B=n(38);const L=()=>n.e(12).then(n.bind(null,99)).then((e=>e.UrlFormatEditor));L.formatId=B.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(6);const o=e=>({getFieldPreview:({index:t,context:n,script:o,document:i})=>Object(r.i)(e,{path:"/internal/data_view_field_editor/field_preview",method:"post",body:{index:t,context:n,script:o,document:i},version:"1"})})},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/helpers");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="bytes"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="color"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="date"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="date_nanos"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="duration"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="geo_point"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="histogram"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="percent"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="static_lookup"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="string"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="truncate"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="url"},function(e,t){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(4),o=n.n(r);let i,a;!function(e){e._ID="_id",e._INDEX="_index",e._SOURCE="_source",e._TYPE="_type",e.STRING="string",e.TEXT="text",e.MATCH_ONLY_TEXT="match_only_text",e.KEYWORD="keyword",e.VERSION="version",e.BOOLEAN="boolean",e.OBJECT="object",e.DATE="date",e.DATE_NANOS="date_nanos",e.DATE_RANGE="date_range",e.GEO_POINT="geo_point",e.GEO_SHAPE="geo_shape",e.FLOAT="float",e.HALF_FLOAT="half_float",e.SCALED_FLOAT="scaled_float",e.DOUBLE="double",e.INTEGER="integer",e.LONG="long",e.SHORT="short",e.UNSIGNED_LONG="unsigned_long",e.AGGREGATE_METRIC_DOUBLE="aggregate_metric_double",e.FLOAT_RANGE="float_range",e.DOUBLE_RANGE="double_range",e.INTEGER_RANGE="integer_range",e.LONG_RANGE="long_range",e.NESTED="nested",e.BYTE="byte",e.IP="ip",e.IP_RANGE="ip_range",e.ATTACHMENT="attachment",e.TOKEN_COUNT="token_count",e.MURMUR3="murmur3",e.HISTOGRAM="histogram"}(i||(i={})),function(e){e._SOURCE="_source",e.ATTACHMENT="attachment",e.BOOLEAN="boolean",e.DATE="date",e.DATE_RANGE="date_range",e.GEO_POINT="geo_point",e.GEO_SHAPE="geo_shape",e.IP="ip",e.IP_RANGE="ip_range",e.MURMUR3="murmur3",e.NUMBER="number",e.NUMBER_RANGE="number_range",e.STRING="string",e.UNKNOWN="unknown",e.CONFLICT="conflict",e.OBJECT="object",e.NESTED="nested",e.HISTOGRAM="histogram",e.MISSING="missing"}(a||(a={}));class kbn_field_type_KbnFieldType{constructor(e={}){o()(this,"name",void 0),o()(this,"sortable",void 0),o()(this,"filterable",void 0),o()(this,"esTypes",void 0),this.name=e.name||a.UNKNOWN,this.sortable=e.sortable||!1,this.filterable=e.filterable||!1,this.esTypes=Object.freeze((e.esTypes||[]).slice())}}const s=new kbn_field_type_KbnFieldType({name:a.UNKNOWN}),l=[new kbn_field_type_KbnFieldType({name:a.STRING,sortable:!0,filterable:!0,esTypes:[i.STRING,i.TEXT,i.MATCH_ONLY_TEXT,i.KEYWORD,i.VERSION,i._TYPE,i._ID]}),new kbn_field_type_KbnFieldType({name:a.NUMBER,sortable:!0,filterable:!0,esTypes:[i.FLOAT,i.HALF_FLOAT,i.SCALED_FLOAT,i.DOUBLE,i.INTEGER,i.LONG,i.UNSIGNED_LONG,i.SHORT,i.BYTE,i.TOKEN_COUNT,i.AGGREGATE_METRIC_DOUBLE]}),new kbn_field_type_KbnFieldType({name:a.NUMBER_RANGE,sortable:!0,filterable:!0,esTypes:[i.FLOAT_RANGE,i.DOUBLE_RANGE,i.INTEGER_RANGE,i.LONG_RANGE]}),new kbn_field_type_KbnFieldType({name:a.DATE,sortable:!0,filterable:!0,esTypes:[i.DATE,i.DATE_NANOS]}),new kbn_field_type_KbnFieldType({name:a.DATE_RANGE,sortable:!0,filterable:!0,esTypes:[i.DATE_RANGE]}),new kbn_field_type_KbnFieldType({name:a.IP,sortable:!0,filterable:!0,esTypes:[i.IP]}),new kbn_field_type_KbnFieldType({name:a.IP_RANGE,sortable:!0,filterable:!0,esTypes:[i.IP_RANGE]}),new kbn_field_type_KbnFieldType({name:a.BOOLEAN,sortable:!0,filterable:!0,esTypes:[i.BOOLEAN]}),new kbn_field_type_KbnFieldType({name:a.OBJECT,esTypes:[i.OBJECT]}),new kbn_field_type_KbnFieldType({name:a.NESTED,esTypes:[i.NESTED]}),new kbn_field_type_KbnFieldType({name:a.GEO_POINT,esTypes:[i.GEO_POINT]}),new kbn_field_type_KbnFieldType({name:a.GEO_SHAPE,esTypes:[i.GEO_SHAPE]}),new kbn_field_type_KbnFieldType({name:a.ATTACHMENT,esTypes:[i.ATTACHMENT]}),new kbn_field_type_KbnFieldType({name:a.MURMUR3,esTypes:[i.MURMUR3]}),new kbn_field_type_KbnFieldType({name:a._SOURCE,esTypes:[i._SOURCE]}),new kbn_field_type_KbnFieldType({name:a.HISTOGRAM,filterable:!0,esTypes:[i.HISTOGRAM]}),new kbn_field_type_KbnFieldType({name:a.CONFLICT}),s],d=e=>{const t=l.find((t=>t.esTypes.includes(e)));return t&&t.name?t.name:a.UNKNOWN}},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t,n){n(43),__kbnBundles__.define("plugin/dataViewFieldEditor/public",n,45)},function(e,t,n){n.p=window.__kbnPublicPath__.dataViewFieldEditor},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;t.default=o},function(e,t,n){"use strict";n.r(t),n.d(t,"DefaultFormatEditor",(function(){return I.DefaultFormatEditor})),n.d(t,"plugin",(function(){return G}));var r=n(4),o=n.n(r),i=n(1),a=n.n(i),s=n(3),l=n(8),d=n.n(l),u=n(17),c=n.n(u),f=n(21),m=n.n(f),p=n(13),_=n.n(p),b=n(2);let E;!function(e){e.preboot="preboot",e.standard="standard"}(E||(E={}));const F="eui-global",g="eui-utilities",h={darkMode:!1};var y=n(0);const O=_()({key:"css",container:document.querySelector('meta[name="emotion"]')}),T=_()({key:F,container:document.querySelector(`meta[name="${F}"]`)}),v=_()({key:g,container:document.querySelector(`meta[name="${g}"]`)});O.compat=!0,T.compat=!0,v.compat=!0;const j={default:O,global:T,utility:v},x=({theme:{theme$:e},globalStyles:t,colorMode:n,children:r})=>{const o=m()(e,h),a=Object(i.useMemo)((()=>(e=>e.darkMode?b.COLOR_MODES_STANDARD.dark:b.COLOR_MODES_STANDARD.light)(o)),[o]),s=n||a,l=!1!==t&&void 0;return Object(y.jsx)(b.EuiProvider,{cache:j,colorMode:s,globalStyles:l,utilityClasses:l},r)},N=({children:e,i18n:t,...n})=>Object(y.jsx)(x,n,Object(y.jsx)(t.Context,null,e)),S=({children:e,...t})=>Object(y.jsx)(N,c()({globalStyles:!1},t),Object(y.jsx)(b.EuiErrorBoundary,null,e));class mount_point_portal_MountPointPortalErrorBoundary extends i.Component{constructor(...e){super(...e),o()(this,"state",{error:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(){}render(){return this.state.error?Object(y.jsx)("p",null,s.i18n.translate("reactPackages.mountPointPortal.errorMessage",{defaultMessage:"Error rendering portal content"})):this.props.children}}const D=e=>{const[t,r]=Object(i.useState)(null),o=Object(i.useCallback)((async()=>{const{FieldEditorFlyoutContentContainer:e}=await n.e(1).then(n.bind(null,100));r((()=>e))}),[]);return Object(i.useEffect)((()=>{o()}),[o]),t?Object(y.jsx)(t,e):Object(y.jsx)(a.a.Fragment,null,Object(y.jsx)(b.EuiFlyoutHeader,null),Object(y.jsx)(b.EuiFlyoutBody,null),Object(y.jsx)(b.EuiFlyoutFooter,null))};var C=n(10),R=n(6);const P=({core:e,dataViews:t,fieldFormats:n,fieldFormatEditors:r,search:o,usageCollection:i,apiService:a})=>l=>{const{uiSettings:u,overlays:c,docLinks:f,notifications:m,settings:p,theme:_}=e,{Provider:b}=Object(R.g)({uiSettings:u,docLinks:f,http:e.http,settings:p,theme:_});let E=null;const F={current:()=>!0},g=e=>{F.current=e.canCloseValidator};return(({onSave:l,fieldName:p,fieldToCreate:_,ctx:{dataView:h}})=>{const O=()=>{E&&(E.close(),E=null)},T=p?h.getFieldByName(p)||{name:v=p,runtimeField:h.getAllRuntimeFields()[v],isMapped:!1,esTypes:[],type:void 0,customLabel:void 0,count:void 0,spec:{parentName:void 0}}:void 0;var v;if(p&&!T){const e=s.i18n.translate("indexPatternFieldEditor.noSuchFieldName",{defaultMessage:"Field named '{fieldName}' not found on index pattern",values:{fieldName:p}});return m.toasts.addDanger(e),O}const j=!p,x=T&&T.runtimeField&&!T.isMapped&&("composite"!==T.runtimeField.type||!T.type),N=j||x?"runtime":"concrete";let R;var P,M,w,A;return T&&(R=x?{name:p,customLabel:T.customLabel,popularity:T.count,format:null===(P=h.getFormatterForFieldNoDefault(p))||void 0===P?void 0:P.toJSON(),...h.getRuntimeField(p)}:{name:p,type:null!=T&&T.esTypes?T.esTypes[0]:"keyword",customLabel:T.customLabel,popularity:T.count,format:null===(M=h.getFormatterForFieldNoDefault(p))||void 0===M?void 0:M.toJSON(),parentName:T.spec.parentName}),E=c.openFlyout((w=Object(y.jsx)(b,null,Object(y.jsx)(D,{onSave:e=>{O(),l&&l(e)},onCancel:O,onMounted:g,docLinks:f,fieldToEdit:R,fieldToCreate:_,fieldTypeToProcess:N,dataView:h,search:o,dataViews:t,notifications:m,usageCollection:i,apiService:a,fieldFormatEditors:r,fieldFormats:n,uiSettings:u})),A={theme:e.theme,i18n:e.i18n},e=>(d.a.render(Object(y.jsx)(S,A,w),e),()=>d.a.unmountComponentAtNode(e))),{className:C.a,maxWidth:708,size:"l",ownFocus:!0,hideCloseButton:!0,"aria-label":j?s.i18n.translate("indexPatternFieldEditor.createField.flyoutAriaLabel",{defaultMessage:"Create field"}):s.i18n.translate("indexPatternFieldEditor.editField.flyoutAriaLabel",{defaultMessage:"Edit {fieldName} field",values:{fieldName:p}}),onClose:e=>{F.current()&&e.close()},maskProps:{className:"indexPatternFieldEditorMaskOverlay"}}),O})(l)};class field_format_editors_FieldFormatEditors{constructor(){o()(this,"editors",[])}setup(e=[]){return this.editors=e,{register:e=>{this.editors.push(e)}}}start(){return{getAll:()=>[...this.editors],getById:e=>this.editors.find((t=>t.formatId===e))}}}var M=n(23);class format_editor_service_FormatEditorService{constructor(){o()(this,"fieldFormatEditors",void 0),this.fieldFormatEditors=new field_format_editors_FieldFormatEditors}setup(){const e=[M.b,M.c,M.d,M.e,M.f,M.g,M.i,M.j,M.k,M.l,M.m,M.n,M.h];return{fieldFormatEditors:this.fieldFormatEditors.setup(e)}}start(){return{fieldFormatEditors:this.fieldFormatEditors.start()}}stop(){}}var w=n(22),A=n(39);class DeleteCompositeSubfield extends Error{constructor(e){super(`Field '${e} cannot be deleted because it is a composite subfield.`)}}var k=n(24);class plugin_IndexPatternFieldEditorPlugin{constructor(){o()(this,"formatEditorService",new format_editor_service_FormatEditorService)}setup(e,t){const{fieldFormatEditors:n}=this.formatEditorService.setup();return{fieldFormatEditors:n}}start(e,t){const{fieldFormatEditors:n}=this.formatEditorService.start(),{http:r}=e,{data:o,usageCollection:l,dataViews:d,fieldFormats:u}=t,c=(({core:e,dataViews:t,usageCollection:n})=>r=>{if("string"==typeof r.fieldName){var o;const e=r.ctx.dataView.getFieldByName(r.fieldName);if("composite"===(null==e||null===(o=e.runtimeField)||void 0===o?void 0:o.type))throw new DeleteCompositeSubfield(r.fieldName)}const{overlays:i,notifications:a}=e;let l=null;return(({onDelete:r,fieldName:o,ctx:{dataView:d}})=>{const u=Array.isArray(o)?o:[o],c=()=>{l&&(l.close(),l=null)};return l=i.openModal(Object(R.j)(Object(y.jsx)(w.a,{fieldsToDelete:u,closeModal:c,confirmDelete:async()=>{c(),await async function(e,t,n){e.forEach((e=>{t.removeRuntimeField(e)}));try{n.usageCollection.reportUiCounter(C.b,A.METRIC_TYPE.COUNT,"delete_runtime")}catch{}try{t.isPersisted()&&await n.dataViews.updateSavedObject(t)}catch(e){const t=s.i18n.translate("indexPatternFieldEditor.save.deleteErrorTitle",{defaultMessage:"Failed to save field removal"});n.notifications.toasts.addError(e,{title:t})}}(u,d,{dataViews:t,usageCollection:n,notifications:a}),r&&r(u)}}),{theme$:e.theme.theme$})),c})(r)})({core:e,dataViews:d,usageCollection:l});return{fieldFormatEditors:n,openEditor:P({core:e,dataViews:d,apiService:Object(k.a)(r),fieldFormats:u,fieldFormatEditors:n,search:o.search,usageCollection:l}),openDeleteModal:c,userPermissions:{editIndexPattern:()=>d.getCanSaveSync()},DeleteRuntimeFieldProvider:(f=c,a.a.memo((({dataView:e,children:t,onDelete:n})=>{const r=Object(i.useRef)(null),o=Object(i.useCallback)((async t=>{r.current&&r.current(),r.current=f({ctx:{dataView:e},fieldName:t,onDelete:n})}),[n,e]);return Object(i.useEffect)((()=>()=>{r.current&&r.current()}),[]),Object(y.jsx)(a.a.Fragment,null,t(o))})))};var f}stop(){return{}}}var I=n(7);function G(){return new plugin_IndexPatternFieldEditorPlugin}},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t){e.exports=__kbnSharedDeps__.KbnMonaco},function(e,t){e.exports=__kbnSharedDeps__.ReactDomServer},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t){e.exports=__kbnSharedDeps__.RxjsOperators},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/fieldFormats/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Moment}]);