/*! 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.canvas_bundle_jsonpfunction=window.canvas_bundle_jsonpfunction||[]).push([[4,17],{141:function(r,t,e){"use strict"; /*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function n(r){return 1==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r);var t}r.exports=function(r){var t,e;return!1!==n(r)&&"function"==typeof(t=r.constructor)&&!1!==n(e=t.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf")}},162:function(r,t,e){"use strict";e.d(t,"a",(function(){return s}));var n={};function o(r){if(!r.column)throw new Error("column is required for Elasticsearch range filters");const{from:t,to:e,column:n,filterGroup:o}=r;return{group:o,range:{[n]:{gte:t,lte:e}}}}function u(r){return{group:r.filterGroup,query_string:{query:r.query||"*"}}}function i(r){return{group:r.filterGroup,term:{[r.column]:{value:r.value}}}}e.r(n),e.d(n,"time",(function(){return o})),e.d(n,"luceneQueryString",(function(){return u})),e.d(n,"exactly",(function(){return i}));const c=r=>Array.isArray(r)?r.filter((r=>Boolean(r))):[];function s(r){return c(r.map((r=>{try{return function(r){if(!n[r.type])throw new Error(`Unknown filter type: ${r.type}`);try{return n[r.type](r)}catch(t){throw new Error(`Could not create elasticsearch filter from ${r.type}`)}}(r)}catch(r){return}})))}},63:function(r,t,e){"use strict";e.r(t),e.d(t,"ExpressionsService",(function(){return u.ExpressionsService})),e.d(t,"ServicesContext",(function(){return a})),e.d(t,"useServices",(function(){return f})),e.d(t,"withServices",(function(){return l})),e.d(t,"LegacyServicesProvider",(function(){return p})),e.d(t,"CanvasServiceProvider",(function(){return legacy_CanvasServiceProvider})),e.d(t,"services",(function(){return h})),e.d(t,"startLegacyServices",(function(){return d})),e.d(t,"stopServices",(function(){return v})),e.d(t,"searchService",(function(){return g})),e.d(t,"pluginServices",(function(){return y})),e.d(t,"useCustomElementService",(function(){return m})),e.d(t,"useDataViewsService",(function(){return w})),e.d(t,"useEmbeddablesService",(function(){return b})),e.d(t,"useExpressionsService",(function(){return A})),e.d(t,"useFiltersService",(function(){return x})),e.d(t,"useLabsService",(function(){return S})),e.d(t,"useNavLinkService",(function(){return E})),e.d(t,"useNotifyService",(function(){return j})),e.d(t,"usePlatformService",(function(){return C})),e.d(t,"useReportingService",(function(){return O})),e.d(t,"useVisualizationsService",(function(){return $})),e.d(t,"useWorkpadService",(function(){return k}));var n=e(1),o=e.n(n),u=e(4),i=e(16),c=e(17);const s={search:{}},a=Object(i.createContext)(s),f=()=>Object(i.useContext)(a),l=r=>t=>Object(i.createElement)(r,{...t,services:f()}),p=({providers:r={},children:t})=>{const e={search:{...h,...r}.search.getService()};return Object(c.jsx)(a.Provider,{value:e},t)};class legacy_CanvasServiceProvider{constructor(r){o()(this,"factory",void 0),o()(this,"service",void 0),this.factory=r}setService(r){this.service=r}async start(r,t,e,n,o){this.service=await this.factory(r,t,e,n,o)}getService(){if(!this.service)throw new Error("Service not ready");return this.service}stop(){this.service=void 0}}const h={search:new legacy_CanvasServiceProvider(((r,t,e,n)=>({search:n.data.search})))},d=async(r,t,e,n,o)=>{const u=Object.values(h).map((u=>u.start(r,t,e,n,o)));await Promise.all(u)},v=()=>{Object.values(h).forEach((r=>r.stop()))},{search:g}=h,y=new(e(25).PluginServices),m=()=>y.getHooks().customElement.useService(),w=()=>y.getHooks().dataViews.useService(),b=()=>y.getHooks().embeddables.useService(),A=()=>y.getHooks().expressions.useService(),x=()=>y.getHooks().filters.useService(),S=()=>y.getHooks().labs.useService(),E=()=>y.getHooks().navLink.useService(),j=()=>y.getHooks().notify.useService(),C=()=>y.getHooks().platform.useService(),O=()=>y.getHooks().reporting.useService(),$=()=>y.getHooks().visualizations.useService(),k=()=>y.getHooks().workpad.useService()},65:function(r,t,e){"use strict";function n(r){return"object"==typeof(null==r?void 0:r.node)}function o(r){return"object"==typeof r&&"expression"===(null==r?void 0:r.type)}function u(r,t,e,n){var o=Error.call(this,r);return Object.setPrototypeOf&&Object.setPrototypeOf(o,u.prototype),o.expected=t,o.found=e,o.location=n,o.name="SyntaxError",o}function i(r,t,e){return e=e||" ",r.length>t?r:(t-=r.length,r+(e+=e.repeat(t)).slice(0,t))}e.d(t,"d",(function(){return s})),e.d(t,"h",(function(){return y})),e.d(t,"g",(function(){return a})),e.d(t,"e",(function(){return f})),e.d(t,"c",(function(){return m})),e.d(t,"a",(function(){return registry_Registry})),e.d(t,"b",(function(){return A})),e.d(t,"f",(function(){return x})),function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(u,Error),u.prototype.format=function(r){var t="Error: "+this.message;if(this.location){var e,n=null;for(e=0;e0){for(t=1,e=1;t[\]$`|= \t\n\r]/,S=/^[^"'(){}<>[\]$`|= \t\n\r]/,E=/^[^"]/,j=/^[^']/,C=dr("|",!1),O=gr("function"),$=dr("=",!1),k=dr("$",!1),_=dr("{",!1),P=dr("}",!1),F=vr([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),H=gr("literal"),R=dr('"',!1),L=dr("'",!1),z=vr([" ","\t","\r","\n"],!1,!1),N=dr("//",!1),I=vr(["\n"],!0,!1),M=dr("/*",!1),T=dr("*/",!1),q={type:"any"},G=dr("\\",!1),U=vr(['"',"'","(",")","{","}","<",">","[","]","$","`","|","="," ","\t","\n","\r"],!1,!1),V=vr(['"',"'","(",")","{","}","<",">","[","]","$","`","|","="," ","\t","\n","\r"],!0,!1),Z=vr(['"'],!0,!1),B=vr(["'"],!0,!1),D=function(r,t){return t},J=function(r,t){return Pr({type:"expression",chain:r?[r].concat(t):[]},pr(),hr())},Q=function(r,t){return Pr({type:"function",function:r,arguments:t},pr(),hr())},W=function(r,t){return{name:r,value:t}},K=function(r){return{name:"_",value:r}},X=function(r){return r},Y=function(r){return Pr(r,pr(),hr())},rr=function(r){return r},tr=function(r){return r.reduce(((r,{name:t,value:e})=>({...r,[t]:(r[t]||[]).concat(e)})),{})},er=function(r){return r.join("")},nr=function(r){return r.join("")},or=function(r){var t=r.join("");return"null"===t?null:"true"===t||"false"!==t&&(isNaN(Number(t))?t:Number(t))},ur=function(r){return r},ir=0,cr=0,sr=[{line:1,column:1}],ar=0,fr=[],lr=0;if("startRule"in t){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=i[t.startRule]}function pr(){return r.substring(cr,ir)}function hr(){return mr(cr,ir)}function dr(r,t){return{type:"literal",text:r,ignoreCase:t}}function vr(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function gr(r){return{type:"other",description:r}}function yr(t){var e,n=sr[t];if(n)return n;for(e=t-1;!sr[e];)e--;for(n={line:(n=sr[e]).line,column:n.column};ear&&(ar=ir,fr=[]),fr.push(r))}function br(){var t,e,o,u,i,c;for(t=ir,jr(),(e=Ar())===n&&(e=null),o=[],u=ir,124===r.charCodeAt(ir)?(i=s,ir++):(i=n,0===lr&&wr(C)),i!==n?(jr(),(c=Ar())!==n?(cr=u,u=D(e,c)):(ir=u,u=n)):(ir=u,u=n);u!==n;)o.push(u),u=ir,124===r.charCodeAt(ir)?(i=s,ir++):(i=n,0===lr&&wr(C)),i!==n?(jr(),(c=Ar())!==n?(cr=u,u=D(e,c)):(ir=u,u=n)):(ir=u,u=n);return cr=t,J(e,o)}function Ar(){var r,t,e;return lr++,r=ir,(t=Er())!==n?(e=function(){var r,t,e,o;for(r=ir,t=[],e=ir,jr()!==n&&(o=xr())!==n?(cr=e,e=rr(o)):(ir=e,e=n);e!==n;)t.push(e),e=ir,jr()!==n&&(o=xr())!==n?(cr=e,e=rr(o)):(ir=e,e=n);return(e=jr())===n&&(e=null),cr=r,r=tr(t)}(),cr=r,r=Q(t,e)):(ir=r,r=n),lr--,r===n&&(t=n,0===lr&&wr(O)),r}function xr(){var t,e,o,u;return t=ir,(e=Er())!==n?(jr(),61===r.charCodeAt(ir)?(o=a,ir++):(o=n,0===lr&&wr($)),o!==n?(jr(),(u=Sr())!==n?(cr=t,t=W(e,u)):(ir=t,t=n)):(ir=t,t=n)):(ir=t,t=n),t===n&&(t=ir,(e=Sr())!==n&&(cr=t,e=K(e)),t=e),t}function Sr(){var t,e,o,u,i;return t=ir,36===r.charCodeAt(ir)?(e=f,ir++):(e=n,0===lr&&wr(k)),e===n&&(e=null),123===r.charCodeAt(ir)?(o=l,ir++):(o=n,0===lr&&wr(_)),o!==n&&(u=br())!==n?(125===r.charCodeAt(ir)?(i=p,ir++):(i=n,0===lr&&wr(P)),i!==n?(cr=t,t=X(u)):(ir=t,t=n)):(ir=t,t=n),t===n&&(t=ir,e=function(){var t;return lr++,t=function(){var t,e,o,u;if(t=ir,34===r.charCodeAt(ir)?(e=h,ir++):(e=n,0===lr&&wr(R)),e!==n){for(o=[],u=kr();u!==n;)o.push(u),u=kr();34===r.charCodeAt(ir)?(u=h,ir++):(u=n,0===lr&&wr(R)),u!==n?(cr=t,t=nr(o)):(ir=t,t=n)}else ir=t,t=n;if(t===n)if(t=ir,39===r.charCodeAt(ir)?(e=d,ir++):(e=n,0===lr&&wr(L)),e!==n){for(o=[],u=_r();u!==n;)o.push(u),u=_r();39===r.charCodeAt(ir)?(u=d,ir++):(u=n,0===lr&&wr(L)),u!==n?(cr=t,t=nr(o)):(ir=t,t=n)}else ir=t,t=n;return t}(),t===n&&(t=function(){var r,t,e,o;if(r=ir,t=ir,lr++,e=Or(),lr--,e===n?t=void 0:(ir=t,t=n),t!==n){if(e=[],(o=$r())!==n)for(;o!==n;)e.push(o),o=$r();else e=n;e!==n?(cr=r,r=or(e)):(ir=r,r=n)}else ir=r,r=n;return r}()),lr--,t===n&&0===lr&&wr(H),t}(),e!==n&&(cr=t,e=Y(e)),t=e),t}function Er(){var t,e,o;if(t=ir,e=[],w.test(r.charAt(ir))?(o=r.charAt(ir),ir++):(o=n,0===lr&&wr(F)),o!==n)for(;o!==n;)e.push(o),w.test(r.charAt(ir))?(o=r.charAt(ir),ir++):(o=n,0===lr&&wr(F));else e=n;return e!==n&&(cr=t,e=er(e)),e}function jr(){var r,t;if(r=[],(t=Cr())===n&&(t=Or()),t!==n)for(;t!==n;)r.push(t),(t=Cr())===n&&(t=Or());else r=n;return r}function Cr(){var t;return b.test(r.charAt(ir))?(t=r.charAt(ir),ir++):(t=n,0===lr&&wr(z)),t}function Or(){var t;return(t=function(){var t,e,o,u;if(t=ir,r.substr(ir,2)===v?(e=v,ir+=2):(e=n,0===lr&&wr(N)),e!==n){for(o=[],A.test(r.charAt(ir))?(u=r.charAt(ir),ir++):(u=n,0===lr&&wr(I));u!==n;)o.push(u),A.test(r.charAt(ir))?(u=r.charAt(ir),ir++):(u=n,0===lr&&wr(I));t=e=[e,o]}else ir=t,t=n;return t}())===n&&(t=function(){var t,e,o,u,i,c;if(t=ir,r.substr(ir,2)===g?(e=g,ir+=2):(e=n,0===lr&&wr(M)),e!==n){for(o=[],u=ir,i=ir,lr++,r.substr(ir,2)===y?(c=y,ir+=2):(c=n,0===lr&&wr(T)),lr--,c===n?i=void 0:(ir=i,i=n),i!==n?(r.length>ir?(c=r.charAt(ir),ir++):(c=n,0===lr&&wr(q)),c!==n?u=i=[i,c]:(ir=u,u=n)):(ir=u,u=n);u!==n;)o.push(u),u=ir,i=ir,lr++,r.substr(ir,2)===y?(c=y,ir+=2):(c=n,0===lr&&wr(T)),lr--,c===n?i=void 0:(ir=i,i=n),i!==n?(r.length>ir?(c=r.charAt(ir),ir++):(c=n,0===lr&&wr(q)),c!==n?u=i=[i,c]:(ir=u,u=n)):(ir=u,u=n);r.substr(ir,2)===y?(u=y,ir+=2):(u=n,0===lr&&wr(T)),u===n&&(u=null),t=e=[e,o,u]}else ir=t,t=n;return t}()),t}function $r(){var t,e,o;return t=ir,92===r.charCodeAt(ir)?(e=m,ir++):(e=n,0===lr&&wr(G)),e!==n?(x.test(r.charAt(ir))?(o=r.charAt(ir),ir++):(o=n,0===lr&&wr(U)),o===n&&(92===r.charCodeAt(ir)?(o=m,ir++):(o=n,0===lr&&wr(G))),o!==n?(cr=t,t=ur(o)):(ir=t,t=n)):(ir=t,t=n),t===n&&(S.test(r.charAt(ir))?(t=r.charAt(ir),ir++):(t=n,0===lr&&wr(V))),t}function kr(){var t,e,o;return t=ir,92===r.charCodeAt(ir)?(e=m,ir++):(e=n,0===lr&&wr(G)),e!==n?(34===r.charCodeAt(ir)?(o=h,ir++):(o=n,0===lr&&wr(R)),o===n&&(92===r.charCodeAt(ir)?(o=m,ir++):(o=n,0===lr&&wr(G))),o!==n?(cr=t,t=ur(o)):(ir=t,t=n)):(ir=t,t=n),t===n&&(E.test(r.charAt(ir))?(t=r.charAt(ir),ir++):(t=n,0===lr&&wr(Z))),t}function _r(){var t,e,o;return t=ir,92===r.charCodeAt(ir)?(e=m,ir++):(e=n,0===lr&&wr(G)),e!==n?(39===r.charCodeAt(ir)?(o=d,ir++):(o=n,0===lr&&wr(L)),o===n&&(92===r.charCodeAt(ir)?(o=m,ir++):(o=n,0===lr&&wr(G))),o!==n?(cr=t,t=ur(o)):(ir=t,t=n)):(ir=t,t=n),t===n&&(j.test(r.charAt(ir))?(t=r.charAt(ir),ir++):(t=n,0===lr&&wr(B))),t}function Pr(r,e,{start:{offset:n},end:{offset:o}}){return t.addMeta?{node:r,text:e,start:n,end:o}:r}if((e=c())!==n&&ir===r.length)return e;throw e!==n&&ir{if(!r||!t||(null==r?void 0:r.node.function)!==(null==t?void 0:t.function))throw Error("Expression changes are not supported.");!function(r,t){if(Object(l.xor)(Object.keys(r.node.arguments),Object.keys(t.arguments)).length)throw Error("Function changes are not supported.");Object(l.forEach)(r.node.arguments,((r,e)=>{!function(r,t){if(r.length!==t.length)throw Error("Arguments changes are not supported.");Object(l.zip)(r,t).forEach((([r,t])=>function(r,t){n(r)&&o(t)?i(r,t):r.node!==t&&u.push({type:"value",source:r,target:t})}(r,t)))}(r,t.arguments[e])}))}(r,t)}))}for(;e.length;)i(...e.shift());return u}(r,t).sort((({source:r},{source:t})=>r.start-t.start)).forEach((function(t){var o;if("value"!==(null==(o=t)?void 0:o.type))throw new Error("Cannot apply patch for the change.");!function(t){if(n(t.source))throw new Error("Patching sub-expressions is not supported.");e+=`${r.substring(u,t.source.start)}${y(t.target,"argument")}`,u=t.source.end}(t)})),e+=r.substring(u),e}function h(r,t,e=0){const n=f(r);function o(r,t){return null==r||"_"===r?t:`${r}=${t}`}if("string"===n)return o(t,`"${r.replace(/[\\"]/g,"\\$&")}"`);if("boolean"===n||"null"===n||"number"===n)return o(t,`${r}`);if("expression"===n)return o(t,`{${g(r.chain,e+1)}}`);throw new Error(`Invalid argument type in AST: ${n}`)}function d({arguments:r},t=0){if(null==r||"object"!=typeof r||Array.isArray(r))throw new Error("Arguments can only be an object");return Object.keys(r).map((e=>r[e].reduce(((r,n)=>{const o=h(n,e,t),u=r.split("\n").pop().length;return 0===t&&u+o.length>80?`${r}\n ${o}`:u>0?`${r} ${o}`:o}),"")))}function v(r,t){var e;return`${r} ${null!==(e=null==t?void 0:t.join(" "))&&void 0!==e?e:""}`.trim()}function g(r,t=0){if(!r)throw new Error("Expressions must contain a chain");const e=t>0?" | ":"\n| ";return r.map((r=>{if("function"!==f(r))return;const{function:e}=r;if(!e)throw new Error("Functions must have a function name");return v(e,d(r,t))})).join(e)}function y(r,t="expression"){const{type:e,source:n}="string"==typeof t?{type:t}:t;if(n&&o(r))return p(n,r);if("argument"===e)return h(r);const u=f(r);if("expression"===u){const{chain:t}=r;if(!Array.isArray(t))throw new Error("Expressions must contain a chain");return g(t)}if("function"===u){const{function:t}=r;return v(t,d(r))}throw new Error("Expression must be an expression or argument function")}function m(r){return function(t,e){if(!e||0===e.length)return t;const n=f(t);if(e.includes(n))return t;const o=r[n];for(let u=0;u(r[t]=this.get(t),r)),{})}toArray(){return Object.keys(this._indexed).map((r=>this.get(r)))}get(r){if(void 0===r)return null;const t=r.toLowerCase();return this._indexed[t]?Object(l.clone)(this._indexed[t]):null}getProp(){return this._prop}reset(){this._indexed=new Object}}function A(r,t){return Object.keys(t).forEach((e=>{if(r[e])throw new Error(`There is already a registry named "${e}".`);r[e]=t[e]})),r}function x(r,t){return Object.keys(t).forEach((e=>{if(!r[e])throw new Error(`There is no registry named "${e}".`);if(!r[e].register)throw new Error(`Registry "${e}" must have a register function.`);t[e].forEach((t=>r[e].register(t)))})),r}},78:function(r,t,e){var n=e(141),o=Object.prototype.hasOwnProperty;function u(r){if(i(r))return!1;if(!r)return!0;if(s(r)&&0===r.length)return!0;if(!c(r)){for(var t in r)if(o.call(r,t))return!1;return!0}return!1}function i(r){return"number"==typeof r}function c(r){return"string"==typeof r}function s(r){return Array.isArray(r)}function a(r,t){for(var e in t)o.call(t,e)&&(r[e]=t[e]);return r}function f(r){var t=parseInt(r);return t.toString()===r?t:r}function l(r,t,e){return null==r?t?e?[]:{}:r:s(r)?r.slice():a({},r)}function p(r,t){if(r!==t&&n(r)&&n(t)){var e={};for(var o in r)r.hasOwnProperty(o)&&(t.hasOwnProperty(o)?e[o]=p(r[o],t[o]):e[o]=r[o]);for(o in t)t.hasOwnProperty(o)&&(e[o]=p(r[o],t[o]));return e}return t}function h(r,t,e,n){if(i(e)&&(e=[e]),u(e))return t;if(c(e))return h(r,t,e.split(".").map(f),n);var o=e[0];return r&&r!==t||(r=l(t,!0,i(o))),1===e.length?n(r,o):(null!=t&&(t=t[o]),r[o]=h(r[o],t,e.slice(1),n),r)}var d={set:function(r,t,e,n){return u(e)?n:h(r,t,e,(function(r,t){return r[t]=n,r}))},update:function(r,t,e,n){return u(e)?n(l(t)):h(r,t,e,(function(r,t){return r[t]=n(r[t]),r}))},push:function(r,t,e){var n=Array.prototype.slice.call(arguments,3);return u(e)?s(t)?t.concat(n):n:h(r,t,e,(function(r,t){return s(r[t])?r[t]=r[t].concat(n):r[t]=n,r}))},insert:function(r,t,e,n,o){if(o=~~o,u(e)){if(!s(t))return[n];var i=t.slice(0,o);return i.push(n),i.concat(t.slice(o))}return h(r,t,e,(function(r,t){var u=r[t];if(!s(u)){if(null!=u&&void 0!==u)throw new Error("Expected "+e+"to be an array. Instead got "+typeof e);u=[]}var i=u.slice(0,o);return i.push(n),r[t]=i.concat(u.slice(o)),r}))},del:function(r,t,e){if(!u(e))return h(r,t,e,(function(r,t){return Array.isArray(r)?void 0!==r[t]&&r.splice(t,1):r.hasOwnProperty(t)&&delete r[t],r}))},assign:function(r,t,e,n){return u(e)?u(n)?t:a(l(t),n):h(r,t,e,(function(r,t){n=Object(n);var e=l(r[t],!0);return a(e,n),r[t]=e,r}))},merge:function(r,t,e,n){return u(e)?u(n)?t:p(t,n):h(r,t,e,(function(r,t){return n=Object(n),r[t]=p(r[t],n),r}))}};r.exports=Object.keys(d).reduce((function(r,t){return r[t]=d[t].bind(null,null),r}),(function(r){var t=r,e=!1,n=Object.keys(d).reduce((function(o,u){return"function"==typeof d[u]&&(o[u]=function(){var o=[t,r].concat(Array.prototype.slice.call(arguments));if(e)throw new Error("Cannot call "+u+" after `value`");return t=d[u].apply(null,o),n}),o}),{});return n.value=function(){return e=!0,t},n}))}}]);