/*! 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.maps_bundle_jsonpfunction=window.maps_bundle_jsonpfunction||[]).push([[6],{296:function(e,t,n){e.exports=h,h.Minimatch=d;var r=function(){try{return n(515)}catch(e){}}()||{sep:"/"};h.sep=r.sep;var i=h.GLOBSTAR=d.GLOBSTAR={},a=n(516),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},o="[^/]",l=o+"*?",c="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{}),u=/\/+/;function p(e,t){t=t||{};var n={};return Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function h(e,t,n){return f(t),n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&new d(t,n).match(e)}function d(e,t){if(!(this instanceof d))return new d(e,t);f(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===r.sep||(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function b(e,t){return t||(t=this instanceof d?this.options:{}),e=void 0===e?this.pattern:e,f(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:a(e)}h.filter=function(e,t){return t=t||{},function(n,r,i){return h(n,e,t)}},h.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return h;var t=h,n=function(n,r,i){return t(n,r,p(e,i))};return(n.Minimatch=function(n,r){return new t.Minimatch(n,p(e,r))}).defaults=function(n){return t.defaults(p(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,p(e,r))},n.defaults=function(n){return t.defaults(p(e,n))},n.makeRe=function(n,r){return t.makeRe(n,p(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,p(e,r))},n.match=function(n,r,i){return t.match(n,r,p(e,i))},n},d.defaults=function(e){return h.defaults(e).Minimatch},d.prototype.debug=function(){},d.prototype.make=function(){var e=this.pattern,t=this.options;if(t.nocomment||"#"!==e.charAt(0))if(e){this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(u)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0},d.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=0;if(!this.options.nonegate){for(var r=0,i=e.length;r65536)throw new TypeError("pattern is too long")};d.prototype.parse=function(e,t){f(e);var n=this.options;if("**"===e){if(!n.noglobstar)return i;e="*"}if(""===e)return"";var r,a="",u=!!n.nocase,p=!1,h=[],d=[],b=!1,y=-1,m=-1,v="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",O=this;function C(){if(r){switch(r){case"*":a+=l,u=!0;break;case"?":a+=o,u=!0;break;default:a+="\\"+r}O.debug("clearStateChar %j %j",r,a),r=!1}}for(var T,_=0,x=e.length;_-1;L--){var N=d[L],P=a.slice(0,N.reStart),j=a.slice(N.reStart,N.reEnd-8),D=a.slice(N.reEnd-8,N.reEnd),U=a.slice(N.reEnd);D+=U;var w=P.split("(").length-1,F=U;for(_=0;_=0&&!(i=e[a]);a--);for(a=0;a>> no match, partial?",e,h,t,d),h!==o))}if("string"==typeof u?(c=p===u,this.debug("string match",u,p,c)):(c=p.match(u),this.debug("pattern match",u,p,c)),!c)return!1}if(a===o&&s===l)return!0;if(a===o)return n;if(s===l)return a===o-1&&""===e[a];throw new Error("wtf?")}},301:function(e,t,n){"use strict";n.d(t,"b",(function(){return D})),n.d(t,"a",(function(){return E}));var r=n(4),i=n(1),a=n(0),s=n(2),o=n.n(s),l=n(14),c=n(3);let u;!function(e){e.APM_RUM_PERFORMANCE="APM_RUM_PERFORMANCE",e.APM_RUM_TRAFFIC="APM_RUM_TRAFFIC"}(u||(u={}));const p=[{value:u.APM_RUM_PERFORMANCE,text:i.i18n.translate("xpack.maps.observability.apmRumPerformanceLabel",{defaultMessage:"APM RUM Performance"})},{value:u.APM_RUM_TRAFFIC,text:i.i18n.translate("xpack.maps.observability.apmRumTrafficLabel",{defaultMessage:"APM RUM Traffic"})}];function h(e){const t=e.value?p:[{value:"",text:""},...p];return Object(c.jsx)(l.EuiFormRow,{label:i.i18n.translate("xpack.maps.observability.layerLabel",{defaultMessage:"Layer"})},Object(c.jsx)(l.EuiSelect,{options:t,value:e.value?e.value:"",onChange:function(t){e.onChange(t.target.value)}}))}let d;!function(e){e.TRANSACTION_DURATION="TRANSACTION_DURATION",e.COUNT="COUNT",e.UNIQUE_COUNT="UNIQUE_COUNT"}(d||(d={}));const b=[{value:d.TRANSACTION_DURATION,text:i.i18n.translate("xpack.maps.observability.transactionDurationLabel",{defaultMessage:"Transaction duraction"})}],f=[{value:d.COUNT,text:i.i18n.translate("xpack.maps.observability.countLabel",{defaultMessage:"Count"})},{value:d.UNIQUE_COUNT,text:i.i18n.translate("xpack.maps.observability.uniqueCountLabel",{defaultMessage:"Unique count"})}];function g(e){return e===u.APM_RUM_PERFORMANCE?b:e===u.APM_RUM_TRAFFIC?f:[]}function y(e){return e.layer&&e.value?Object(c.jsx)(l.EuiFormRow,{label:i.i18n.translate("xpack.maps.observability.metricLabel",{defaultMessage:"Metric"})},Object(c.jsx)(l.EuiSelect,{options:g(e.layer),value:e.value,onChange:function(t){e.onChange(t.target.value)}})):null}let m;!function(e){e.CHOROPLETH="CHOROPLETH",e.CLUSTERS="CLUSTERS",e.GRIDS="GRIDS",e.HEATMAP="HEATMAP"}(m||(m={}));const v=[{value:m.CHOROPLETH,text:i.i18n.translate("xpack.maps.observability.choroplethLabel",{defaultMessage:"World boundaries"})},{value:m.CLUSTERS,text:i.i18n.translate("xpack.maps.observability.clustersLabel",{defaultMessage:"Clusters"})},{value:m.GRIDS,text:i.i18n.translate("xpack.maps.observability.gridsLabel",{defaultMessage:"Grids"})},{value:m.HEATMAP,text:i.i18n.translate("xpack.maps.observability.heatMapLabel",{defaultMessage:"Heat map"})}];function O(e){return e.layer?Object(c.jsx)(l.EuiFormRow,{label:i.i18n.translate("xpack.maps.observability.displayLabel",{defaultMessage:"Display"})},Object(c.jsx)(l.EuiSelect,{options:v,value:e.value,onChange:function(t){e.onChange(t.target.value)}})):null}var C=n(41),T=n(94),_=n(82),x=n(121),I=n(137),M=n(72),S=n(122),R=n(79);const A="apm_static_index_pattern_id",E="traces-apm*,logs-apm*,metrics-apm*,apm-*",L=Object(R.i)();function N(e,t){return{type:a.Cb.DYNAMIC,options:{...L[a.Gb.FILL_COLOR].options,field:t,color:e===u.APM_RUM_PERFORMANCE?"Green to Red":"Yellow to Red",type:a.j.ORDINAL}}}function P(e){return e===m.HEATMAP?a.tb.HEATMAP:e===m.GRIDS?a.tb.GRID:a.tb.POINT}class observability_layer_template_ObservabilityLayerTemplate extends r.Component{constructor(...e){super(...e),o()(this,"state",{layer:null,metric:null,display:m.CHOROPLETH}),o()(this,"_onLayerChange",(e=>{const t={layer:e,metric:this.state.metric},n=g(e);n.find((e=>e.value===this.state.metric))||(n.length?t.metric=n[0].value:t.metric=null),this.setState(t,this._previewLayer)})),o()(this,"_onMetricChange",(e=>{this.setState({metric:e},this._previewLayer)})),o()(this,"_onDisplayChange",(e=>{this.setState({display:e},this._previewLayer)}))}_previewLayer(){const e=function({layer:e,metric:t,display:n}){if(!e||!t||!n)return null;const r=function(e){let t;return e!==u.APM_RUM_PERFORMANCE&&e!==u.APM_RUM_TRAFFIC||(t='processor.event:"transaction"'),t?{language:"kuery",query:t}:void 0}(e),s=function(e,t){let n,r;return e===u.APM_RUM_PERFORMANCE?n=i.i18n.translate("xpack.maps.observability.apmRumPerformanceLayerName",{defaultMessage:"Performance"}):e===u.APM_RUM_TRAFFIC&&(n=i.i18n.translate("xpack.maps.observability.apmRumTrafficLayerName",{defaultMessage:"Traffic"})),t===d.TRANSACTION_DURATION?r=i.i18n.translate("xpack.maps.observability.durationMetricName",{defaultMessage:"Duration"}):t===d.COUNT?r=i.i18n.translate("xpack.maps.observability.countMetricName",{defaultMessage:"Total"}):t===d.UNIQUE_COUNT&&(r=i.i18n.translate("xpack.maps.observability.uniqueCountMetricName",{defaultMessage:"Unique count"})),`[${n}] ${r}`}(e,t),o=function(e){return e===d.TRANSACTION_DURATION?{type:a.b.AVG,field:"transaction.duration.us"}:e===d.UNIQUE_COUNT?{type:a.b.UNIQUE_COUNT,field:"transaction.id"}:{type:a.b.COUNT}}(t);if(n===m.CHOROPLETH){const t=Object(C.v4)(),n=Object(T.a)({aggType:o.type,aggFieldName:"field"in o?o.field:"",rightSourceId:t});return M.b.createDescriptor({label:s,joins:[{leftField:"iso2",right:{type:a.Ab.ES_TERM_SOURCE,id:t,indexPatternId:A,term:"client.geo.country_iso_code",metrics:[o],whereQuery:r,applyGlobalQuery:!0,applyGlobalTime:!0,applyForceRefresh:!0}}],sourceDescriptor:x.a.createDescriptor({id:a.Jb,tooltipProperties:["name","iso2"]}),style:_.a.createDescriptor({[a.Gb.FILL_COLOR]:N(e,{name:n,origin:a.D.JOIN}),[a.Gb.LINE_COLOR]:{type:a.Cb.STATIC,options:{color:"#3d3d3d"}}})})}const l=I.a.createDescriptor({indexPatternId:A,geoField:"client.geo.location",metrics:[o],requestType:P(n),resolution:a.L.MOST_FINE});if(n===m.HEATMAP)return S.a.createDescriptor({label:s,query:r,sourceDescriptor:l});const c={name:Object(T.b)({aggType:o.type,aggFieldName:"field"in o?o.field:void 0}),origin:a.D.SOURCE},p={[a.Gb.FILL_COLOR]:N(e,c),[a.Gb.ICON_SIZE]:{type:a.Cb.DYNAMIC,options:{...L[a.Gb.ICON_SIZE].options,field:c}},[a.Gb.LINE_COLOR]:{type:a.Cb.STATIC,options:{color:"#3d3d3d"}}};return M.b.createDescriptor({label:s,query:r,sourceDescriptor:l,style:_.a.createDescriptor(p)})}({layer:this.state.layer,metric:this.state.metric,display:this.state.display});this.props.previewLayers(e?[e]:[])}render(){return Object(c.jsx)(l.EuiPanel,null,Object(c.jsx)(h,{value:this.state.layer,onChange:this._onLayerChange}),Object(c.jsx)(y,{layer:this.state.layer,value:this.state.metric,onChange:this._onMetricChange}),Object(c.jsx)(O,{layer:this.state.layer,value:this.state.display,onChange:this._onDisplayChange}))}}var j=n(5);const D={id:a.Hb.OBSERVABILITY,order:20,categories:[a.ab.ELASTICSEARCH,a.ab.SOLUTIONS],getIsDisabled:async()=>{try{return await Object(j.u)().get(A),!1}catch(e){return!0}},disabledReason:i.i18n.translate("xpack.maps.observability.disabledDesc",{defaultMessage:"Cannot find APM data view. To get started with Observably, go to Observability > Overview."}),description:i.i18n.translate("xpack.maps.observability.desc",{defaultMessage:"APM layers"}),icon:"logoObservability",renderWizard:e=>Object(c.jsx)(observability_layer_template_ObservabilityLayerTemplate,e),title:i.i18n.translate("xpack.maps.observability.title",{defaultMessage:"Observability"})}},515:function(e,t,n){e.exports=n(22)(1734)},516:function(e,t,n){var r=n(517),i=n(518);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),y(function(e){return e.split("\\\\").join(a).split("\\{").join(s).split("\\}").join(o).split("\\,").join(l).split("\\.").join(c)}(e),!0).map(p)):[]};var a="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",o="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function p(e){return e.split(a).join("\\").split(s).join("{").split(o).join("}").split(l).join(",").split(c).join(".")}function h(e){if(!e)return[""];var t=[],n=i("{","}",e);if(!n)return e.split(",");var r=n.pre,a=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+a+"}";var l=h(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}function d(e){return"{"+e+"}"}function b(e){return/^-?0\d/.test(e)}function f(e,t){return e<=t}function g(e,t){return e>=t}function y(e,t){var n=[],a=i("{","}",e);if(!a||/\$$/.test(a.pre))return[e];var s,l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),p=l||c,m=a.body.indexOf(",")>=0;if(!p&&!m)return a.post.match(/,.*\}/)?y(e=a.pre+"{"+a.body+o+a.post):[e];if(p)s=a.body.split(/\.\./);else if(1===(s=h(a.body)).length&&1===(s=y(s[0],!1).map(d)).length)return(C=a.post.length?y(a.post,!1):[""]).map((function(e){return a.pre+s[0]+e}));var v,O=a.pre,C=a.post.length?y(a.post,!1):[""];if(p){var T=u(s[0]),_=u(s[1]),x=Math.max(s[0].length,s[1].length),I=3==s.length?Math.abs(u(s[2])):1,M=f;_0){var L=new Array(E+1).join("0");A=R<0?"-"+L+A.slice(1):L+A}}v.push(A)}}else v=r(s,(function(e){return y(e,!1)}));for(var N=0;N=0&&c>0){if(e===t)return[l,c];for(r=[],a=n.length;u>=0&&!o;)u==l?(r.push(u),l=n.indexOf(e,u+1)):1==r.length?o=[r.pop(),c]:((i=r.pop())=0?l:c;r.length&&(o=[a,s])}return o}e.exports=r,r.range=a},522:function(e,t,n){"use strict";n.r(t),n.d(t,"createSecurityLayerDescriptors",(function(){return _})),n.d(t,"SecurityLayerWizardConfig",(function(){return L}));var r=n(296),i=n.n(r),a=n(1),s=n(14),o=n(0),l=n(72),c=n(97),u=n(82),p=n(112),h=n(281),d=n(79),b=n(301);const f=Object(d.i)(),g=Object(s.euiPaletteColorBlind)();function y(e){return b.a.split(",").map((t=>i()(e,t))).some(Boolean)}function m(e){return y(e)?"client.geo.location":"source.geo.location"}function v(e){return y(e)?"server.geo.location":"destination.geo.location"}function O(e,t,n){const r=p.ESSearchSource.createDescriptor({indexPatternId:e,geoField:m(t),scalingType:o.vb.TOP_HITS,topHitsSplitField:y(t)?"client.ip":"source.ip",tooltipProperties:y(t)?["host.name","client.ip","client.domain","client.geo.country_iso_code","client.as.organization.name"]:["host.name","source.ip","source.domain","source.geo.country_iso_code","source.as.organization.name"]}),i={[o.Gb.FILL_COLOR]:{type:o.Cb.STATIC,options:{color:g[1]}},[o.Gb.LINE_COLOR]:{type:o.Cb.STATIC,options:{color:"#FFFFFF"}},[o.Gb.LINE_WIDTH]:{type:o.Cb.STATIC,options:{size:2}},[o.Gb.SYMBOLIZE_AS]:{options:{value:o.Db.ICON}},[o.Gb.ICON]:{type:o.Cb.STATIC,options:{value:"home"}},[o.Gb.ICON_SIZE]:{type:o.Cb.STATIC,options:{size:8}}};return l.b.createDescriptor({label:a.i18n.translate("xpack.maps.sescurity.sourceLayerLabel",{defaultMessage:"{indexPatternTitle} | Source Point",values:{indexPatternTitle:t}}),parent:n,sourceDescriptor:r,style:u.a.createDescriptor(i)})}function C(e,t,n){const r=p.ESSearchSource.createDescriptor({indexPatternId:e,geoField:v(t),scalingType:o.vb.TOP_HITS,topHitsSplitField:y(t)?"server.ip":"destination.ip",tooltipProperties:y(t)?["host.name","server.ip","server.domain","server.geo.country_iso_code","server.as.organization.name"]:["host.name","destination.ip","destination.domain","destination.geo.country_iso_code","destination.as.organization.name"]}),i={[o.Gb.FILL_COLOR]:{type:o.Cb.STATIC,options:{color:g[2]}},[o.Gb.LINE_COLOR]:{type:o.Cb.STATIC,options:{color:"#FFFFFF"}},[o.Gb.LINE_WIDTH]:{type:o.Cb.STATIC,options:{size:2}},[o.Gb.SYMBOLIZE_AS]:{options:{value:o.Db.ICON}},[o.Gb.ICON]:{type:o.Cb.STATIC,options:{value:"marker"}},[o.Gb.ICON_SIZE]:{type:o.Cb.STATIC,options:{size:8}}};return l.b.createDescriptor({label:a.i18n.translate("xpack.maps.sescurity.destinationLayerLabel",{defaultMessage:"{indexPatternTitle} | Destination point",values:{indexPatternTitle:t}}),parent:n,sourceDescriptor:r,style:u.a.createDescriptor(i)})}function T(e,t,n){const r=h.a.createDescriptor({indexPatternId:e,sourceGeoField:m(t),destGeoField:v(t),metrics:[{type:o.b.SUM,field:y(t)?"client.bytes":"source.bytes"},{type:o.b.SUM,field:y(t)?"server.bytes":"destination.bytes"}]}),i={[o.Gb.LINE_COLOR]:{type:o.Cb.STATIC,options:{color:g[1]}},[o.Gb.LINE_WIDTH]:{type:o.Cb.DYNAMIC,options:{...f[o.Gb.LINE_WIDTH].options,field:{name:o.k,origin:o.D.SOURCE},minSize:1,maxSize:8}}};return l.b.createDescriptor({label:a.i18n.translate("xpack.maps.sescurity.lineLayerLabel",{defaultMessage:"{indexPatternTitle} | Line",values:{indexPatternTitle:t}}),parent:n,sourceDescriptor:r,style:u.a.createDescriptor(i)})}function _(e,t){const n=c.b.createDescriptor({label:t});return[O(e,t,n.id),C(e,t,n.id),T(e,t,n.id),n]}var x=n(4),I=n(5);async function M(){const e=Object(I.S)();let t;try{t=e.get("securitySolution:defaultIndex")}catch(e){return[]}return(await Object(I.u)().getCache()).filter((e=>t.some((t=>{var n;return i()(t,null==e||null===(n=e.attributes)||void 0===n?void 0:n.title)})))).map((e=>({id:e.id,title:e.attributes.title})))}var S=n(2),R=n.n(S),A=n(74),E=n(3);class index_pattern_select_IndexPatternSelect extends x.Component{constructor(...e){super(...e),R()(this,"_isMounted",!1),R()(this,"state",{hasLoaded:!1,options:[]}),R()(this,"_onChange",(e=>{const t=this.state.options.find((({value:t,text:n})=>e.target.value===t));""!==e.target.value&&t?this.props.onChange({id:t.value,title:t.text}):this.props.onChange(null)}))}componentWillUnmount(){this._isMounted=!1}componentDidMount(){this._isMounted=!0,this._loadOptions()}async _loadOptions(){const e=await M();this._isMounted&&this.setState({hasLoaded:!0,options:[{value:"",text:""},...e.map((({id:e,title:t})=>({value:e,text:t})))]})}render(){return this.state.hasLoaded?Object(E.jsx)(s.EuiFormRow,{label:Object(A.b)()},Object(E.jsx)(s.EuiSelect,{options:this.state.options,value:this.props.value?this.props.value:"",onChange:this._onChange})):null}}class security_layer_template_SecurityLayerTemplate extends x.Component{constructor(...e){super(...e),R()(this,"state",{indexPatternId:null,indexPatternTitle:null}),R()(this,"_onIndexPatternChange",(e=>{this.setState({indexPatternId:e?e.id:null,indexPatternTitle:e?e.title:null},this._previewLayer)}))}_previewLayer(){this.state.indexPatternId&&this.state.indexPatternTitle?this.props.previewLayers(_(this.state.indexPatternId,this.state.indexPatternTitle)):this.props.previewLayers([])}render(){return Object(E.jsx)(s.EuiPanel,null,Object(E.jsx)(index_pattern_select_IndexPatternSelect,{value:this.state.indexPatternId?this.state.indexPatternId:"",onChange:this._onIndexPatternChange}))}}const L={id:o.Hb.SECURITY,order:20,categories:[o.ab.ELASTICSEARCH,o.ab.SOLUTIONS],getIsDisabled:async()=>0===(await M()).length,disabledReason:a.i18n.translate("xpack.maps.security.disabledDesc",{defaultMessage:"Cannot find security data view. To get started with Security, go to Security > Overview."}),description:a.i18n.translate("xpack.maps.security.desc",{defaultMessage:"Security layers"}),icon:"logoSecurity",renderWizard:e=>Object(E.jsx)(security_layer_template_SecurityLayerTemplate,e),title:a.i18n.translate("xpack.maps.security.title",{defaultMessage:"Security"})}}}]);