!function(e){function t(t){for(var n,i,r=t[0],s=t[1],a=0,c=[];a{if(!r()(Object(s.omit)(e,"explicitInput"),Object(s.omit)(t,"explicitInput")))return!1;const{value:n=["",""]}=e.explicitInput,{value:o=["",""]}=t.explicitInput;return Object(s.isEqual)(n,o)}},[c.a]:{getPanelIsEqual:(e,t)=>{if(!r()(Object(s.omit)(e,"explicitInput"),Object(s.omit)(t,"explicitInput")))return!1;const{sort:n,exclude:o,hideSort:i,hideExists:a,hideExclude:c,selectedOptions:u,singleSelect:d,searchTechnique:p,existsSelected:g,runPastTimeout:f,...b}=e.explicitInput,{sort:m,exclude:h,hideSort:v,hideExists:O,hideExclude:S,selectedOptions:_,singleSelect:y,searchTechnique:T,existsSelected:L,runPastTimeout:w,...E}=t.explicitInput;return Boolean(o)===Boolean(h)&&Boolean(i)===Boolean(v)&&Boolean(a)===Boolean(O)&&Boolean(c)===Boolean(S)&&Boolean(d)===Boolean(y)&&Boolean(g)===Boolean(L)&&Boolean(f)===Boolean(w)&&Object(s.isEqual)(null!=p?p:"prefix",null!=T?T:"prefix")&&r()(null!=n?n:l.a,null!=m?m:l.a)&&Object(s.isEqual)(null!=u?u:[],null!=_?_:[])&&r()(b,E)}},[d.a]:{getPanelIsEqual:(e,t)=>{if(!r()(Object(s.omit)(e,"explicitInput"),Object(s.omit)(t,"explicitInput")))return!1;const{isAnchored:n,timesliceStartAsPercentageOfTimeRange:o,timesliceEndAsPercentageOfTimeRange:i}=e.explicitInput,{isAnchored:a,timesliceStartAsPercentageOfTimeRange:l,timesliceEndAsPercentageOfTimeRange:c}=t.explicitInput;return Boolean(n)===Boolean(a)&&Boolean(o)===Boolean(l)&&o===l&&Boolean(i)===Boolean(c)&&i===c}}},g=e=>{if(e||"string"==typeof e)try{return JSON.parse(e)}catch{return}},f=()=>({panels:{},defaultControlWidth:a.c,defaultControlGrow:a.a,controlStyle:a.b,chainingSystem:"HIERARCHICAL",ignoreParentSettings:{ignoreFilters:!1,ignoreQuery:!1,ignoreTimerange:!1,ignoreValidations:!1}}),b=(e,t)=>{const n=f(),o={...n,...Object(s.pick)(e,["panels","chainingSystem","controlStyle","ignoreParentSettings"])},i={...n,...Object(s.pick)(t,["panels","chainingSystem","controlStyle","ignoreParentSettings"])};return!(!m(o.panels,i.panels)||!r()(Object(s.omit)(o,"panels"),Object(s.omit)(i,"panels")))},m=(e,t)=>{const n=Object.keys(e),o=Object.keys(t);if(Object(s.xor)(n,o).length>0)return!1;for(const n of o){const o=t[n].type;if(!(p[o]?p[o].getPanelIsEqual(e[n],t[n]):(i=e[n],a=t[n],r()(i,a))))return!1}var i,a;return!0},h=e=>({controlStyle:e.controlStyle,chainingSystem:e.chainingSystem,panelsJSON:JSON.stringify(e.panels),ignoreParentSettingsJSON:JSON.stringify(e.ignoreParentSettings)}),v=e=>{const t=f(),{chainingSystem:n,controlStyle:o,ignoreParentSettingsJSON:i,panelsJSON:r}=e,s=g(r),a=g(i);return{...t,...n?{chainingSystem:n}:{},...o?{controlStyle:o}:{},...a?{ignoreParentSettings:a}:{},...s?{panels:s}:{}}},O=e=>{var t,n,o;const i=f();return{chainingSystem:null==e?void 0:e.chainingSystem,controlStyle:null!==(t=null==e?void 0:e.controlStyle)&&void 0!==t?t:i.controlStyle,ignoreParentSettings:null!==(n=g(null==e?void 0:e.ignoreParentSettingsJSON))&&void 0!==n?n:{},panels:null!==(o=g(null==e?void 0:e.panelsJSON))&&void 0!==o?o:{}}},S=e=>({controlStyle:e.controlStyle,chainingSystem:e.chainingSystem,ignoreParentSettingsJSON:JSON.stringify(e.ignoreParentSettings),panelsJSON:JSON.stringify(e.panels)})},function(e,t){e.exports=__kbnSharedDeps__.ElasticEui},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(0);const i={control:{getSeparator:()=>o.i18n.translate("controls.optionsList.control.separator",{defaultMessage:", "}),getPlaceholder:()=>o.i18n.translate("controls.optionsList.control.placeholder",{defaultMessage:"Any"}),getNegate:()=>o.i18n.translate("controls.optionsList.control.negate",{defaultMessage:"NOT"}),getExcludeExists:()=>o.i18n.translate("controls.optionsList.control.excludeExists",{defaultMessage:"DOES NOT"})},editor:{getSelectionOptionsTitle:()=>o.i18n.translate("controls.optionsList.editor.selectionOptionsTitle",{defaultMessage:"Selections"}),selectionTypes:{multi:{getLabel:()=>o.i18n.translate("controls.optionsList.editor.multiSelectLabel",{defaultMessage:"Allow multiple selections"})},single:{getLabel:()=>o.i18n.translate("controls.optionsList.editor.singleSelectLabel",{defaultMessage:"Only allow a single selection"})}},getSearchOptionsTitle:()=>o.i18n.translate("controls.optionsList.editor.searchOptionsTitle",{defaultMessage:"Searching"}),searchTypes:{prefix:{getLabel:()=>o.i18n.translate("controls.optionsList.editor.prefixSearchLabel",{defaultMessage:"Prefix"}),getTooltip:()=>o.i18n.translate("controls.optionsList.editor.prefixSearchTooltip",{defaultMessage:"Matches values that begin with the given search string."})},wildcard:{getLabel:()=>o.i18n.translate("controls.optionsList.editor.wildcardSearchLabel",{defaultMessage:"Contains"}),getTooltip:()=>o.i18n.translate("controls.optionsList.editor.wildcardSearchTooltip",{defaultMessage:"Matches values that contain the given search string. Results might take longer to populate."})}},getAdditionalSettingsTitle:()=>o.i18n.translate("controls.optionsList.editor.additionalSettingsTitle",{defaultMessage:"Additional settings"}),getRunPastTimeoutTitle:()=>o.i18n.translate("controls.optionsList.editor.runPastTimeout",{defaultMessage:"Ignore timeout for results"}),getRunPastTimeoutTooltip:()=>o.i18n.translate("controls.optionsList.editor.runPastTimeout.tooltip",{defaultMessage:"Wait to display results until the list is complete. This setting is useful for large data sets, but the results might take longer to populate."})},popover:{getAriaLabel:e=>o.i18n.translate("controls.optionsList.popover.ariaLabel",{defaultMessage:"Popover for {fieldName} control",values:{fieldName:e}}),getSuggestionsAriaLabel:(e,t)=>o.i18n.translate("controls.optionsList.popover.suggestionsAriaLabel",{defaultMessage:"Available {optionCount, plural, one {option} other {options}} for {fieldName}",values:{fieldName:e,optionCount:t}}),getAllowExpensiveQueriesWarning:()=>o.i18n.translate("controls.optionsList.popover.allowExpensiveQueriesWarning",{defaultMessage:"The cluster setting to allow expensive queries is off, so some features are disabled."}),getLoadingMoreMessage:()=>o.i18n.translate("controls.optionsList.popover.loadingMore",{defaultMessage:"Loading more options..."}),getAtEndOfOptionsMessage:()=>o.i18n.translate("controls.optionsList.popover.endOfOptions",{defaultMessage:"The top 1,000 available options are displayed. View more options by searching for the name."}),getEmptyMessage:()=>o.i18n.translate("controls.optionsList.popover.empty",{defaultMessage:"No options found"}),getSelectionsEmptyMessage:()=>o.i18n.translate("controls.optionsList.popover.selectionsEmpty",{defaultMessage:"You have no selections"}),getAllOptionsButtonTitle:()=>o.i18n.translate("controls.optionsList.popover.allOptionsTitle",{defaultMessage:"Show all options"}),getSelectedOptionsButtonTitle:()=>o.i18n.translate("controls.optionsList.popover.selectedOptionsTitle",{defaultMessage:"Show only selected options"}),searchPlaceholder:{prefix:{getPlaceholderText:()=>o.i18n.translate("controls.optionsList.popover.prefixSearchPlaceholder",{defaultMessage:"Starts with..."})},wildcard:{getPlaceholderText:()=>o.i18n.translate("controls.optionsList.popover.wildcardSearchPlaceholder",{defaultMessage:"Contains..."})}},getCardinalityLabel:e=>o.i18n.translate("controls.optionsList.popover.cardinalityLabel",{defaultMessage:"{totalOptions, number} {totalOptions, plural, one {option} other {options}}",values:{totalOptions:e}}),getInvalidSelectionsSectionAriaLabel:(e,t)=>o.i18n.translate("controls.optionsList.popover.invalidSelectionsAriaLabel",{defaultMessage:"Ignored {invalidSelectionCount, plural, one {selection} other {selections}} for {fieldName}",values:{fieldName:e,invalidSelectionCount:t}}),getInvalidSelectionsSectionTitle:e=>o.i18n.translate("controls.optionsList.popover.invalidSelectionsSectionTitle",{defaultMessage:"Ignored {invalidSelectionCount, plural, one {selection} other {selections}}",values:{invalidSelectionCount:e}}),getInvalidSelectionsLabel:e=>o.i18n.translate("controls.optionsList.popover.invalidSelectionsLabel",{defaultMessage:"{selectedOptions} {selectedOptions, plural, one {selection} other {selections}} ignored",values:{selectedOptions:e}}),getInvalidSelectionScreenReaderText:()=>o.i18n.translate("controls.optionsList.popover.invalidSelectionScreenReaderText",{defaultMessage:"Invalid selection."}),getIncludeLabel:()=>o.i18n.translate("controls.optionsList.popover.includeLabel",{defaultMessage:"Include"}),getExcludeLabel:()=>o.i18n.translate("controls.optionsList.popover.excludeLabel",{defaultMessage:"Exclude"}),getIncludeExcludeLegend:()=>o.i18n.translate("controls.optionsList.popover.excludeOptionsLegend",{defaultMessage:"Include or exclude selections"}),getSortPopoverTitle:()=>o.i18n.translate("controls.optionsList.popover.sortTitle",{defaultMessage:"Sort"}),getSortPopoverDescription:()=>o.i18n.translate("controls.optionsList.popover.sortDescription",{defaultMessage:"Define the sort order"}),getSortDisabledTooltip:()=>o.i18n.translate("controls.optionsList.popover.sortDisabledTooltip",{defaultMessage:"Sorting is ignored when “Show only selected” is true"}),getDocumentCountTooltip:e=>o.i18n.translate("controls.optionsList.popover.documentCountTooltip",{defaultMessage:"This value appears in {documentCount, number} {documentCount, plural, one {document} other {documents}}",values:{documentCount:e}}),getDocumentCountScreenReaderText:e=>o.i18n.translate("controls.optionsList.popover.documentCountScreenReaderText",{defaultMessage:"Appears in {documentCount, number} {documentCount, plural, one {document} other {documents}}",values:{documentCount:e}})},controlAndPopover:{getExists:(e=0)=>o.i18n.translate("controls.optionsList.controlAndPopover.exists",{defaultMessage:"{negate, plural, one {Exist} other {Exists}}",values:{negate:e}})},editorAndPopover:{getSortDirectionLegend:()=>o.i18n.translate("controls.optionsList.popover.sortDirections",{defaultMessage:"Sort directions"}),sortBy:{_count:{getSortByLabel:()=>o.i18n.translate("controls.optionsList.popover.sortBy.docCount",{defaultMessage:"By document count"})},_key:{getSortByLabel:()=>o.i18n.translate("controls.optionsList.popover.sortBy.alphabetical",{defaultMessage:"Alphabetically"})}},sortOrder:{asc:{getSortOrderLabel:()=>o.i18n.translate("controls.optionsList.popover.sortOrder.asc",{defaultMessage:"Ascending"})},desc:{getSortOrderLabel:()=>o.i18n.translate("controls.optionsList.popover.sortOrder.desc",{defaultMessage:"Descending"})}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));const o="optionsListControl",i="prefix"},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="rangeSliderControl"},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));const o="medium",i=!0,r="oneLine"},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));const o={by:"_count",direction:"desc"},i=e=>"ip"===e?["_count"]:["_count","_key"]},function(e,t,n){"use strict";var o=n(23);n.d(t,"a",(function(){return o.a}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return control_group_container_factory_ControlGroupContainerFactory})),n.d(t,"b",(function(){return u.c})),n.d(t,"a",(function(){return u.b})),n.d(t,"e",(function(){return d.a})),n.d(t,"d",(function(){return h}));var o=n(14),i=n(1),r=n.n(i),s=n(0),a=n(3);n(10);const l=e=>`${e.explicitInput.id}:`;var c=n(7);class control_group_container_factory_ControlGroupContainerFactory{constructor(e){r()(this,"isContainerType",!0),r()(this,"type",o.a),r()(this,"inject",void 0),r()(this,"extract",void 0),r()(this,"isEditable",(async()=>!1)),r()(this,"getDisplayName",(()=>s.i18n.translate("controls.controlGroup.title",{defaultMessage:"Control group"}))),r()(this,"create",(async(e,t,o,i)=>{const r=await Object(a.lazyLoadReduxToolsPackage)(),{ControlGroupContainer:s}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,62));return new s(r,e,t,o,i)})),this.persistableStateService=e,this.inject=(e=>(t,n)=>{const o={...t};if("panels"in o){o.panels={...o.panels};for(const[t,i]of Object.entries(o.panels)){o.panels[t]={...i};const r=l(i),s=n.filter((e=>0===e.name.indexOf(r))).map((e=>({...e,name:e.name.replace(r,"")}))),a=0===s.length?n:s,{type:c,...u}=e.inject({...o.panels[t].explicitInput,type:o.panels[t].type},a);o.panels[t].explicitInput=u}}return o})(this.persistableStateService),this.extract=(e=>t=>{const n={...t},o=[];if("panels"in n){n.panels={...n.panels};for(const[t,i]of Object.entries(n.panels)){const r=l(i),{state:s,references:a}=e.extract({...i.explicitInput,type:i.type}),c=a.map((e=>({...e,name:`${r}${e.name}`})));o.push(...c);const{type:u,...d}=s;n.panels[t].explicitInput=d}}return{state:n,references:o}})(this.persistableStateService)}getDefaultInput(){return Object(c.getDefaultControlGroupInput)()}}var u=n(26),d=n(24),p=n(5),g=n(2),f=n(16),b=n(21),m=n(4);const h=Object(p.forwardRef)((({getCreationOptions:e,filters:t,timeRange:i,query:r},s)=>{const[a,l]=Object(p.useState)();Object(p.useImperativeHandle)(s,(()=>{return null!=(e=a)?e:null;var e}),[a]);const u=Object(p.useRef)(null),h=Object(p.useMemo)((()=>Object(f.v4)()),[]);return Object(p.useEffect)((()=>{let t,i=!1;return(async()=>{var r;const{pluginServices:s}=await Promise.resolve().then(n.bind(null,33)),{embeddable:p}=s.getServices(),g=p.getEmbeddableFactory(o.a),{initialInput:f,settings:b,fieldFilterPredicate:m}=null!==(r=await(null==e?void 0:e(Object(c.getDefaultControlGroupInput)(),d.a)))&&void 0!==r?r:{},v=await(null==g?void 0:g.create({id:h,...Object(c.getDefaultControlGroupInput)(),...f},void 0,b,m));if(i)return v.destroy(),void(null==a||a.destroy());u.current&&v.render(u.current),l(v),t=()=>v.destroy()})(),()=>{var e;i=!0,null===(e=t)||void 0===e||e()}}),[]),Object(p.useEffect)((()=>{var e;a&&((!i||Object(g.isEqual)(a.getInput().timeRange,i))&&Object(b.compareFilters)(null!==(e=a.getInput().filters)&&void 0!==e?e:[],null!=t?t:[])&&Object(g.isEqual)(a.getInput().query,r)||a.updateInput({timeRange:i,query:r,filters:t}))}),[r,t,a,i]),Object(m.jsx)("div",{ref:u})}))},function(e,t){e.exports=__kbnSharedDeps__.Uuid},function(e,t,n){"use strict";var o=n(33);n.d(t,"a",(function(){return o.pluginServices}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="timeSlider"},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));const o=()=>r,i={},r={registerControlType:e=>{i[e.type]=e},getControlFactory:e=>i[e],getControlTypes:()=>Object.keys(i)}},function(e,t,n){n.r(t);var o=__kbnBundles__.get("plugin/embeddable/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(o))},function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return l}));var o=n(32),i=n(17),r=n(14);const s=e=>{let t=0;return Object.keys(null!=e?e:{}).length>0&&(t=Object.values(null!=e?e:{}).reduce(((e,t)=>(t.order>e&&(e=t.order),e)),0)+1),t},a=async({dataViewId:e,fieldName:t})=>{const n=await i.a.getServices().dataViews.get(e);return(await Object(o.a)(n))[t].compatibleControlTypes[0]},l=e=>e.isContainer&&e.type===r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="control_group"},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return g}));var o=n(0),i=n(16),r=n(7),s=n(12),a=n(11),l=n(22);const c={addDataControlFromField:async(e,t)=>{const n=await u(e,t);e.panels={...e.panels,[n.explicitInput.id]:n}},addOptionsListControl:(e,t)=>{const n=d(e,t);e.panels={...e.panels,[n.explicitInput.id]:n}},addRangeSliderControl:(e,t)=>{const n=p(e,t);e.panels={...e.panels,[n.explicitInput.id]:n}},addTimeSliderControl:e=>{const t=g(e);e.panels={...e.panels,[t.explicitInput.id]:t}}};async function u(e,t){const{controlId:n,dataViewId:o,fieldName:r,title:s}=t;return{type:await Object(l.a)({dataViewId:o,fieldName:r}),...f(e,t),explicitInput:{id:n||Object(i.v4)(),dataViewId:o,fieldName:r,title:null!=s?s:r}}}function d(e,t){const{controlId:n,dataViewId:o,fieldName:s,title:a,...l}=t;return{type:r.OPTIONS_LIST_CONTROL,...f(e,t),explicitInput:{id:n||Object(i.v4)(),dataViewId:o,fieldName:s,title:null!=a?a:s,...l}}}function p(e,t){const{controlId:n,dataViewId:o,fieldName:r,title:s,...l}=t;return{type:a.a,...f(e,t),explicitInput:{id:n||Object(i.v4)(),dataViewId:o,fieldName:r,title:null!=s?s:r,...l}}}function g(e){return{type:r.TIME_SLIDER_CONTROL,order:Object(l.b)(e.panels),grow:!0,width:"large",explicitInput:{id:Object(i.v4)(),title:o.i18n.translate("controls.controlGroup.timeSlider.title",{defaultMessage:"Time slider"})}}}function f(e,t){var n,o,i,r;return{order:Object(l.b)(e.panels),grow:null!==(n=null!==(o=t.grow)&&void 0!==o?o:e.defaultControlGrow)&&void 0!==n?n:s.a,width:null!==(i=null!==(r=t.width)&&void 0!==r?r:e.defaultControlWidth)&&void 0!==i?i:s.c}}},function(e,t,n){n.r(t);var o=__kbnBundles__.get("plugin/dataViews/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(o))},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));const o="editControl",i="clearControl",r="deleteControl"},function(e,t){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t,n){n.r(t);var o=__kbnBundles__.get("plugin/data/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(o))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(29),i=n(5),r=o.__importDefault(n(38));t.default=function(e,t){void 0===t&&(t=[]);var n=r.default(e,t,{loading:!0}),o=n[0],s=n[1];return i.useEffect((function(){s()}),[s]),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(2),i=n(17);const r=Object(o.memoize)((async e=>await s(e)),(e=>[e.id,JSON.stringify(e.fields.getAll())].join("|"))),s=async e=>{const{controls:{getControlTypes:t,getControlFactory:n}}=i.a.getServices(),o=t().map((e=>n(e))),r={};return new Promise((t=>{for(const t of e.fields.getAll()){const e=[];for(const n of o)n.isFieldCompatible&&n.isFieldCompatible(t)&&e.push(n.type);e.length>0&&(r[t.name]={field:t,compatibleControlTypes:e})}t(r)}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"providers",(function(){return g})),n.d(t,"pluginServices",(function(){return f})),n.d(t,"registry",(function(){return b}));var o=n(3),i=n(19),r=n(2),s=n(28),a=n(1),l=n.n(a),c=n(27),u=n.n(c),d=n(30),p=n(21);class options_list_service_OptionsListService{constructor(e,t){l()(this,"core",void 0),l()(this,"data",void 0),l()(this,"http",void 0),l()(this,"getRoundedTimeRange",(e=>({from:u.a.parse(e.from).startOf("minute").toISOString(),to:u.a.parse(e.to).endOf("minute").toISOString()}))),l()(this,"optionsListCacheResolver",(e=>{const{size:t,sort:n,query:o,filters:i,timeRange:r,searchString:s,runPastTimeout:a,selectedOptions:l,searchTechnique:c,field:{name:u},dataView:{title:d}}=e;return[...r?JSON.stringify(this.getRoundedTimeRange(r)):[],Math.floor(Date.now()/1e3/60),null==l?void 0:l.join(","),JSON.stringify(i),JSON.stringify(o),JSON.stringify(n),c,a,d,s,u,t].join("|")})),l()(this,"cachedOptionsListRequest",Object(r.memoize)((async(e,t)=>{const n=e.dataView.title,o=this.getRequestBody(e);return await this.http.fetch(`/internal/controls/optionsList/${n}`,{version:"1",body:JSON.stringify(o),signal:t,method:"POST"})}),this.optionsListCacheResolver)),l()(this,"getRequestBody",(e=>{const t=this.data.query.timefilter.timefilter,{query:n,filters:o,dataView:i,timeRange:r,field:s,...a}=e,l=r?t.createFilter(i,r):void 0,c=[...null!=o?o:[],...l?[l]:[]],u=Object(d.getEsQueryConfig)(this.core.uiSettings);return{...a,filters:[Object(p.buildEsQuery)(i,null!=n?n:[],null!=c?c:[],u)],fieldName:s.name,fieldSpec:s,runtimeFieldMap:i.toSpec().runtimeFieldMap}})),l()(this,"cachedAllowExpensiveQueries",Object(r.memoize)((async()=>{const{allowExpensiveQueries:e}=await this.http.get("/internal/controls/optionsList/getExpensiveQueriesSetting",{version:"1"});return e}))),l()(this,"getAllowExpensiveQueries",(async()=>{try{return await this.cachedAllowExpensiveQueries()}catch(e){return!1}})),l()(this,"optionsListResponseWasFailure",(e=>void 0!==e.error)),l()(this,"runOptionsListRequest",(async(e,t)=>{try{return await this.cachedOptionsListRequest(e,t)}catch(t){return this.cachedOptionsListRequest.cache.delete(this.optionsListCacheResolver(e)),"AbortError"===t.name?{error:"aborted"}:{error:t}}})),l()(this,"clearOptionsListCache",(()=>{this.cachedOptionsListRequest.cache=new r.memoize.Cache})),this.core=e,({data:this.data,http:this.http}=t)}}const g={controls:new o.PluginServiceProvider(i.b),data:new o.PluginServiceProvider((({startPlugins:e})=>{const{data:{query:t,search:n}}=e,{data:o}=e;return{fetchFieldRange:async(e,t,n)=>{const{ignoreParentSettings:i,query:a,timeRange:l}=n;let{filters:c=[]}=n;const u=e.getFieldByName(t);if(!u)throw new Error("Field Missing Error");if(l){const t=o.query.timefilter.timefilter.createFilter(e,l);t&&(c=c.concat(t))}const d=await o.search.searchSource.create();d.setField("size",0),d.setField("index",e);const p=(e=>{const t={};return e&&(e.scripted?t.script={source:e.script,lang:e.lang}:t.field=e.name),{maxAgg:{max:t},minAgg:{min:t}}})(u);d.setField("aggs",p),d.setField("filter",null!=i&&i.ignoreFilters?[]:c),d.setField("query",null!=i&&i.ignoreQuery?void 0:a);const g=await Object(s.lastValueFrom)(d.fetch$()),f=Object(r.get)(g,"rawResponse.aggregations.minAgg.value",void 0),b=Object(r.get)(g,"rawResponse.aggregations.maxAgg.value",void 0);return{min:null===f?void 0:f,max:null===b?void 0:b}},query:t,searchSource:n.searchSource,timefilter:t.timefilter.timefilter}})),dataViews:new o.PluginServiceProvider((({startPlugins:e})=>{const{dataViews:{get:t,getIdsWithTitle:n,getDefaultId:o}}=e;return{get:t,getDefaultId:o,getIdsWithTitle:n}})),embeddable:new o.PluginServiceProvider((({startPlugins:e})=>({getEmbeddableFactory:e.embeddable.getEmbeddableFactory}))),http:new o.PluginServiceProvider((({coreStart:e})=>{const{http:{get:t,fetch:n}}=e;return{get:t,fetch:n}})),optionsList:new o.PluginServiceProvider(((e,t)=>new options_list_service_OptionsListService(e.coreStart,t)),["data","http"]),overlays:new o.PluginServiceProvider((({coreStart:e})=>{const{overlays:{openFlyout:t,openConfirm:n}}=e;return{openFlyout:t,openConfirm:n}})),settings:new o.PluginServiceProvider((({coreStart:e})=>({getDateFormat:()=>e.uiSettings.get("dateFormat","MMM D, YYYY @ HH:mm:ss.SSS"),getTimezone:()=>e.uiSettings.get("dateFormat:tz","Browser"),getDefaultTimeRange:()=>e.uiSettings.get("timepicker:timeDefaults")||{from:"now-15m",to:"now"}}))),theme:new o.PluginServiceProvider((({coreStart:e})=>{const{theme:{theme$:t}}=e;return{theme$:t}})),unifiedSearch:new o.PluginServiceProvider((({startPlugins:e})=>{const{unifiedSearch:{autocomplete:t}}=e;return{autocomplete:t}}))},f=new o.PluginServices,b=new o.PluginServiceRegistry(g)},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){"use strict";n.r(t),n.d(t,"CONTROL_GROUP_TYPE",(function(){return P.CONTROL_GROUP_TYPE})),n.d(t,"OPTIONS_LIST_CONTROL",(function(){return P.OPTIONS_LIST_CONTROL})),n.d(t,"RANGE_SLIDER_CONTROL",(function(){return P.RANGE_SLIDER_CONTROL})),n.d(t,"TIME_SLIDER_CONTROL",(function(){return P.TIME_SLIDER_CONTROL})),n.d(t,"ControlGroupContainerFactory",(function(){return I.c})),n.d(t,"controlGroupInputBuilder",(function(){return I.e})),n.d(t,"OptionsListEmbeddableFactory",(function(){return options_list_embeddable_factory_OptionsListEmbeddableFactory})),n.d(t,"RangeSliderEmbeddableFactory",(function(){return range_slider_embeddable_factory_RangeSliderEmbeddableFactory})),n.d(t,"ACTION_EDIT_CONTROL",(function(){return I.b})),n.d(t,"ACTION_DELETE_CONTROL",(function(){return I.a})),n.d(t,"ControlGroupRenderer",(function(){return I.d})),n.d(t,"plugin",(function(){return R}));var o=n(20),i=n(10),r=n(1),s=n.n(r),a=n(6),l=n.n(a),c=n(0),u=n(3),d=n(25);const p="optionsListDataView";var g=n(31),f=n.n(g),b=n(5),m=n.n(b),h=n(8),v=n(4),O=n(17),S=n(13),_=n(9),y={name:"1u81noh",styles:"margin-top:0px!important"};const T=({label:e,tooltip:t})=>Object(v.jsx)(h.EuiFlexGroup,{alignItems:"center",gutterSize:"xs",responsive:!1},Object(v.jsx)(h.EuiFlexItem,{grow:!1},e),Object(v.jsx)(h.EuiFlexItem,{grow:!1,css:y},Object(v.jsx)(h.EuiIconTip,{content:t,position:"right"}))),L=[{id:"multi",label:_.a.editor.selectionTypes.multi.getLabel(),"data-test-subj":"optionsListControl__multiSearchOptionAdditionalSetting"},{id:"single",label:_.a.editor.selectionTypes.single.getLabel(),"data-test-subj":"optionsListControl__singleSearchOptionAdditionalSetting"}],w=[{id:"prefix",label:Object(v.jsx)(T,{label:_.a.editor.searchTypes.prefix.getLabel(),tooltip:_.a.editor.searchTypes.prefix.getTooltip()}),"data-test-subj":"optionsListControl__prefixSearchOptionAdditionalSetting"},{id:"wildcard",label:Object(v.jsx)(T,{label:_.a.editor.searchTypes.wildcard.getLabel(),tooltip:_.a.editor.searchTypes.wildcard.getTooltip()}),"data-test-subj":"optionsListControl__wildcardSearchOptionAdditionalSetting"}],E=({initialInput:e,onChange:t,fieldType:n})=>{var o,r,s,a,l;const[c,u]=Object(b.useState)({sortDirection:null!==(o=null==e||null===(r=e.sort)||void 0===r?void 0:r.direction)&&void 0!==o?o:S.a.direction,sortBy:null!==(s=null==e||null===(a=e.sort)||void 0===a?void 0:a.by)&&void 0!==s?s:S.a.by,searchTechnique:null==e?void 0:e.searchTechnique,runPastTimeout:null==e?void 0:e.runPastTimeout,singleSelect:null==e?void 0:e.singleSelect,hideExclude:null==e?void 0:e.hideExclude,hideExists:null==e?void 0:e.hideExists,hideSort:null==e?void 0:e.hideSort}),{loading:d,value:p}=f()((async()=>{const{optionsList:e}=O.a.getServices();return e.getAllowExpensiveQueries()}),[]);return Object(b.useEffect)((()=>{Object(S.b)(n).includes(c.sortBy)||(t({sort:S.a}),u((e=>({...e,sortBy:S.a.by,sortDirection:S.a.direction}))))}),[n,t,c.sortBy]),Object(v.jsx)(m.a.Fragment,null,Object(v.jsx)(h.EuiFormRow,{label:_.a.editor.getSelectionOptionsTitle(),"data-test-subj":"optionsListControl__selectionOptionsRadioGroup"},Object(v.jsx)(h.EuiRadioGroup,{options:L,idSelected:c.singleSelect?"single":"multi",onChange:e=>{const n="single"===e;t({singleSelect:n}),u((e=>({...e,singleSelect:n})))}})),d?Object(v.jsx)(h.EuiFormRow,null,Object(v.jsx)(h.EuiLoadingSpinner,{size:"l"})):p&&"ip"!==n&&Object(v.jsx)(h.EuiFormRow,{label:_.a.editor.getSearchOptionsTitle(),"data-test-subj":"optionsListControl__searchOptionsRadioGroup"},Object(v.jsx)(h.EuiRadioGroup,{options:w,idSelected:null!==(l=c.searchTechnique)&&void 0!==l?l:i.b,onChange:e=>{const n=e;t({searchTechnique:n}),u((e=>({...e,searchTechnique:n})))}})),Object(v.jsx)(h.EuiFormRow,{label:_.a.editor.getAdditionalSettingsTitle()},Object(v.jsx)(h.EuiSwitch,{label:Object(v.jsx)(T,{label:_.a.editor.getRunPastTimeoutTitle(),tooltip:_.a.editor.getRunPastTimeoutTooltip()}),checked:Boolean(c.runPastTimeout),onChange:()=>{t({runPastTimeout:!c.runPastTimeout}),u((e=>({...e,runPastTimeout:!e.runPastTimeout})))},"data-test-subj":"optionsListControl__runPastTimeoutAdditionalSetting"})))};class options_list_embeddable_factory_OptionsListEmbeddableFactory{constructor(){s()(this,"type",i.a),s()(this,"canCreateNew",(()=>!1)),s()(this,"presaveTransformFunction",((e,t)=>(t&&(e.fieldName&&!l()(e.fieldName,t.getInput().fieldName)||e.dataViewId&&!l()(e.dataViewId,t.getInput().dataViewId))&&(e.selectedOptions=void 0,e.existsSelected=void 0,e.exclude=void 0,e.sort=void 0),e))),s()(this,"isFieldCompatible",(e=>!e.spec.scripted&&(e.aggregatable&&"string"===e.type||"boolean"===e.type||"ip"===e.type))),s()(this,"controlEditorOptionsComponent",E),s()(this,"isEditable",(()=>Promise.resolve(!0))),s()(this,"getDisplayName",(()=>c.i18n.translate("controls.optionsList.displayName",{defaultMessage:"Options list"}))),s()(this,"getIconType",(()=>"editorChecklist")),s()(this,"getDescription",(()=>c.i18n.translate("controls.optionsList.description",{defaultMessage:"Add a menu for selecting field values."}))),s()(this,"inject",((e,t)=>{const n={...e};return t.forEach((e=>{e.name===p&&(n.dataViewId=e.id)})),n})),s()(this,"extract",(e=>{const t={...e},n=[];return"dataViewId"in t&&(n.push({name:p,type:d.DATA_VIEW_SAVED_OBJECT_TYPE,id:t.dataViewId}),delete t.dataViewId),{state:t,references:n}}))}async create(e,t){const o=await Object(u.lazyLoadReduxToolsPackage)(),{OptionsListEmbeddable:i}=await Promise.all([n.e(0),n.e(5)]).then(n.bind(null,119));return Promise.resolve(new i(o,e,{},t))}}var x=n(11);const C="rangeSliderDataView";class range_slider_embeddable_factory_RangeSliderEmbeddableFactory{constructor(){s()(this,"type",x.a),s()(this,"getDisplayName",(()=>c.i18n.translate("controls.rangeSlider.displayName",{defaultMessage:"Range slider"}))),s()(this,"getDescription",(()=>c.i18n.translate("controls.rangeSlider.description",{defaultMessage:"Add a control for selecting a range of field values."}))),s()(this,"getIconType",(()=>"controlsHorizontal")),s()(this,"canCreateNew",(()=>!1)),s()(this,"isEditable",(()=>Promise.resolve(!0))),s()(this,"presaveTransformFunction",((e,t)=>(t&&(e.fieldName&&!l()(e.fieldName,t.getInput().fieldName)||e.dataViewId&&!l()(e.dataViewId,t.getInput().dataViewId))&&(e.value=["",""]),e))),s()(this,"isFieldCompatible",(e=>e.aggregatable&&"number"===e.type)),s()(this,"inject",((e,t)=>{const n={...e};return t.forEach((e=>{e.name===C&&(n.dataViewId=e.id)})),n})),s()(this,"extract",(e=>{const t={...e},n=[];return"dataViewId"in t&&(n.push({name:C,type:d.DATA_VIEW_SAVED_OBJECT_TYPE,id:t.dataViewId}),delete t.dataViewId),{state:t,references:n}}))}async create(e,t){const o=await Object(u.lazyLoadReduxToolsPackage)(),{RangeSliderEmbeddable:i}=await Promise.all([n.e(0),n.e(3)]).then(n.bind(null,121));return Promise.resolve(new i(o,e,{},t))}}class time_slider_embeddable_factory_TimeSliderEmbeddableFactory{constructor(){s()(this,"type",P.TIME_SLIDER_CONTROL),s()(this,"isFieldCompatible",(()=>!1)),s()(this,"isEditable",(()=>Promise.resolve(!1))),s()(this,"canCreateNew",(()=>!1)),s()(this,"getDisplayName",(()=>c.i18n.translate("controls.timeSlider.displayName",{defaultMessage:"Time slider"}))),s()(this,"getIconType",(()=>"clock")),s()(this,"getDescription",(()=>c.i18n.translate("controls.timeSlider.description",{defaultMessage:"Add a slider for selecting a time range"}))),s()(this,"inject",((e,t)=>({...e}))),s()(this,"extract",(e=>({state:{...e},references:[]})))}async create(e,t){const o=await Object(u.lazyLoadReduxToolsPackage)(),{TimeSliderControlEmbeddable:i}=await n.e(4).then(n.bind(null,120));return Promise.resolve(new i(o,e,{},t))}}n(18);var j=n(19);class plugin_ControlsPlugin{async startControlsKibanaServices(e,t){const{registry:o,pluginServices:i}=await Promise.resolve().then(n.bind(null,33));i.setRegistry(o.start({coreStart:e,startPlugins:t}))}transferEditorFunctions(e,t){var n;t.controlEditorOptionsComponent=null!==(n=e.controlEditorOptionsComponent)&&void 0!==n?n:void 0,t.presaveTransformFunction=e.presaveTransformFunction,t.isFieldCompatible=e.isFieldCompatible}setup(e,t){const{registerControlType:n}=j.a,{embeddable:o}=t;return e.getStartServices().then((([,e])=>{o.registerEmbeddableFactory(P.CONTROL_GROUP_TYPE,new I.c(e.embeddable));const t=new options_list_embeddable_factory_OptionsListEmbeddableFactory,i=o.registerEmbeddableFactory(P.OPTIONS_LIST_CONTROL,t)();this.transferEditorFunctions(t,i),n(i);const r=new range_slider_embeddable_factory_RangeSliderEmbeddableFactory,s=o.registerEmbeddableFactory(P.RANGE_SLIDER_CONTROL,r)();this.transferEditorFunctions(r,s),n(s);const a=new time_slider_embeddable_factory_TimeSliderEmbeddableFactory,l=o.registerEmbeddableFactory(P.TIME_SLIDER_CONTROL,a)();this.transferEditorFunctions(a,l),n(l)})),{registerControlType:n}}start(e,t){this.startControlsKibanaServices(e,t).then((async()=>{const{uiActions:e}=t,{DeleteControlAction:i}=await n.e(7).then(n.bind(null,118)),r=new i;e.registerAction(r),e.attachAction(o.PANEL_HOVER_TRIGGER,r.id);const{EditControlAction:s}=await Promise.all([n.e(0),n.e(1),n.e(8)]).then(n.bind(null,122)),a=new s(r);e.registerAction(a),e.attachAction(o.PANEL_HOVER_TRIGGER,a.id);const{ClearControlAction:l}=await n.e(6).then(n.bind(null,123)),c=new l;e.registerAction(c),e.attachAction(o.PANEL_HOVER_TRIGGER,c.id)}));const{getControlFactory:i,getControlTypes:r}=j.a;return{getControlFactory:i,getControlTypes:r}}stop(){}}var P=n(7),I=n(15);function R(){return new plugin_ControlsPlugin}},function(e,t,n){n(37),__kbnBundles__.define("plugin/controls/public",n,35),__kbnBundles__.define("plugin/controls/common",n,7)},function(e,t,n){n.p=window.__kbnPublicPath__.controls},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(29),i=n(5),r=o.__importDefault(n(39));t.default=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={loading:!1});var s=i.useRef(0),a=r.default(),l=i.useState(n),c=l[0],u=l[1],d=i.useCallback((function(){for(var t=[],n=0;n