/*! 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,i=t[0],o=t[1],s=0,l=[];so(e)));return n+`/app/exploratory-view/#?reportType=${e}&sr=${u(a.a.encode(r))}`}function u(e){return e&&/[\/?@&=+#]/.test(e)?encodeURIComponent(e):e}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.r(t),n.d(t,"dataViewList",(function(){return h})),n.d(t,"getDataTypeIndices",(function(){return k})),n.d(t,"isParamsSame",(function(){return S})),n.d(t,"ObservabilityDataViews",(function(){return observability_data_views_ObservabilityDataViews}));var r=n(9),a=n.n(r),i=n(12),o=n(16),s=n(10),u=n(15),l=n(3);const c=[{field:"monitor.duration.us",format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},{field:l.n,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},{field:l.j,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},{field:l.i,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},{field:l.h,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},{field:l.f,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}}],d={type:"long",format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",outputPrecision:1,showSuffix:!0,useShortSuffix:!0}}},f=[{name:l.g,field:d},{name:l.c,field:d},{name:l.e,field:d},{name:l.p,field:d},{name:l.k,field:d},{name:l.l,field:d},{name:l.q,field:d},{name:l.m,field:d}];var p=n(19);function m(e){if(e)return Object(p.uniq)([e.transaction,e.metric]).join(",")}var b=n(4);const x=[{field:b.l,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"asSeconds",showSuffix:!0,outputPrecision:1,useShortSuffix:!0}}},{field:b.c,format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",showSuffix:!0,useShortSuffix:!0}}},{field:b.e,format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",showSuffix:!0,useShortSuffix:!0}}},{field:b.k,format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",showSuffix:!0,useShortSuffix:!0}}},{field:b.d,format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",showSuffix:!0,useShortSuffix:!0}}},{field:b.m,format:{id:"duration",params:{inputFormat:"milliseconds",outputFormat:"humanizePrecise",showSuffix:!0,useShortSuffix:!0}}}],g=[{field:b.l,format:{id:"duration",params:{inputFormat:"microseconds",outputFormat:"asMilliseconds",outputPrecision:0,showSuffix:!0,useShortSuffix:!0}}},{field:b.g,format:{id:"bytes",params:{}}},{field:b.f,format:{id:"percent",params:{}}}],y={infra_logs:null,infra_metrics:[{field:"system.cpu.total.norm.pct",format:{id:"percent",params:{}}},{field:"docker.cpu.total.pct",format:{id:"percent",params:{}}},{field:"kubernetes.pod.cpu.usage.node.pct",format:{id:"percent",params:{}}},{field:"system.memory.used.pct",format:{id:"percent",params:{}}}],ux:x,apm:g,uptime:c,synthetics:c,mobile:g,alerts:null},w={infra_logs:null,infra_metrics:null,ux:null,apm:null,uptime:f,synthetics:f,mobile:null,alerts:null};function _(e){return{runtimeFields:w[e],formats:y[e]}}const h={synthetics:"synthetics_static_index_pattern_id",uptime:"uptime_static_index_pattern_id",apm:"apm_static_index_pattern_id",ux:"rum_static_index_pattern_id",infra_logs:"infra_logs_static_index_pattern_id",infra_metrics:"infra_metrics_static_index_pattern_id",mobile:"mobile_static_index_pattern_id",alerts:"alerts_static_index_pattern_id"},V=(e,t)=>`${t}`,v=(e,t)=>{var n;const r=t.replace(/[^A-Z0-9]+/gi,"_").toLowerCase();return`${null!==(n=null==h?void 0:h[e])&&void 0!==n?n:e}_${r}`};async function k(e){var t,n;switch(e){case"synthetics":return{hasData:!0,indices:"synthetics-*"};case"mobile":case"ux":case"apm":const r=await(null===(t=Object(s.a)("apm"))||void 0===t?void 0:t.hasData());return{hasData:Boolean(null==r?void 0:r.hasData),indices:m(null==r?void 0:r.indices)};case"alerts":return{hasData:!0,indices:".alerts-observability*"};default:const a=await(null===(n=Object(s.a)(e))||void 0===n?void 0:n.hasData());return{hasData:Boolean(null==a?void 0:a.hasData),indices:null==a?void 0:a.indices}}}function S(e,t){const n=(null==e?void 0:e.inputFormat)===(null==t?void 0:t.inputFormat)&&(null==e?void 0:e.outputFormat)===(null==t?void 0:t.outputFormat)&&(null==e?void 0:e.useShortSuffix)===(null==t?void 0:t.useShortSuffix)&&(null==e?void 0:e.showSuffix)===(null==t?void 0:t.showSuffix);return void 0!==(null==t?void 0:t.outputPrecision)?t.outputPrecision===(null==e?void 0:e.outputPrecision)&&n:n}class observability_data_views_ObservabilityDataViews{constructor(e,t){a()(this,"dataViews",void 0),a()(this,"adHocDataViews",!1),this.dataViews=e,this.adHocDataViews=null!=t&&t}async createDataView(e,t){const n=V(0,t),{runtimeFields:r}=_(e),a=v(e,t);try{const t=await this.dataViews.create({id:a,title:n,timeFieldName:"@timestamp",fieldFormats:this.getFieldFormats(e),name:u.b[e],allowNoIndex:!0},!1,!1);if(0===t.matchedIndices.length)throw new o.DataViewMissingIndices("No indices match pattern");return null!==r&&r.forEach((({name:e,field:n})=>{t.addRuntimeField(e,n)})),t}catch(e){e instanceof o.DataViewMissingIndices&&this.dataViews.clearInstanceCache(a)}}async createAndSavedDataView(e,t){const n=V(0,t),r=v(e,t);return await this.dataViews.createAndSave({title:n,id:r,timeFieldName:"@timestamp",fieldFormats:this.getFieldFormats(e),name:u.b[e],allowNoIndex:!0})}async validateFieldFormats(e,t){const{formats:n,runtimeFields:r}=_(e);if(n&&n.length>0){let e=!1;n.forEach((({field:n,format:r})=>{const a=t.getFieldByName(n);if(a){const i=t.getFormatterForField(a);S(i.params(),r.params)&&r.id===i.type.id||(t.setFieldFormat(n,r),e=!0)}}));let i=!1;if(null!==r){const e=t.getAllRuntimeFields();r.forEach((({name:n,field:r})=>{e[n]||(i=!0,t.addRuntimeField(n,r))}))}var a;(e||i)&&await(null===(a=this.dataViews)||void 0===a?void 0:a.updateSavedObject(t))}}getFieldFormats(e){var t;const n={};return(null!==(t=null==y?void 0:y[e])&&void 0!==t?t:[]).forEach((({field:e,format:t})=>{n[e]=t})),n}async getDataView(e,t){let n=t,r=!1;if(!n){const{indices:t,hasData:a}=await k(e);r=a,n=t}if(n&&(r||t))try{var a;const t=v(e,n),r=V(0,n);if(this.adHocDataViews)return await this.createDataView(e,n);const i=await(null===(a=this.dataViews)||void 0===a?void 0:a.get(t));return i.title!==r?await this.createAndSavedDataView(e,n):(this.validateFieldFormats(e,i),i)}catch(t){if(t instanceof i.SavedObjectNotFound)return await this.createAndSavedDataView(e,n)}}}t.default=observability_data_views_ObservabilityDataViews},function(e,t){e.exports=__kbnSharedDeps__.StyledComponents},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(0);let a;!function(e){e.SYNTHETICS="synthetics",e.UPTIME="uptime",e.UX="ux",e.MOBILE="mobile",e.METRICS="infra_metrics",e.LOGS="infra_logs",e.ALERTS="alerts"}(a||(a={}));const i={[a.UX]:r.i18n.translate("xpack.exploratoryView.uxLabel",{defaultMessage:"User experience (RUM)"}),[a.SYNTHETICS]:r.i18n.translate("xpack.exploratoryView.syntheticsLabel",{defaultMessage:"Synthetics monitoring"}),[a.UPTIME]:r.i18n.translate("xpack.exploratoryView.uptimeLabel",{defaultMessage:"Uptime"}),[a.METRICS]:r.i18n.translate("xpack.exploratoryView.metricsLabel",{defaultMessage:"Metrics"}),[a.LOGS]:r.i18n.translate("xpack.exploratoryView.logsLabel",{defaultMessage:"Logs"}),[a.MOBILE]:r.i18n.translate("xpack.exploratoryView.mobileExperienceLabel",{defaultMessage:"Mobile experience"}),[a.ALERTS]:r.i18n.translate("xpack.exploratoryView.alertsLabel",{defaultMessage:"Alerts"})}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/dataViews/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";const r=n(36),a=n(37),i=n(38);function o(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?a(e):e}function l(e){return Array.isArray(e)?e.sort():"object"==typeof e?l(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function p(e,t){o((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const a="string"==typeof n&&n.split("").indexOf(e.arrayFormatSeparator)>-1?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const a of e.split("&")){let[e,o]=i(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator"].includes(t.arrayFormat)?o:u(o,t),n(u(e,t),o,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=f(n[e],t);else r[e]=f(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=l(n):e[t]=n,e}),Object.create(null))}t.extract=d,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";o((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const a=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[",a,"]"].join("")]:[...n,[s(t,e),"[",s(a,e),"]=",s(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[]"].join("")]:[...n,[s(t,e),"[]=",s(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[s(t,e),"=",s(r,e)].join("")]:[[n,s(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,s(t,e)]:[...n,[s(t,e),"=",s(r,e)].join("")]}}(t),a={};for(const t of Object.keys(e))n(t)||(a[t]=e[t]);const i=Object.keys(a);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const a=e[n];return void 0===a?"":null===a?s(n,t):Array.isArray(a)?a.reduce(r(n),[]).join("&"):s(n,t)+"="+s(a,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=c(e.url).split("?")[0]||"",a=t.extract(e.url),i=t.parse(a,{sort:!1}),o=Object.assign(i,e.query);let u=t.stringify(o,n);u&&(u=`?${u}`);let l=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(l=`#${s(e.fragmentIdentifier,n)}`),`${r}${u}${l}`}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t,n){e.exports=n(22)(1466)},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"k",(function(){return l})),n.d(t,"l",(function(){return c})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return f})),n.d(t,"o",(function(){return p})),n.d(t,"q",(function(){return m})),n.d(t,"c",(function(){return b})),n.d(t,"p",(function(){return x})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return y})),n.d(t,"m",(function(){return w})),n.d(t,"n",(function(){return _})),n.d(t,"j",(function(){return h})),n.d(t,"g",(function(){return V})),n.d(t,"f",(function(){return v})),n.d(t,"b",(function(){return k}));var r=n(29),a=n(0),i=n(4),o=n(2),s=n(3);const u={from:"now-1h",to:"now"},l=r.DOCUMENT_FIELD_NAME,c="RecordsPercentage",d="FORMULA_COLUMN",f={"user_agent.name":o.d,"user_agent.version":o.e,"user_agent.os.name":o.P,"client.geo.country_name":o.C,"user_agent.device.name":o.n,"observer.geo.name":o.O,"service.name":o.Z,"service.environment":o.r,"service.type":o.ab,"event.dataset":o.s,message:o.E,[i.e]:o.B,[i.c]:o.t,[i.k]:o.hb,[i.d]:o.u,[i.b]:o.h,[s.d]:o.h,[s.f]:o.l,[s.n]:o.db,[s.j]:o.B,[s.i]:o.t,[s.h]:o.S,[i.m]:o.c,[i.l]:o.S,[s.e]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.connect",{defaultMessage:"Connect"}),[s.g]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.dns",{defaultMessage:"DNS"}),[s.q]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.wait",{defaultMessage:"Wait"}),[s.m]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.ssl",{defaultMessage:"SSL"}),[s.c]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.blocked",{defaultMessage:"Blocked"}),[s.l]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.send",{defaultMessage:"Send"}),[s.k]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.receive",{defaultMessage:"Receive"}),[s.p]:a.i18n.translate("xpack.exploratoryView.expView.synthetics.total",{defaultMessage:"Total"}),"kibana.alert.rule.category":a.i18n.translate("xpack.exploratoryView.expView.alerts.category",{defaultMessage:"Rule category"}),"kibana.alert.rule.name":a.i18n.translate("xpack.exploratoryView.expView.alerts.name",{defaultMessage:"Alert name"}),"kibana.alert.status":a.i18n.translate("xpack.exploratoryView.expView.alerts.status",{defaultMessage:"Alert status"}),"monitor.id":o.I,"monitor.status":o.K,[s.a]:o.H,[s.o]:o.eb,"agent.hostname":o.a,"agent.type":o.b,"host.hostname":o.w,"monitor.name":o.J,"monitor.type":o.L,"url.port":o.W,"url.full":o.kb,tags:o.gb,"performance.metric":o.F,"Business.KPI":o.y,"http.request.method":o.X,percentile:"Percentile",LABEL_FIELDS_FILTER:o.A,LABEL_FIELDS_BREAKDOWN:"Labels field"};let p;o.U,o.z,o.j,o.m,o.cb,o.v,function(e){e.KPI="kpi-over-time",e.DISTRIBUTION="data-distribution",e.CORE_WEB_VITAL="core-web-vitals",e.DEVICE_DISTRIBUTION="device-data-distribution",e.SINGLE_METRIC="single-metric",e.HEATMAP="heatmap"}(p||(p={}));const m="USE_BREAK_DOWN_COLUMN",b="FILTER_RECORDS",x="TERMS_COLUMN",g="operation",y="percentile",w="REPORT_METRIC_FIELD",_="REPORT_METRIC_FIELD_TIMESTAMP",h=["99th","95th","90th","75th","50th","25th"],V="LABEL_FIELDS_FILTER",v="LABEL_FIELDS_BREAKDOWN",k="ENVIRONMENT_ALL"},function(e,t,n){n.r(t);var r=__kbnBundles__.get("entry/core/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";var r=n(13);n.d(t,"a",(function(){return r.ObservabilityDataViews})),n.d(t,"b",(function(){return r.getDataTypeIndices}))},function(e,t){e.exports=__kbnSharedDeps__.KbnRison},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(31),i=function(){};t.default=function(e,t,n){if(!a.isClient)return[t,i,i];if(!e)throw new Error("useLocalStorage key may not be falsy");var o=n?n.raw?function(e){return e}:n.deserializer:JSON.parse,s=r.useState((function(){try{var r=n?n.raw?String:n.serializer:JSON.stringify,a=localStorage.getItem(e);return null!==a?o(a):(t&&localStorage.setItem(e,r(t)),t)}catch(e){return t}})),u=s[0],l=s[1],c=r.useCallback((function(t){try{var r="function"==typeof t?t(u):t;if(void 0===r)return;var a;a=n?n.raw?"string"==typeof r?r:JSON.stringify(r):n.serializer?n.serializer(r):JSON.stringify(r):JSON.stringify(r),localStorage.setItem(e,a),l(o(a))}catch(e){}}),[e,l]),d=r.useCallback((function(){try{localStorage.removeItem(e),l(void 0)}catch(e){}}),[e,l]);return[u,c,d]}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/lens/common/constants");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDeepEqual=t.off=t.on=t.isClient=void 0;var r=n(30).__importDefault(n(35));t.isClient="object"==typeof window,t.on=function(e){for(var t=[],n=1;n{const[i,o]=Object(p.useState)({}),{dataViewTitle:s}=function(e,t){const[n,r]=V()(`${e}AppDataViewTitle`,""),a=null==t?void 0:t[e],{data:i}=Object(_.useFetcher)((async()=>a||(await Object(v.b)(e)).indices),[a,e]);return Object(p.useEffect)((()=>{i&&r(i)}),[r,i]),{dataViewTitle:n||a}}(n,a),{loading:u}=Object(_.useFetcher)((async()=>{if(s&&!i[n])if(t[s])o((e=>({...null!=e?e:{},[n]:t[s]})));else{const e=new k.ObservabilityDataViews(r,!0),a=await e.getDataView(n,s);t[s]=a,o((e=>({...null!=e?e:{},[n]:a})))}}),[s,n,JSON.stringify(e)]);return{dataViews:i,loading:u&&!i[n]}},E=m.a.lazy((()=>Promise.all([n.e(0),n.e(1),n.e(7)]).then(n.bind(null,97))));function O(e){return m.a.createElement(m.a.Suspense,{fallback:m.a.createElement(b.EuiLoadingSpinner,null)},m.a.createElement(E,e))}function L(e){const{lens:t,dataViews:n,uiSettings:r}=e,a={},i={};return o=>{Object(p.useEffect)((()=>{e.data.search.session.getSessionId()||e.data.search.session.start()}),[]);const{dataTypesIndexPatterns:s,attributes:u,customHeight:l}=o;if(!n||!t||!u||0===(null==u?void 0:u.length))return null;const c=u[0],d=null==r?void 0:r.get("theme:darkMode"),{data:y,loading:w}=Object(_.useFetcher)((async()=>t.stateHelperApi()),[]),[h,V]=Object(p.useState)(0),v=Object(p.useCallback)((e=>{e&&o.id&&(e=>{const{attributes:t}=e;if(!t||0===(null==t?void 0:t.length))return!1;const n=t[0],{time:r}=n,{from:a,to:i}=r;return t.every((e=>{const{time:t}=e;return t.from===a&&t.to===i}))})(o)&&!i[o.id]&&(i[o.id]=c.time),V((e=>e+1))}),[o,c.time]),{dataViews:k,loading:E}=S({series:c,dataViewCache:a,dataViewsService:n,dataTypesIndexPatterns:s,seriesDataType:null==c?void 0:c.dataType}),L=Object(p.useMemo)((()=>{const e={...o};var t;return o.sparklineMode&&(e.axisTitlesVisibility={x:!1,yRight:!1,yLeft:!1},e.legendIsVisible=!1,e.hideTicks=!0),o.id&&i[o.id]&&h<2?e.attributes=null===(t=o.attributes)||void 0===t?void 0:t.map((e=>({...e,time:i[o.id]}))):o.id&&(i[o.id]=c.time),e}),[h,o,c.time]);return 0===Object.keys(k).length||E||!y||w?m.a.createElement(D,{customHeight:l},m.a.createElement(b.EuiLoadingSpinner,{size:"l"})):k[null==c?void 0:c.dataType]?m.a.createElement(b.EuiErrorBoundary,null,m.a.createElement(x.EuiThemeProvider,{darkMode:d},m.a.createElement(g.KibanaContextProvider,{services:e},m.a.createElement(M,{customHeight:o.customHeight,"data-test-subj":o.dataTestSubj},m.a.createElement(O,f()({},L,{dataViewState:k,lens:t,lensFormulaHelper:null==y?void 0:y.formula,searchSessionId:e.data.search.session.getSessionId(),onLoad:v})))))):m.a.createElement(P,{height:o.customHeight})}}const M=w.a.div.withConfig({displayName:"Wrapper",componentId:"sc-1xusw6d-0"})(["height:",";"],(e=>e.customHeight?`${e.customHeight};`:"100%;")),D=w.a.div.withConfig({displayName:"LoadingWrapper",componentId:"sc-1xusw6d-1"})(["height:",";display:flex;align-items:center;justify-content:center;"],(e=>e.customHeight?`${e.customHeight};`:"100%;"));function P({height:e}){return m.a.createElement(b.EuiFlexGroup,{alignItems:"center",justifyContent:"center",style:{height:null!=e?e:"100%"}},m.a.createElement(b.EuiFlexItem,{grow:!1},m.a.createElement("span",null,j)))}const j=i.i18n.translate("xpack.exploratoryView.noData",{defaultMessage:"No data"});var F=n(11),T=n(10);const I="/app/exploratory-view";class plugin_Plugin{constructor(e){a()(this,"appUpdater$",new l.BehaviorSubject((()=>({})))),this.initContext=e}setup(e,t){const r=this.appUpdater$;return e.application.register({appRoute:I,category:c.DEFAULT_APP_CATEGORIES.observability,euiIconType:"logoObservability",id:"exploratory-view",mount:async r=>{const{renderApp:a}=await Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,95)),[i,o]=await e.getStartServices();return a({core:i,appMountParameters:r,plugins:{...o},usageCollection:t.usageCollection,isDev:this.initContext.env.mode.dev})},title:i.i18n.translate("xpack.exploratoryView.appTitle",{defaultMessage:"Exploratory View"}),searchable:!1,updater$:r,keywords:["observability","monitor","logs","metrics","apm","performance","trace","rum","user","experience"]}),{register:T.b}}start(e,t){return this.appUpdater$.next((()=>({navLinkStatus:u.hidden}))),{createExploratoryViewUrl:F.b,getAppDataView:(r=t.dataViews,async(e,t)=>{try{const{ObservabilityDataViews:a}=await Promise.resolve().then(n.bind(null,13)),i=new a(r);return await i.getDataView(e,t)}catch(e){return null}}),ExploratoryViewEmbeddable:L({...e,...t})};var r}}var R=n(5);const C=Object(p.lazy)((()=>n.e(8).then(n.bind(null,63))));function N(e){return m.a.createElement(p.Suspense,{fallback:null},m.a.createElement(C,e))}const A=Object(p.lazy)((()=>n.e(4).then(n.bind(null,70))));function U(e){return m.a.createElement(p.Suspense,{fallback:null},m.a.createElement(A,e))}const B=Object(p.lazy)((()=>n.e(9).then(n.bind(null,79))));function z(e){return m.a.createElement(p.Suspense,{fallback:null},m.a.createElement(B,e))}const H=Object(p.lazy)((()=>n.e(6).then(n.bind(null,81))));function $(e){return m.a.createElement(p.Suspense,{fallback:null},m.a.createElement(H,e))}const K=Object(p.lazy)((()=>n.e(0).then(n.bind(null,94))));function q(e){return m.a.createElement(p.Suspense,{fallback:null},m.a.createElement(K,e))}var W=n(6),Y=n(17),J=n(12);function G(e){return e?Object(Y.parse)(e.slice(1),{sort:!1}):{}}function Q(e){const t=J.url.encodeQuery(e,(e=>encodeURIComponent(e).replace(/%3A/g,":")));return Object(Y.stringify)(t,{sort:!1,encode:!1})}const X=e=>new plugin_Plugin(e)},function(e,t,n){n(34),__kbnBundles__.define("plugin/exploratoryView/public",n,32),__kbnBundles__.define("plugin/exploratoryView/common",n,39)},function(e,t,n){n.p=window.__kbnPublicPath__.exploratoryView},function(e,t,n){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;0!=a--;){var o=i[a];if(!("_owner"===o&&t.$$typeof||e(t[o],n[o])))return!1}return!0}return t!=t&&n!=n}},function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},function(e,t,n){"use strict";var r="%[a-f0-9]{2}",a=new RegExp("("+r+")|([^%]+?)","gi"),i=new RegExp("("+r+")+","gi");function o(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function s(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(a)||[],n=1;n{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict";n.r(t)},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t){e.exports=__kbnSharedDeps__.EmotionReact},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/observabilityAIAssistant/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.IoTs},function(e,t){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/unifiedSearch/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/cases/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/cases/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Moment},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/visualizations/common/constants");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/embeddable/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/data/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}]);