/*! 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.aiops_bundle_jsonpfunction=window.aiops_bundle_jsonpfunction||[]).push([[1],{100:function(t,e,n){!function(t){"use strict";var e={value:function(){}};function n(){for(var t,e=0,n=arguments.length,i={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,r,i=new Array(n),o=0;o0))return a;do{a.push(o=new Date(+n)),e(n,i),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},o&&(u.count=function(e,i){return n.setTime(+e),r.setTime(+i),t(n),t(r),Math.floor(o(n,r))},u.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?u.filter(a?function(e){return a(e)%t==0}:function(e){return u.count(0,e)%t==0}):u:null}),u}var o=i((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));o.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):o:null};var a=o.range;const u=1e3,s=60*u,c=60*s,l=24*c,f=7*l,h=30*l,d=365*l;var p=i((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getUTCSeconds()})),g=p.range,m=i((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*u)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getMinutes()})),v=m.range,y=i((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*u-t.getMinutes()*s)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getHours()})),b=y.range,w=i((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/l),(t=>t.getDate()-1)),M=w.range;function x(t){return i((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/f}))}var _=x(0),j=x(1),k=x(2),S=x(3),O=x(4),T=x(5),A=x(6),C=_.range,N=j.range,E=k.range,D=S.range,F=O.range,P=T.range,I=A.range,L=i((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),U=L.range,R=i((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var H=R.range,Y=i((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCMinutes()})),q=Y.range,B=i((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCHours()})),$=B.range,z=i((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/l}),(function(t){return t.getUTCDate()-1})),V=z.range;function X(t){return i((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/f}))}var W=X(0),Z=X(1),G=X(2),Q=X(3),J=X(4),K=X(5),tt=X(6),et=W.range,nt=Z.range,rt=G.range,it=Q.range,ot=J.range,at=K.range,ut=tt.range,st=i((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ct=st.range,lt=i((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));lt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var ft=lt.range;function ht(t,n,r,i,a,g){const m=[[p,1,u],[p,5,5*u],[p,15,15*u],[p,30,30*u],[g,1,s],[g,5,5*s],[g,15,15*s],[g,30,30*s],[a,1,c],[a,3,3*c],[a,6,6*c],[a,12,12*c],[i,1,l],[i,2,2*l],[r,1,f],[n,1,h],[n,3,3*h],[t,1,d]];function v(n,r,i){const a=Math.abs(r-n)/i,u=e.bisector((([,,t])=>t)).right(m,a);if(u===m.length)return t.every(e.tickStep(n/d,r/d,i));if(0===u)return o.every(Math.max(e.tickStep(n,r,i),1));const[s,c]=m[a/m[u-1][2]Object(u.jsx)(r.EuiFlexItem,null,Object(u.jsx)(r.EuiText,{size:"s","data-test-subj":"aiopsTotalDocCountHeader"},Object(u.jsx)(i.FormattedMessage,{id:"xpack.aiops.searchPanel.totalDocCountLabel",defaultMessage:"Total documents: {strongTotalCount}",values:{strongTotalCount:Object(u.jsx)("strong",{"data-test-subj":"aiopsTotalDocCount"},Object(u.jsx)(i.FormattedMessage,{id:"xpack.aiops.searchPanel.totalDocCountNumber",defaultMessage:"{totalCount, plural, one {#} other {#}}",values:{totalCount:e}}))}}),void 0!==t&&t<1&&Object(u.jsx)(a.a.Fragment,null," ",Object(u.jsx)(i.FormattedMessage,{id:"xpack.aiops.searchPanel.sampleProbabilityLabel",defaultMessage:"Sampling probability: {strongSamplingProbability}",values:{strongSamplingProbability:Object(u.jsx)("strong",{"data-test-subj":"aiopsSamplingProbability"},Object(u.jsx)(i.FormattedMessage,{id:"xpack.aiops.searchPanel.sampleProbabilityNumber",defaultMessage:"{sampleProbability, plural, one {#} other {#}}",values:{sampleProbability:t}}))}}))))},119:function(t,e,n){!function(t){"use strict";function e(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function n(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var r=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),i=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),o=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),a=Math.PI,u=a/2;function s(t){return(1-Math.cos(a*t))/2}function c(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function l(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var f=4/11,h=6/11,d=8/11,p=3/4,g=9/11,m=10/11,v=15/16,y=21/22,b=63/64,w=1/f/f;function M(t){return(t=+t)e&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),i=r>2?v:m,o=a=null,g}function g(e){return null==e||isNaN(e=+e)?r:(o||(o=i(u.map(t),s,c)))(t(l(e)))}return g.invert=function(r){return l(e((a||(a=i(s,u.map(t),n.interpolateNumber)))(r)))},g.domain=function(t){return arguments.length?(u=Array.from(t,h),f()):u.slice()},g.range=function(t){return arguments.length?(s=Array.from(t),f()):s.slice()},g.rangeRound=function(t){return s=Array.from(t),c=n.interpolateRound,f()},g.clamp=function(t){return arguments.length?(l=!!t||p,f()):l!==p},g.interpolate=function(t){return arguments.length?(c=t,f()):c},g.unknown=function(t){return arguments.length?(r=t,g):r},function(n,r){return t=n,e=r,f()}}function w(){return b()(p,p)}function M(t,n,i,o){var a,u=e.tickStep(t,n,i);switch((o=r.formatSpecifier(null==o?",f":o)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(n));return null!=o.precision||isNaN(a=r.precisionPrefix(u,s))||(o.precision=a),r.formatPrefix(o,s);case"":case"e":case"g":case"p":case"r":null!=o.precision||isNaN(a=r.precisionRound(u,Math.max(Math.abs(t),Math.abs(n))))||(o.precision=a-("e"===o.type));break;case"f":case"%":null!=o.precision||isNaN(a=r.precisionFixed(u))||(o.precision=a-2*("%"===o.type))}return r.format(o)}function x(t){var n=t.domain;return t.ticks=function(t){var r=n();return e.ticks(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return M(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(r){null==r&&(r=10);var i,o,a=n(),u=0,s=a.length-1,c=a[u],l=a[s],f=10;for(l0;){if((o=e.tickIncrement(c,l,r))===i)return a[u]=c,a[s]=l,n(a);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else{if(!(o<0))break;c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o}i=o}return t},t}function _(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;d<=p;++d)for(f=1,l=i(d);fc)break;m.push(h)}}else for(;d<=p;++d)for(f=u-1,l=i(d);f>=1;--f)if(!((h=l*f)c)break;m.push(h)}2*m.length0?o[e-1]:r[0],e=o?[u[o-1],i]:[u[e-1],u[e]]},c.unknown=function(t){return arguments.length?(n=t,c):c},c.thresholds=function(){return u.slice()},c.copy=function(){return t().domain([r,i]).range(s).unknown(n)},a.apply(x(c),arguments)},t.scaleRadial=function t(){var e,n=w(),r=[0,1],i=!1;function o(t){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(n(t));return isNaN(r)?e:i?Math.round(r):r}return o.invert=function(t){return n.invert(R(t))},o.domain=function(t){return arguments.length?(n.domain(t),o):n.domain()},o.range=function(t){return arguments.length?(n.range((r=Array.from(t,h)).map(R)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(n.clamp(t),o):n.clamp()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t(n.domain(),r).round(i).clamp(n.clamp()).unknown(e)},a.apply(o,arguments),x(o)},t.scaleSequential=function t(){var e=x(B()(p));return e.copy=function(){return $(e,t())},u.apply(e,arguments)},t.scaleSequentialLog=function t(){var e=C(B()).domain([1,10]);return e.copy=function(){return $(e,t()).base(e.base())},u.apply(e,arguments)},t.scaleSequentialPow=z,t.scaleSequentialQuantile=function t(){var n=[],r=p;function i(t){if(null!=t&&!isNaN(t=+t))return r((e.bisect(n,t,1)-1)/(n.length-1))}return i.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(e.ascending),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return n.map(((t,e)=>r(e/(n.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((r,i)=>e.quantile(n,i/t)))},i.copy=function(){return t(r).domain(n)},u.apply(i,arguments)},t.scaleSequentialSqrt=function(){return z.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var e=D(B());return e.copy=function(){return $(e,t()).constant(e.constant())},u.apply(e,arguments)},t.scaleSqrt=function(){return U.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var e=D(b());return e.copy=function(){return y(e,t()).constant(e.constant())},a.apply(e,arguments)},t.scaleThreshold=function t(){var n,r=[.5],i=[0,1],o=1;function u(t){return null!=t&&t<=t?i[e.bisect(r,t,0,o)]:n}return u.domain=function(t){return arguments.length?(r=Array.from(t),o=Math.min(r.length,i.length-1),u):r.slice()},u.range=function(t){return arguments.length?(i=Array.from(t),o=Math.min(r.length,i.length-1),u):i.slice()},u.invertExtent=function(t){var e=i.indexOf(t);return[r[e-1],r[e]]},u.unknown=function(t){return arguments.length?(n=t,u):n},u.copy=function(){return t().domain(r).range(i).unknown(n)},a.apply(u,arguments)},t.scaleTime=function(){return a.apply(q(i.timeTicks,i.timeTickInterval,i.timeYear,i.timeMonth,i.timeWeek,i.timeDay,i.timeHour,i.timeMinute,i.timeSecond,o.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return a.apply(q(i.utcTicks,i.utcTickInterval,i.utcYear,i.utcMonth,i.utcWeek,i.utcDay,i.utcHour,i.utcMinute,i.utcSecond,o.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.tickFormat=M,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(81),n(126),n(128),n(101),n(129))},126:function(t,e,n){!function(t,e){"use strict";function n(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function r(t){var e=t.length-1;return function(r){var i=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[i],a=t[i+1],u=i>0?t[i-1]:2*o-a,s=i()=>t;function a(t,e){return function(n){return t+n*e}}function u(t,e){var n=e-t;return n?a(t,n>180||n<-180?n-360*Math.round(n/360):n):o(isNaN(t)?e:t)}function s(t){return 1==(t=+t)?c:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):o(isNaN(e)?n:e)}}function c(t,e){var n=e-t;return n?a(t,n):o(isNaN(t)?e:t)}var l=function t(n){var r=s(n);function i(t,n){var i=r((t=e.rgb(t)).r,(n=e.rgb(n)).r),o=r(t.g,n.g),a=r(t.b,n.b),u=c(t.opacity,n.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=a(e),t.opacity=u(e),t+""}}return i.gamma=t,i}(1);function f(t){return function(n){var r,i,o=n.length,a=new Array(o),u=new Array(o),s=new Array(o);for(r=0;ro&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:y(n,r)})),o=M.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:y(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:y(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:y(t,n)},{i:u-2,x:y(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?M(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?M(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new j(e[1],e[2],e[3],1):(e=f.exec(t))?new j(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.exec(t))?M(e[1],e[2],e[3],e[4]):(e=d.exec(t))?M(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=p.exec(t))?T(e[1],e[2]/100,e[3]/100,1):(e=g.exec(t))?T(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?w(m[t]):"transparent"===t?new j(NaN,NaN,NaN,0):null}function w(t){return new j(t>>16&255,t>>8&255,255&t,1)}function M(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function x(t){return t instanceof r||(t=b(t)),t?new j((t=t.rgb()).r,t.g,t.b,t.opacity):new j}function _(t,e,n,r){return 1===arguments.length?x(t):new j(t,e,n,null==r?1:r)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function k(){return"#"+O(this.r)+O(this.g)+O(this.b)}function S(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function O(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function T(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new N(t,e,n,r)}function A(t){if(t instanceof N)return new N(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=b(t)),!t)return new N;if(t instanceof N)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,o=Math.min(e,n,i),a=Math.max(e,n,i),u=NaN,s=a-o,c=(a+o)/2;return s?(u=e===a?(n-i)/s+6*(n0&&c<1?0:u,new N(u,s,c,t.opacity)}function C(t,e,n,r){return 1===arguments.length?A(t):new N(t,e,n,null==r?1:r)}function N(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function E(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}e(r,b,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:v,formatHex:v,formatHsl:function(){return A(this).formatHsl()},formatRgb:y,toString:y}),e(j,_,n(r,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?i:Math.pow(i,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:k,formatHex:k,formatRgb:S,toString:S})),e(N,C,n(r,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new N(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i:Math.pow(i,t),new N(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(E(t>=240?t-240:t+120,i,r),E(t,i,r),E(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const D=Math.PI/180,F=180/Math.PI,P=.96422,I=1,L=.82521,U=4/29,R=6/29,H=3*R*R,Y=R*R*R;function q(t){if(t instanceof $)return new $(t.l,t.a,t.b,t.opacity);if(t instanceof Q)return J(t);t instanceof j||(t=x(t));var e,n,r=W(t.r),i=W(t.g),o=W(t.b),a=z((.2225045*r+.7168786*i+.0606169*o)/I);return r===i&&i===o?e=n=a:(e=z((.4360747*r+.3850649*i+.1430804*o)/P),n=z((.0139322*r+.0971045*i+.7141733*o)/L)),new $(116*a-16,500*(e-a),200*(a-n),t.opacity)}function B(t,e,n,r){return 1===arguments.length?q(t):new $(t,e,n,null==r?1:r)}function $(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function z(t){return t>Y?Math.pow(t,1/3):t/H+U}function V(t){return t>R?t*t*t:H*(t-U)}function X(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function W(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Z(t){if(t instanceof Q)return new Q(t.h,t.c,t.l,t.opacity);if(t instanceof $||(t=q(t)),0===t.a&&0===t.b)return new Q(NaN,01?r[0]+r.slice(2):r,+t.slice(n+1)]}function n(t){return(t=e(Math.abs(t)))?t[1]:NaN}var r,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new a({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function a(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function u(t,n){var r=e(t,n);if(!r)return t+"";var i=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}o.prototype=a.prototype,a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var s={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>u(100*t,e),r:u,s:function(t,n){var i=e(t,n);if(!i)return t+"";var o=i[0],a=i[1],u=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,s=o.length;return u===s?o:u>s?o+new Array(u-s+1).join("0"):u>0?o.slice(0,u)+"."+o.slice(u):"0."+new Array(1-u).join("0")+e(t,Math.max(0,n+u-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function c(t){return t}var l,f=Array.prototype.map,h=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function d(t){var e,i,a=void 0===t.grouping||void 0===t.thousands?c:(e=f.call(t.grouping,Number),i=t.thousands+"",function(t,n){for(var r=t.length,o=[],a=0,u=e[0],s=0;r>0&&u>0&&(s+u+1>n&&(u=Math.max(1,n-s)),o.push(t.substring(r-=u,r+u)),!((s+=u+1)>n));)u=e[a=(a+1)%e.length];return o.reverse().join(i)}),u=void 0===t.currency?"":t.currency[0]+"",l=void 0===t.currency?"":t.currency[1]+"",d=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",m=void 0===t.minus?"−":t.minus+"",v=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=o(t)).fill,n=t.align,i=t.sign,c=t.symbol,f=t.zero,y=t.width,b=t.comma,w=t.precision,M=t.trim,x=t.type;"n"===x?(b=!0,x="g"):s[x]||(void 0===w&&(w=12),M=!0,x="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===c?u:"#"===c&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",j="$"===c?l:/[%p]/.test(x)?g:"",k=s[x],S=/[defgprs%]/.test(x);function O(t){var o,u,s,c=_,l=j;if("c"===x)l=k(t)+l,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?v:k(Math.abs(t),w),M&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==i&&(g=!1),c=(g?"("===i?i:m:"-"===i||"("===i?"":i)+c,l=("s"===x?h[8+r/3]:"")+l+(g&&"("===i?")":""),S)for(o=-1,u=t.length;++o(s=t.charCodeAt(o))||s>57){l=(46===s?d+t.slice(o+1):t.slice(o))+l,t=t.slice(0,o);break}}b&&!f&&(t=a(t,1/0));var O=c.length+t.length+l.length,T=O>1)+c+t+l+T.slice(O);break;default:t=T+c+t+l}return p(t)}return w=void 0===w?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),O.toString=function(){return t+""},O}return{format:y,formatPrefix:function(t,e){var r=y(((t=o(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(n(e)/3))),a=Math.pow(10,-i),u=h[8+i/3];return function(t){return r(a*t)+u}}}}function p(e){return l=d(e),t.format=l.format,t.formatPrefix=l.formatPrefix,l}p({thousands:",",grouping:[3],currency:["$",""]}),t.FormatSpecifier=a,t.formatDefaultLocale=p,t.formatLocale=d,t.formatSpecifier=o,t.precisionFixed=function(t){return Math.max(0,-n(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(n(e)/3)))-n(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,n(e)-n(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}(e)},129:function(t,e,n){!function(t,e){"use strict";function n(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function r(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function o(t){var o=t.dateTime,a=t.date,s=t.time,c=t.periods,l=t.days,f=t.shortDays,h=t.months,V=t.shortMonths,ht=d(c),jt=p(c),kt=d(l),St=p(l),Ot=d(f),Tt=p(f),At=d(h),Ct=p(h),Nt=d(V),Et=p(V),Dt={a:function(t){return f[t.getDay()]},A:function(t){return l[t.getDay()]},b:function(t){return V[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:P,e:P,f:H,g:Q,G:K,H:I,I:L,j:U,L:R,m:Y,M:q,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:xt,s:_t,S:B,u:$,U:z,V:X,w:W,W:Z,x:null,X:null,y:G,Y:J,Z:tt,"%":Mt},Ft={a:function(t){return f[t.getUTCDay()]},A:function(t){return l[t.getUTCDay()]},b:function(t){return V[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:et,e:et,f:at,g:vt,G:bt,H:nt,I:rt,j:it,L:ot,m:ut,M:st,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:xt,s:_t,S:ct,u:lt,U:ft,V:dt,w:pt,W:gt,x:null,X:null,y:mt,Y:yt,Z:wt,"%":Mt},Pt={a:function(t,e,n){var r=Ot.exec(e.slice(n));return r?(t.w=Tt.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=kt.exec(e.slice(n));return r?(t.w=St.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=Nt.exec(e.slice(n));return r?(t.m=Et.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=At.exec(e.slice(n));return r?(t.m=Ct.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,n){return Ut(t,o,e,n)},d:k,e:k,f:N,g:M,G:w,H:O,I:O,j:S,L:C,m:j,M:T,p:function(t,e,n){var r=ht.exec(e.slice(n));return r?(t.p=jt.get(r[0].toLowerCase()),n+r[0].length):-1},q:_,Q:D,s:F,S:A,u:m,U:v,V:y,w:g,W:b,x:function(t,e,n){return Ut(t,a,e,n)},X:function(t,e,n){return Ut(t,s,e,n)},y:M,Y:w,Z:x,"%":E};function It(t,e){return function(n){var r,i,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in c||(c.w=1),"Z"in c?(s=(u=r(i(c.y,0,1))).getUTCDay(),u=s>4||0===s?e.utcMonday.ceil(u):e.utcMonday(u),u=e.utcDay.offset(u,7*(c.V-1)),c.y=u.getUTCFullYear(),c.m=u.getUTCMonth(),c.d=u.getUTCDate()+(c.w+6)%7):(s=(u=n(i(c.y,0,1))).getDay(),u=s>4||0===s?e.timeMonday.ceil(u):e.timeMonday(u),u=e.timeDay.offset(u,7*(c.V-1)),c.y=u.getFullYear(),c.m=u.getMonth(),c.d=u.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),s="Z"in c?r(i(c.y,0,1)).getUTCDay():n(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(s+5)%7:c.w+7*c.U-(s+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,r(c)):n(c)}}function Ut(t,e,n,r){for(var i,o,a=0,s=e.length,c=n.length;a=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=Pt[i in u?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Dt.x=It(a,Dt),Dt.X=It(s,Dt),Dt.c=It(o,Dt),Ft.x=It(a,Ft),Ft.X=It(s,Ft),Ft.c=It(o,Ft),{format:function(t){var e=It(t+="",Dt);return e.toString=function(){return t},e},parse:function(t){var e=Lt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Ft);return e.toString=function(){return t},e},utcParse:function(t){var e=Lt(t+="",!0);return e.toString=function(){return t},e}}}var a,u={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,l=/[\\^$*+?|[\]().{}]/g;function f(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function g(t,e,n){var r=s.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function m(t,e,n){var r=s.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function v(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function y(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function b(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function w(t,e,n){var r=s.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function M(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function x(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function _(t,e,n){var r=s.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function j(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function k(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function S(t,e,n){var r=s.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function O(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function T(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function A(t,e,n){var r=s.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function C(t,e,n){var r=s.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function N(t,e,n){var r=s.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function E(t,e,n){var r=c.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function D(t,e,n){var r=s.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function F(t,e,n){var r=s.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function P(t,e){return f(t.getDate(),e,2)}function I(t,e){return f(t.getHours(),e,2)}function L(t,e){return f(t.getHours()%12||12,e,2)}function U(t,n){return f(1+e.timeDay.count(e.timeYear(t),t),n,3)}function R(t,e){return f(t.getMilliseconds(),e,3)}function H(t,e){return R(t,e)+"000"}function Y(t,e){return f(t.getMonth()+1,e,2)}function q(t,e){return f(t.getMinutes(),e,2)}function B(t,e){return f(t.getSeconds(),e,2)}function $(t){var e=t.getDay();return 0===e?7:e}function z(t,n){return f(e.timeSunday.count(e.timeYear(t)-1,t),n,2)}function V(t){var n=t.getDay();return n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t)}function X(t,n){return t=V(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function W(t){return t.getDay()}function Z(t,n){return f(e.timeMonday.count(e.timeYear(t)-1,t),n,2)}function G(t,e){return f(t.getFullYear()%100,e,2)}function Q(t,e){return f((t=V(t)).getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t,n){var r=t.getDay();return f((t=r>=4||0===r?e.timeThursday(t):e.timeThursday.ceil(t)).getFullYear()%1e4,n,4)}function tt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function et(t,e){return f(t.getUTCDate(),e,2)}function nt(t,e){return f(t.getUTCHours(),e,2)}function rt(t,e){return f(t.getUTCHours()%12||12,e,2)}function it(t,n){return f(1+e.utcDay.count(e.utcYear(t),t),n,3)}function ot(t,e){return f(t.getUTCMilliseconds(),e,3)}function at(t,e){return ot(t,e)+"000"}function ut(t,e){return f(t.getUTCMonth()+1,e,2)}function st(t,e){return f(t.getUTCMinutes(),e,2)}function ct(t,e){return f(t.getUTCSeconds(),e,2)}function lt(t){var e=t.getUTCDay();return 0===e?7:e}function ft(t,n){return f(e.utcSunday.count(e.utcYear(t)-1,t),n,2)}function ht(t){var n=t.getUTCDay();return n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t)}function dt(t,n){return t=ht(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function pt(t){return t.getUTCDay()}function gt(t,n){return f(e.utcMonday.count(e.utcYear(t)-1,t),n,2)}function mt(t,e){return f(t.getUTCFullYear()%100,e,2)}function vt(t,e){return f((t=ht(t)).getUTCFullYear()%100,e,2)}function yt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function bt(t,n){var r=t.getUTCDay();return f((t=r>=4||0===r?e.utcThursday(t):e.utcThursday.ceil(t)).getUTCFullYear()%1e4,n,4)}function wt(){return"+0000"}function Mt(){return"%"}function xt(t){return+t}function _t(t){return Math.floor(+t/1e3)}function jt(e){return a=o(e),t.timeFormat=a.format,t.timeParse=a.parse,t.utcFormat=a.utcFormat,t.utcParse=a.utcParse,a}jt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var kt="%Y-%m-%dT%H:%M:%S.%LZ";var St=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(kt);var Ot=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(kt);t.isoFormat=St,t.isoParse=Ot,t.timeFormatDefaultLocale=jt,t.timeFormatLocale=o,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(101))},50:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}));const r="aiops.frozenDataTierPreference",i="aiops.randomSamplingModePreference",o="aiops.randomSamplingProbabilityPreference",a=[r,i,o]},51:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return l}));var r=n(1),i=n.n(r),o=n(12),a=n(52),u=n(0);const s=i.a.createContext({value:null,setValue(){throw new Error("MlStorageContext set method is not implemented")},removeValue(){throw new Error("MlStorageContext remove method is not implemented")}});function c({children:t,storage:e,storageKeys:n}){const i=Object(r.useMemo)((()=>n.reduce(((t,n)=>(t[n]=e.get(n),t)),{})),[e,n]),[c,l]=Object(r.useState)(i),f=Object(r.useCallback)(((t,n)=>{e.set(t,n),l((e=>({...e,[t]:n})))}),[e]),h=Object(r.useCallback)((t=>{e.remove(t),l((e=>Object(o.omit)(e,t)))}),[e]);Object(r.useEffect)((function(){const t=t=>{(function(t,e){return e.includes(t)})(t.key,n)&&(Object(a.a)(t.newValue)?l((e=>({...e,[t.key]:"string"==typeof t.newValue?JSON.parse(t.newValue):t.newValue}))):l((e=>Object(o.omit)(e,t.key))))};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}),[n]);const d=Object(r.useMemo)((()=>({value:c,setValue:f,removeValue:h})),[c,f,h]);return Object(u.jsx)(s.Provider,{value:d},t)}function l(t,e){const{value:n,setValue:i,removeValue:o}=Object(r.useContext)(s);return[Object(r.useMemo)((()=>{var r;return null!==(r=null==n?void 0:n[t])&&void 0!==r?r:e}),[n,t,e]),Object(r.useCallback)((e=>{Object(a.a)(e)?i(t,e):o(t)}),[i,o,t])]}},52:function(t,e,n){"use strict";function r(t){return null!=t}n.d(e,"a",(function(){return r}))},56:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));const r=5e4;var i=n(12),o=n(39);function a(t){return"number"==typeof t&&t>0&&t<=.5}const u=t=>{var e;const n=(u=t,Object(o.a)(u,["probability"])?t.probability:function(t){let e=1;return t>r&&(e=Math.min(.5,r/t)),+(n=e).toFixed(Math.max(1-Math.log10(n),1));var n}(t.totalNumDocs));var u;const s=null!==(e=t.aggName)&&void 0!==e?e:"sample";return{wrap:e=>a(n)?{[s]:{random_sampler:{probability:n,...t.seed?{seed:t.seed}:{}},aggs:e}}:e,unwrap:t=>a(n)?Object(i.get)(t,[s]):t,probability:n}};n(41),n(3),[1e-5,5e-5,1e-4,5e-4,.001,.005,.01,.05,.1,.2,.3,.4,.5].map((t=>100*t))},57:function(t,e,n){"use strict";function r(t){let e=0,n=0;if(0===t.length)return e;for(let r=0;r{var e;return null!==(e=null==t?void 0:t.theme$)&&void 0!==e?e:Object(i.of)(s)}),[t]),{darkMode:n}=a()(e,s);return n}(t);return Object(r.useMemo)((()=>({euiTheme:e?u.euiDarkVars:u.euiLightVars})),[e])}(t).euiTheme}},70:function(t,e,n){"use strict";var r,i=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),o=[];function a(t){for(var e=-1,n=0;n{var e;if(function(t){var e;return t&&void 0!==(null===(e=t.error)||void 0===e?void 0:e.reason)}(t))return{message:null!==(e=t.error.reason)&&void 0!==e?e:"",statusCode:t.status,fullError:t};if(function(t){return"string"==typeof t}(t))return{message:t};if(function(t){return!0===(null==t?void 0:t.isBoom)}(t))return{message:t.output.payload.message,statusCode:t.output.payload.statusCode};if(void 0===(null==t?void 0:t.body)&&(null==t||!t.message))return{message:""};if("string"==typeof t.body)return{message:t.body};if(function(t){return"object"==typeof t.body&&"message"in t.body}(t)){var n,r;if("object"==typeof t.body.attributes&&"string"==typeof(null===(n=t.body.attributes.body)||void 0===n||null===(r=n.error)||void 0===r?void 0:r.reason)){var i,o,a;const e={message:t.body.attributes.body.error.reason,statusCode:t.body.statusCode,fullError:t.body.attributes.body};var u,s,c;return"object"!=typeof t.body.attributes.body.error.caused_by||"string"!=typeof(null===(i=t.body.attributes.body.error.caused_by)||void 0===i?void 0:i.reason)&&"string"!=typeof(null===(o=t.body.attributes.body.error.caused_by)||void 0===o||null===(a=o.caused_by)||void 0===a?void 0:a.reason)||(e.causedBy=(null===(u=t.body.attributes.body.error.caused_by)||void 0===u||null===(s=u.caused_by)||void 0===s?void 0:s.reason)||(null===(c=t.body.attributes.body.error.caused_by)||void 0===c?void 0:c.reason)),Array.isArray(t.body.attributes.body.error.root_cause)&&"object"==typeof t.body.attributes.body.error.root_cause[0]&&Object(d.a)(t.body.attributes.body.error.root_cause[0],["script"])&&(e.causedBy=t.body.attributes.body.error.root_cause[0].script,e.message+=`: '${t.body.attributes.body.error.root_cause[0].script}'`),e}return{message:t.body.message,statusCode:t.body.statusCode}}return function(t){return t&&void 0!==t.message&&"string"==typeof t.message}(t)?{message:t.message}:{message:""}};var g=n(5),m=n(12),v=n(46);const y=(t,e,n=!1)=>{const{index:r,timeFieldName:i,earliest:o,latest:a,runtimeFieldMap:u,searchQuery:s,intervalMs:c,fieldsToFetch:l,selectedSignificantTerm:f,includeSelectedSignificantTerm:h,selectedGroup:p,trackTotalHits:g}=t,m=function(t,e,n,r,i,o=!0,a){const u=Object(v.c)(t,e,n,r),s=[];if(a){const t=a.groupItemsSortedByUniqueness;for(const e of t){const{fieldName:t,fieldValue:n}=e;s.push({term:{[t]:n}})}}return o?i?u.push({term:{[i.fieldName]:i.fieldValue}}):a&&u.push(...s):i&&!o?u.push({bool:{must_not:[{term:{[i.fieldName]:i.fieldValue}}]}}):a&&!o&&u.push({bool:{must_not:[{bool:{filter:[...s]}}]}}),u}(i,o,a,s,f,h,p),y={eventRate:{date_histogram:{field:i,fixed_interval:`${c}ms`,min_doc_count:0,...void 0!==o&&void 0!==a?{extended_bounds:{min:o,max:a}}:{}}}},b=e?e.wrap(y):y;return{index:r,body:{query:{bool:{filter:m}},...!l&&!n&&void 0!==i&&void 0!==c&&c>0?{aggs:b}:{},...Object(d.a)(u)?{runtime_mappings:u}:{},track_total_hits:!0===g,size:0}}},b=(t,e,n)=>{var r,i;if(!t)return;const o=null!==(r=null!==(i=t.hits.total.value)&&void 0!==i?i:t.hits.total)&&void 0!==r?r:0;if(void 0===e.intervalMs||void 0===e.earliest||void 0===e.latest)return{totalCount:o};const a={},u=Object(m.get)(n&&void 0!==t.aggregations?n.unwrap(t.aggregations):t.aggregations,["eventRate","buckets"],[]);return Object(m.each)(u,(t=>{const e=t.key;a[e]=t.doc_count})),{interval:e.intervalMs,buckets:a,timeRangeEarliest:e.earliest,timeRangeLatest:e.latest,totalCount:o}};const w=(t,e,n,d,m,v=null,w=75,M)=>{const{executionContext:x}=Object(c.b)();Object(o.useExecutionContext)(x,{name:u.PLUGIN_ID,type:"application",id:e});const[_,j]=Object(r.useState)(0),k=Object(s.a)(),S=Object(a.g)({timeRangeSelector:void 0!==(null==t?void 0:t.timeFieldName),autoRefreshSelector:!0}),O=Object(r.useMemo)((()=>{const e=null!=M?M:S.getActiveBounds();var r,i,o;if(void 0!==e)return k.setInterval("auto"),k.setBounds(e),k.setBarTarget(w),{earliest:null===(r=e.min)||void 0===r?void 0:r.valueOf(),latest:null===(i=e.max)||void 0===i?void 0:i.valueOf(),intervalMs:null===(o=k.getInterval())||void 0===o?void 0:o.asMilliseconds(),index:t.getIndexPattern(),searchQuery:n,timeFieldName:t.timeFieldName,runtimeFieldMap:t.getRuntimeMappings()}}),[_,n,M]),T=function(t,e,n){const{data:o,notifications:{toasts:a}}=Object(c.b)(),u=Object(r.useRef)(new AbortController),[s,d]=Object(r.useState)({sampleProbability:1,totalCount:0}),[m,v]=Object(r.useState)({}),w=Object(r.useCallback)((async()=>{if(!t)return;const n=Object(f.a)(`${JSON.stringify(t)}_${JSON.stringify(e)}`);var r,s,c,w,M;if(m[n])d(m[n]);else try{var x;u.current=new AbortController;const r={...t,selectedSignificantTerm:void 0,trackTotalHits:!0},a=await Object(i.lastValueFrom)(o.search.search({params:y(r,void 0,!0)},{abortSignal:u.current.signal})),s=b(null==a?void 0:a.rawResponse,t),c=null!==(x=null==s?void 0:s.totalCount)&&void 0!==x?x:0,l=Object(h.a)({totalNumDocs:c,seed:g.c}),f=await Object(i.lastValueFrom)(o.search.search({params:y({...t,trackTotalHits:!1},l)},{abortSignal:u.current.signal})),p=b(null==f?void 0:f.rawResponse,t,l),w={sampleProbability:l.probability,documentCountStats:p,totalCount:c};if(e){const t=await Object(i.lastValueFrom)(o.search.search({params:y({...e,trackTotalHits:!1},l)},{abortSignal:u.current.signal})),n=b(null==t?void 0:t.rawResponse,e,l);w.documentCountStatsCompare=n,w.totalCount=c}d(w),v({...m,[n]:w})}catch(e){"AbortError"!==e.name&&(r=a,s=t.index,500===(c=p(e)).statusCode?r.addError(c,{title:l.i18n.translate("xpack.aiops.index.dataLoader.internalServerErrorMessage",{defaultMessage:"Error loading data in index {index}. {message}. The request may have timed out. Try using a smaller sample size or narrowing the time range.",values:{index:s,message:null!==(w=c.error)&&void 0!==w?w:c.message}})}):r.addError(c,{title:l.i18n.translate("xpack.aiops.index.errorLoadingDataMessage",{defaultMessage:"Error loading data in index {index}. {message}.",values:{index:s,message:null!==(M=c.error)&&void 0!==M?M:c.message}})}))}}),[null==o?void 0:o.search,m,t,e,a]);return Object(r.useEffect)((function(){return w(),()=>u.current.abort()}),[w,n]),Object(r.useEffect)((()=>{v({})}),[n]),s}(Object(r.useMemo)((()=>O?{...O,selectedSignificantTerm:m,selectedGroup:v,includeSelectedSignificantTerm:!1}:void 0),[O,m,v]),Object(r.useMemo)((()=>O&&(m||v)?{...O,selectedSignificantTerm:m,selectedGroup:v,includeSelectedSignificantTerm:!0}:void 0),[O,m,v]),_);return Object(r.useEffect)((()=>{const t=Object(i.merge)(S.getAutoRefreshFetch$(),S.getTimeUpdate$(),a.e).subscribe((()=>{d&&(d({time:S.getTime(),refreshInterval:S.getRefreshInterval()}),j(Date.now()))})),e=S.getEnabledUpdated$().subscribe((()=>{void 0===O&&j(Date.now())}));return()=>{t.unsubscribe(),e.unsubscribe()}}),[]),{documentStats:T,timefilter:S,earliest:null==O?void 0:O.earliest,latest:null==O?void 0:O.latest,intervalMs:null==O?void 0:O.intervalMs,forceRefresh:()=>j(Date.now())}}},77:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return a}));var r=n(81);const i={SPIKE:"spike",DIP:"dip"};function o(t,e){var n,o;const{baselineMin:a,baselineMax:u,deviationMin:s,deviationMax:c}=e,l=t.filter((t=>t.time>=a&&t.timet.value))))&&void 0!==n?n:0,h=t.filter((t=>t.time>=s&&t.timet.value))))&&void 0!==o?o:0)>=f?i.SPIKE:i.DIP}n(39);const a=(t,e,n)=>{const r=n-e,i=Math.max(r/10,6e5),o=Math.max(r/3.5,18e5),a=t-i/2,u=t+i/2,s=a-Math.max(r/10,3e5),c=s-o;return{baselineMin:Math.round(c),baselineMax:Math.round(s),deviationMin:Math.round(a),deviationMax:Math.round(u)}},u=(t,e)=>{const n=e.reduce(((e,n)=>Math.abs(n-t.baselineMin)t>n)),i=r.reduce(((e,n)=>Math.abs(n-t.baselineMax)t>i)),a=o.reduce(((e,n)=>Math.abs(n-t.deviationMin)t>a)),s=u.reduce(((e,n)=>Math.abs(n-t.deviationMax)e?1:t>=e?0:NaN}function n(t){let n=t,r=t;function i(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;r(t[o],e)<0?n=o+1:i=o}return n}return 1===t.length&&(n=(e,n)=>t(e)-n,r=function(t){return(n,r)=>e(t(n),r)}(t)),{left:i,center:function(t,e,r,o){null==r&&(r=0),null==o&&(o=t.length);const a=i(t,e,r,o-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function r(t){return null===t?NaN:+t}const i=n(e),o=i.right,a=i.left,u=n(r).center;function s(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function c(t){return 0|t.length}function l(t){return!(t>0)}function f(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function h(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let u of t)null!=(u=e(u,++a,t))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}function d(t,e){const n=h(t,e);return n?Math.sqrt(n):n}function p(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class InternMap extends Map{constructor(t,e=y){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(g(this,t))}has(t){return super.has(g(this,t))}set(t,e){return super.set(m(this,t),e)}delete(t){return super.delete(v(this,t))}}class InternSet extends Set{constructor(t,e=y){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(g(this,t))}add(t){return super.add(m(this,t))}delete(t){return super.delete(v(this,t))}}function g({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function m({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function v({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(n),t.delete(r)),n}function y(t){return null!==t&&"object"==typeof t?t.valueOf():t}function b(t){return t}function w(t,...e){return _(t,b,b,e)}function M(t,e,...n){return _(t,b,e,n)}function x(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function _(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new InternMap,u=r[o++];let s=-1;for(const t of i){const e=u(t,++s,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function j(t,e){return Array.from(e,(e=>t[e]))}function k(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[r=e]=n;if(1===r.length||n.length>1){const i=Uint32Array.from(t,((t,e)=>e));return n.length>1?(n=n.map((e=>t.map(e))),i.sort(((t,r)=>{for(const i of n){const n=e(i[t],i[r]);if(n)return n}}))):(r=t.map(r),i.sort(((t,n)=>e(r[t],r[n])))),j(t,i)}return t.sort(r)}var S=Array.prototype.slice;function O(t){return function(){return t}}var T=Math.sqrt(50),A=Math.sqrt(10),C=Math.sqrt(2);function N(t,e,n){var r,i,o,a,u=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e0){let n=Math.round(t/a),r=Math.round(e/a);for(n*ae&&--r,o=new Array(i=r-n+1);++ue&&--r,o=new Array(i=r-n+1);++u=0?(o>=T?10:o>=A?5:o>=C?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=T?10:o>=A?5:o>=C?2:1)}function D(t,e,n){let r;for(;;){const i=E(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function F(t){return Math.ceil(Math.log(s(t))/Math.LN2)+1}function P(){var t=b,e=p,n=F;function r(r){Array.isArray(r)||(r=Array.from(r));var i,a,u=r.length,s=new Array(u);for(i=0;i=f)if(t>=f&&e===p){const t=E(l,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length;h[0]<=l;)h.shift(),--d;for(;h[d-1]>f;)h.pop(),--d;var g,m=new Array(d+1);for(i=0;i<=d;++i)(g=m[i]=[]).x0=i>0?h[i-1]:l,g.x1=i=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function L(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function U(t,n,r=0,i=t.length-1,o=e){for(;i>r;){if(i-r>600){const e=i-r+1,a=n-r+1,u=Math.log(e),s=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*s*(e-s)/e)*(a-e/2<0?-1:1);U(t,n,Math.max(r,Math.floor(n-a*s/e+c)),Math.min(i,Math.floor(n+(e-a)*s/e+c)),o)}const e=t[n];let a=r,u=i;for(R(t,r,n),o(t[i],e)>0&&R(t,r,i);a0;)--u}0===o(t[r],e)?R(t,r,u):(++u,R(t,u,i)),u<=n&&(r=u+1),n<=u&&(i=u-1)}return t}function R(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function H(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return L(t);if(e>=1)return I(t);var r,i=(r-1)*e,o=Math.floor(i),a=I(U(t,o).subarray(0,o+1));return a+(L(t.subarray(o+1))-a)*(i-o)}}function Y(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function q(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function B(t,e){return[t,e]}function $(t,n=e){if(1===n.length)return q(t,n);let r,i=-1,o=-1;for(const e of t)++o,(i<0?0===n(e,e):n(e,r)<0)&&(r=e,i=o);return i}var z=V(Math.random);function V(t){return function(e,n=0,r=e.length){let i=r-(n=+n);for(;i;){const r=t()*i--|0,o=e[i+n];e[i+n]=e[r+n],e[r+n]=o}return e}}function X(t){if(!(i=t.length))return[];for(var e=-1,n=L(t,W),r=new Array(n);++et(...e)}(t.pop()),n=(t=t.map(f)).map(c),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(l))return o;for(;;){o.push(i.map(((e,n)=>t[n][e])));let a=r;for(;++i[a]===n[a];){if(0===a)return e?o.map(e):o;i[a--]=0}}},t.cumsum=function(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)},t.descending=function(t,e){return et?1:e>=t?0:NaN},t.deviation=d,t.difference=function(t,...e){t=new Set(t);for(const n of e)for(const e of n)t.delete(e);return t},t.disjoint=function(t,e){const n=e[Symbol.iterator](),r=new Set;for(const e of t){if(r.has(e))return!1;let t,i;for(;({value:t,done:i}=n.next())&&!i;){if(Object.is(e,t))return!1;r.add(t)}}return!0},t.every=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0},t.extent=p,t.fcumsum=function(t,e){const n=new Adder;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))},t.filter=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n},t.fsum=function(t,e){const n=new Adder;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n},t.greatest=function(t,n=e){let r,i=!1;if(1===n.length){let o;for(const a of t){const t=n(a);(i?e(t,o)>0:0===e(t,t))&&(r=a,o=t,i=!0)}}else for(const e of t)(i?n(e,r)>0:0===n(e,e))&&(r=e,i=!0);return r},t.greatestIndex=function(t,n=e){if(1===n.length)return Y(t,n);let r,i=-1,o=-1;for(const e of t)++o,(i<0?0===n(e,e):n(e,r)>0)&&(r=e,i=o);return i},t.group=w,t.groupSort=function(t,n,r){return(1===n.length?k(M(t,n,r),(([t,n],[r,i])=>e(n,i)||e(t,r))):k(w(t,r),(([t,r],[i,o])=>n(r,o)||e(t,i)))).map((([t])=>t))},t.groups=function(t,...e){return _(t,Array.from,b,e)},t.histogram=P,t.index=function(t,...e){return _(t,b,x,e)},t.indexes=function(t,...e){return _(t,Array.from,x,e)},t.intersection=function(t,...e){t=new Set(t),e=e.map(Z);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t},t.least=function(t,n=e){let r,i=!1;if(1===n.length){let o;for(const a of t){const t=n(a);(i?e(t,o)<0:0===e(t,t))&&(r=a,o=t,i=!0)}}else for(const e of t)(i?n(e,r)<0:0===n(e,e))&&(r=e,i=!0);return r},t.leastIndex=$,t.map=function(t,e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof e)throw new TypeError("mapper is not a function");return Array.from(t,((n,r)=>e(n,r,t)))},t.max=I,t.maxIndex=Y,t.mean=function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},t.median=function(t,e){return H(t,.5,e)},t.merge=function(t){return Array.from(function*(t){for(const e of t)yield*e}(t))},t.min=L,t.minIndex=q,t.nice=D,t.pairs=function(t,e=B){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n},t.permute=j,t.quantile=H,t.quantileSorted=function(t,e,n=r){if(i=t.length){if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,o=(i-1)*e,a=Math.floor(o),u=+n(t[a],a,t);return u+(+n(t[a+1],a+1,t)-u)*(o-a)}},t.quickselect=U,t.range=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r=T?i*=10:o>=A?i*=5:o>=C&&(i*=2),e{const{id:e,min:n,max:r,style:i}=t,{euiTheme:o}=Object(c.useEuiTheme)(),{colors:a}=o;return Object(l.jsx)(s.RectAnnotation,{dataValues:[{coordinates:{x0:n,x1:r,y0:0,y1:1e9},details:e}],id:`rect_brush_annotation_${e}`,style:null!=i?i:{strokeWidth:0,stroke:a.lightShade,fill:a.lightShade,opacity:.5},hideTooltips:!0})};var h=n(12),d=n(100);function p(){}var g=function(t){return null==t?p:function(){return this.querySelector(t)}};function m(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function v(){return[]}var y=function(t){return null==t?v:function(){return this.querySelectorAll(t)}},b=function(t){return function(){return this.matches(t)}};function w(t){return function(e){return e.matches(t)}}var M=Array.prototype.find;function x(){return this.firstElementChild}var _=Array.prototype.filter;function j(){return Array.from(this.children)}var k=function(t){return new Array(t.length)};function S(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}S.prototype={constructor:S,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var O=function(t){return function(){return t}};function T(t,e,n,r,i,o){for(var a,u=0,s=e.length,c=o.length;ue?1:t>=e?0:NaN}var D="http://www.w3.org/1999/xhtml",F={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},P=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),F.hasOwnProperty(e)?{space:F[e],local:t}:t};function I(t){return function(){this.removeAttribute(t)}}function L(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,e){return function(){this.setAttribute(t,e)}}function R(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function H(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Y(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var q=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function B(t){return function(){this.style.removeProperty(t)}}function $(t,e,n){return function(){this.style.setProperty(t,e,n)}}function z(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function V(t,e){return t.style.getPropertyValue(e)||q(t).getComputedStyle(t,null).getPropertyValue(e)}function X(t){return function(){delete this[t]}}function W(t,e){return function(){this[t]=e}}function Z(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function G(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=G(t.getAttribute("class")||"")}function K(t,e){for(var n=Q(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var pt=function(t){var e=P(t);return(e.local?dt:ht)(e)};function gt(){return null}function mt(){var t=this.parentNode;t&&t.removeChild(this)}function vt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function yt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function bt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=w&&(w=b+1);!(y=m[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=E);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?B:"function"==typeof e?z:$)(t,e,null==n?"":n)):V(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?X:"function"==typeof e?Z:W)(t,e)):this.node()[t]},classed:function(t,e){var n=G(t+"");if(arguments.length<2){for(var r=Q(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?wt:bt,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Jt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Jt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Yt.exec(t))?new te(e[1],e[2],e[3],1):(e=qt.exec(t))?new te(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Bt.exec(t))?Jt(e[1],e[2],e[3],e[4]):(e=$t.exec(t))?Jt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=zt.exec(t))?ae(e[1],e[2]/100,e[3]/100,1):(e=Vt.exec(t))?ae(e[1],e[2]/100,e[3]/100,e[4]):Xt.hasOwnProperty(t)?Qt(Xt[t]):"transparent"===t?new te(NaN,NaN,NaN,0):null}function Qt(t){return new te(t>>16&255,t>>8&255,255&t,1)}function Jt(t,e,n,r){return r<=0&&(t=e=n=NaN),new te(t,e,n,r)}function Kt(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ft||(i=Gt(i)),i?new te((i=i.rgb()).r,i.g,i.b,i.opacity):new te):new te(t,e,n,null==r?1:r);var i}function te(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ee(){return`#${oe(this.r)}${oe(this.g)}${oe(this.b)}`}function ne(){const t=re(this.opacity);return`${1===t?"rgb(":"rgba("}${ie(this.r)}, ${ie(this.g)}, ${ie(this.b)}${1===t?")":`, ${t})`}`}function re(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ie(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function oe(t){return((t=ie(t))<16?"0":"")+t.toString(16)}function ae(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new se(t,e,n,r)}function ue(t){if(t instanceof se)return new se(t.h,t.s,t.l,t.opacity);if(t instanceof Ft||(t=Gt(t)),!t)return new se;if(t instanceof se)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&s<1?0:a,new se(a,u,s,t.opacity)}function se(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ce(t){return(t=(t||0)%360)<0?t+360:t}function le(t){return Math.max(0,Math.min(1,t||0))}function fe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function he(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Et(Ft,Gt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Wt,formatHex:Wt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ue(this).formatHsl()},formatRgb:Zt,toString:Zt}),Et(te,Kt,Dt(Ft,{brighter(t){return t=null==t?It:Math.pow(It,t),new te(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new te(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new te(ie(this.r),ie(this.g),ie(this.b),re(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ee,formatHex:ee,formatHex8:function(){return`#${oe(this.r)}${oe(this.g)}${oe(this.b)}${oe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ne,toString:ne})),Et(se,(function(t,e,n,r){return 1===arguments.length?ue(t):new se(t,e,n,null==r?1:r)}),Dt(Ft,{brighter(t){return t=null==t?It:Math.pow(It,t),new se(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new se(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new te(fe(t>=240?t-240:t+120,i,r),fe(t,i,r),fe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new se(ce(this.h),le(this.s),le(this.l),re(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=re(this.opacity);return`${1===t?"hsl(":"hsla("}${ce(this.h)}, ${100*le(this.s)}%, ${100*le(this.l)}%${1===t?")":`, ${t})`}`}}));var de=t=>()=>t;function pe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):de(isNaN(t)?e:t)}var ge=function t(e){var n=function(t){return 1==(t=+t)?pe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):de(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Kt(t)).r,(e=Kt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=pe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function me(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=ro&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:xe(n,r)})),o=ke.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--Ce}()}finally{Ce=0,function(){for(var t,e,n=be,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:be=e);we=t,ze(r)}(),Pe=0}}function $e(){var t=Le.now(),e=t-Fe;e>De&&(Ie-=e,Fe=t)}function ze(t){Ce||(Ne&&(Ne=clearTimeout(Ne)),t-Pe>24?(t<1/0&&(Ne=setTimeout(Be,t-Le.now()-Ie)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Fe=Le.now(),Ee=setInterval($e,De)),Ce=1,Ue(Be)))}Ye.prototype=qe.prototype={constructor:Ye,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Re():+n)+(null==e?0:+e),this._next||we===this||(we?we._next=this:be=this,we=this),this._call=t,this._time=n,ze()},stop:function(){this._call&&(this._call=null,this._time=1/0,ze())}};var Ve=function(t,e,n){var r=new Ye;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r},Xe=Object(d.dispatch)("start","end","cancel","interrupt"),We=[],Ze=0,Ge=1,Qe=2,Je=3,Ke=4,tn=5,en=6,nn=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(s){var c,l,f,h;if(n.state!==Ge)return u();for(c in i)if((h=i[c]).name===n.name){if(h.state===Je)return Ve(o);h.state===Ke?(h.state=en,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cZe)throw new Error("too late; already scheduled");return n}function on(t,e){var n=an(t,e);if(n.state>Je)throw new Error("too late; already running");return n}function an(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var un,sn=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>Qe&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:xe(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:xe(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:xe(t,n)},{i:u-2,x:xe(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?rn:on;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=P(t),r="transform"===n?pn:yn;return this.attrTween(t,"function"==typeof e?(n.local?jn:_n)(n,r,vn(this,"attr."+t,e)):null==e?(n.local?wn:bn)(n):(n.local?xn:Mn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=P(t);return this.tween(n,(r.local?kn:Sn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?dn:yn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=V(this,t),a=(this.style.removeProperty(t),V(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,En(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=V(this,t),u=n(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=V(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u))}}(t,r,vn(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var s=on(this,t),c=s.on,l=null==s.value[a]?o||(o=En(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(u,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=V(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(vn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=an(this.node(),n).tween,o=0,a=i.length;oGe&&n.name===e)return new Fn([[t]],Hn,e,+r);return null},qn=t=>()=>t;function Bn(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}var $n=function(t){t.preventDefault(),t.stopImmediatePropagation()},zn={name:"drag"},Vn={name:"space"},Xn={name:"handle"},Wn={name:"center"};const{abs:Zn,max:Gn,min:Qn}=Math;function Jn(t){return[+t[0],+t[1]]}function Kn(t){return[Jn(t[0]),Jn(t[1])]}var tr={name:"x",handles:["w","e"].map(sr),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},er={name:"y",handles:["n","s"].map(sr),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},nr={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(sr),input:function(t){return null==t?null:Kn(t)},output:function(t){return t}},rr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ir={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},or={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ar={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ur={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function sr(t){return{type:t}}function cr(t){return!t.ctrlKey&&!t.button}function lr(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function fr(){return navigator.maxTouchPoints||"ontouchstart"in this}function hr(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function dr(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function pr(){return vr(tr)}function gr(){return vr(er)}var mr=function(){return vr(nr)};function vr(t){var e,n=lr,r=cr,i=fr,o=!0,a=Object(d.dispatch)("start","brush","end"),u=6;function s(e){var n=e.property("__brush",m).selectAll(".overlay").data([sr("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",rr.overlay).merge(n).each((function(){var t=hr(this).extent;Tt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([sr("selection")]).enter().append("rect").attr("class","selection").attr("cursor",rr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return rr[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Tt(this),e=hr(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-u/2:e[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-u/2:e[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,u,s,f,h,d,p,g,m,v,y=this,b=n.target.__data__.type,w="selection"===(o&&n.metaKey?b="overlay":b)?zn:o&&n.altKey?Wn:Xn,M=t===er?null:ar[b],x=t===tr?null:ur[b],_=hr(y),j=_.extent,k=_.selection,S=j[0][0],O=j[0][1],T=j[1][0],A=j[1][1],C=0,N=0,E=M&&x&&o&&n.shiftKey,D=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Ae(t,y)).point0=t.slice(),t.identifier=e,t}));sn(y);var F=l(y,arguments,!0).beforestart();if("overlay"===b){k&&(g=!0);const e=[D[0],D[1]||D[0]];_.selection=k=[[i=t===er?S:Qn(e[0][0],e[1][0]),u=t===tr?O:Qn(e[0][1],e[1][1])],[f=t===er?T:Gn(e[0][0],e[1][0]),d=t===tr?A:Gn(e[0][1],e[1][1])]],D.length>1&&R(n)}else i=k[0][0],u=k[0][1],f=k[1][0],d=k[1][1];a=i,s=u,h=f,p=d;var P=Tt(y).attr("pointer-events","none"),I=P.selectAll(".overlay").attr("cursor",rr[b]);if(n.touches)F.moved=U,F.ended=H;else{var L=Tt(n.view).on("mousemove.brush",U,!0).on("mouseup.brush",H,!0);o&&L.on("keydown.brush",(function(t){switch(t.keyCode){case 16:E=M&&x;break;case 18:w===Xn&&(M&&(f=h-C*M,i=a+C*M),x&&(d=p-N*x,u=s+N*x),w=Wn,R(t));break;case 32:w!==Xn&&w!==Wn||(M<0?f=h-C:M>0&&(i=a-C),x<0?d=p-N:x>0&&(u=s-N),w=Vn,I.attr("cursor",rr.selection),R(t));break;default:return}$n(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:E&&(m=v=E=!1,R(t));break;case 18:w===Wn&&(M<0?f=h:M>0&&(i=a),x<0?d=p:x>0&&(u=s),w=Xn,R(t));break;case 32:w===Vn&&(t.altKey?(M&&(f=h-C*M,i=a+C*M),x&&(d=p-N*x,u=s+N*x),w=Wn):(M<0?f=h:M>0&&(i=a),x<0?d=p:x>0&&(u=s),w=Xn),I.attr("cursor",rr[b]),R(t));break;default:return}$n(t)}),!0),Nt(n.view)}c.call(y),F.start(n,w.name)}function U(t){for(const e of t.changedTouches||[t])for(const t of D)t.identifier===e.identifier&&(t.cur=Ae(e,y));if(E&&!m&&!v&&1===D.length){const t=D[0];Zn(t.cur[0]-t[0])>Zn(t.cur[1]-t[1])?v=!0:m=!0}for(const t of D)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,$n(t),R(t)}function R(t){const e=D[0],n=e.point0;var r;switch(C=e[0]-n[0],N=e[1]-n[1],w){case Vn:case zn:M&&(C=Gn(S-i,Qn(T-f,C)),a=i+C,h=f+C),x&&(N=Gn(O-u,Qn(A-d,N)),s=u+N,p=d+N);break;case Xn:D[1]?(M&&(a=Gn(S,Qn(T,D[0][0])),h=Gn(S,Qn(T,D[1][0])),M=1),x&&(s=Gn(O,Qn(A,D[0][1])),p=Gn(O,Qn(A,D[1][1])),x=1)):(M<0?(C=Gn(S-i,Qn(T-i,C)),a=i+C,h=f):M>0&&(C=Gn(S-f,Qn(T-f,C)),a=i,h=f+C),x<0?(N=Gn(O-u,Qn(A-u,N)),s=u+N,p=d):x>0&&(N=Gn(O-d,Qn(A-d,N)),s=u,p=d+N));break;case Wn:M&&(a=Gn(S,Qn(T,i-C*M)),h=Gn(S,Qn(T,f+C*M))),x&&(s=Gn(O,Qn(A,u-N*x)),p=Gn(O,Qn(A,d+N*x)))}hAe(t,e)))},jr=function(t){return"string"==typeof t?new kt([document.querySelectorAll(t)],[document.documentElement]):new kt([m(t)],jt)},kr=n(77);n(120);const{brush:Sr,brushSelection:Or,brushX:Tr}=i,{scaleLinear:Ar}=yr,{select:Cr}=o;Cr.prototype.transition=Pn;const Nr={brush:Sr,brushSelection:Or,brushX:Tr,scaleLinear:Ar,select:Cr,transition:r},Er=t=>Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1],Dr=20,Fr=4,Pr=4,Ir=2,Lr=t=>{const{windowParameters:e,min:n,max:r,onChange:i,marginLeft:o,snapTimestamps:s,width:c}=t,f=Object(a.useRef)(null),d=Object(a.useRef)([]),p=Object(a.useRef)(c),g=Object(a.useRef)(n),m=Object(a.useRef)(r),v=Object(a.useRef)(s),{baselineMin:y,baselineMax:b,deviationMin:w,deviationMax:M}=e;return Object(a.useEffect)((()=>{if(f.current&&c>0){const t=Nr.select(f.current);function e(t,e,n){d.current.push({id:t,brush:Nr.brushX().handleSize(Pr).on("end",(function(){var e,n,r,a,u,s;const c=p.current,l=Nr.scaleLinear().domain([g.current,m.current]).rangeRound([0,c]),f=t=>Math.round(l.invert(t)),h=null!==(e=l(g.current))&&void 0!==e?e:0,y=null!==(n=l(m.current))&&void 0!==n?n:0,b=Math.round((y-h)/100),w=Nr.select("#aiops-brush-baseline"),M=Nr.brushSelection(w.node()),x=Nr.select("#aiops-brush-deviation"),_=Nr.brushSelection(x.node());if(!Er(_)||!Er(M))return;const j=w.selectAll(".overlay"),k=x.selectAll(".overlay");let S,O;if(j.each(((t,e,n)=>{S=Nr.select(n[e]).attr("width")})),k.each(((t,e,n)=>{O=Nr.select(n[e]).attr("width")})),S!==O)return;const T={baselineMin:f(M[0]),baselineMax:f(M[1]),deviationMin:f(_[0]),deviationMax:f(_[1])};if("deviation"===t&&_&&M&&_[0]-bt.id));e.enter().insert("g",".brush").attr("class","brush").attr("id",(t=>"aiops-brush-"+t.id)).attr("data-test-subj",(t=>"aiopsBrush"+t.id.charAt(0).toUpperCase()+t.id.slice(1))).each(((t,e,i)=>{var o,a;const u=Nr.scaleLinear().domain([n,r]).rangeRound([0,p.current]);t.brush.extent([[0,Fr],[p.current,Dr-Fr]]),t.brush(Nr.select(i[e]));const s=null!==(o=u(t.start))&&void 0!==o?o:0,c=null!==(a=u(t.end))&&void 0!==a?a:0;t.brush.move(Nr.select(i[e]),[s,c])})),e.attr("class","brush").selectAll(".overlay").attr("width",p.current).style("pointer-events","none"),e.selectAll(".handle").attr("rx",Ir).attr("ry",Ir),e.exit().remove()}function a(){t.selectAll(".brush").data(d.current,(t=>t.id)).each((function(t,e,n){var r,i;const o=Nr.scaleLinear().domain([g.current,m.current]).rangeRound([0,p.current]);t.brush.extent([[0,Fr],[p.current,Dr-Fr]]),t.brush(Nr.select(n[e]));const a=null!==(r=o(t.start))&&void 0!==r?r:0,u=null!==(i=o(t.end))&&void 0!==i?i:0;t.brush.move(Nr.select(n[e]),[a,u])}))}2!==d.current.length?(p.current=c,e("baseline",y,b),e("deviation",w,M)):p.current===c&&g.current===n&&m.current===r&&Object(h.isEqual)(v.current,s)||(p.current=c,g.current=n,m.current=r,v.current=s,a()),o()}}),[n,r,c,y,b,w,M,s,i]),Object(l.jsx)(u.a.Fragment,null,c>0&&Object(l.jsx)("svg",{className:"aiops-dual-brush","data-test-subj":"aiopsDualBrush",width:c,height:Dr,style:{marginLeft:o}},Object(l.jsx)("g",{className:"brushes",width:c,ref:f})))};var Ur=n(11),Rr=n(13);const Hr=t=>{const{children:e,isBrushCleared:n,progress:r,progressMessage:i,onRefresh:o,onCancel:s,onReset:f,isRunning:h,shouldRerunAnalysis:d,runAnalysisDisabled:p=!1}=t,{euiTheme:g}=Object(c.useEuiTheme)(),m=(v=g.colors.success,Object(a.useMemo)((()=>{const t={background:`repeating-linear-gradient(\n -45deg,\n transparent 0 6px,\n rgba(0, 0, 0, 0.1) 6px 12px\n ),\n ${v}`,backgroundSize:"calc(12px / 0.707) 100%, 100% 800%",backgroundPosition:"inherit"};return Object(l.css)({"progress[value]":{animation:"aiopsAnimatedProgress 4s infinite linear","::-webkit-progress-inner-element":{overflow:"hidden",backgroundPosition:"inherit"},"::-webkit-progress-bar":{backgroundColor:"transparent",backgroundPosition:"inherit"},"::-webkit-progress-value":t,"::-moz-progress-bar":t,"@keyframes aiopsAnimatedProgress":{"0%":{backgroundPosition:"0 0"},"100%":{backgroundPosition:"calc(10 * (12px / 0.707)) 100%"}}}},"","")}),[v]));var v;return Object(l.jsx)(c.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(l.jsx)(c.EuiFlexItem,{grow:!1},!h&&Object(l.jsx)(c.EuiButton,{disabled:p,"data-test-subj":"aiopsRerunAnalysisButton"+(d?" shouldRerun":""),size:"s",onClick:o,color:d?"warning":"primary"},Object(l.jsx)(c.EuiFlexGroup,null,Object(l.jsx)(c.EuiFlexItem,null,Object(l.jsx)(Rr.FormattedMessage,{id:"xpack.aiops.rerunAnalysisButtonTitle",defaultMessage:"Run analysis"})),d&&Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)(c.EuiFlexItem,null,Object(l.jsx)(c.EuiIconTip,{"aria-label":"Warning",type:"warning",color:"warning",content:Ur.i18n.translate("xpack.aiops.rerunAnalysisTooltipContent",{defaultMessage:"Analysis data may be out of date due to selection update. Rerun analysis."})}))))),h&&Object(l.jsx)(c.EuiButton,{"data-test-subj":"aiopsCancelAnalysisButton",size:"s",onClick:s},Object(l.jsx)(Rr.FormattedMessage,{id:"xpack.aiops.cancelAnalysisButtonTitle",defaultMessage:"Cancel"}))),1!==r&&!1!==h||n?null:Object(l.jsx)(c.EuiFlexItem,{grow:!1},Object(l.jsx)(c.EuiButton,{"data-test-subj":"aiopsClearSelectionBadge",size:"s",onClick:f,color:"text"},Object(l.jsx)(Rr.FormattedMessage,{id:"xpack.aiops.resetLabel",defaultMessage:"Reset"}))),Object(l.jsx)(c.EuiFlexItem,null,1===r?Object(l.jsx)(c.EuiFlexGroup,{gutterSize:"xs",alignItems:"center",responsive:!1},Object(l.jsx)(c.EuiFlexItem,{grow:!1},Object(l.jsx)(c.EuiIcon,{type:"checkInCircleFilled",color:g.colors.success})),Object(l.jsx)(c.EuiFlexItem,{grow:!1,"data-test-subj":"aiopsAnalysisComplete"},Object(l.jsx)("small",null,Ur.i18n.translate("xpack.aiops.analysisCompleteLabel",{defaultMessage:"Analysis complete"})))):null,Object(l.jsx)(c.EuiFlexGroup,{direction:"column",gutterSize:"none",css:1===r?{display:"none"}:void 0},Object(l.jsx)(c.EuiFlexItem,{"data-test-subj":"aiopProgressTitle"},Object(l.jsx)(c.EuiText,{size:"xs",color:"subdued"},Object(l.jsx)(Rr.FormattedMessage,{"data-test-subj":"aiopsProgressTitleMessage",id:"xpack.aiops.progressTitle",defaultMessage:"Progress: {progress}% — {progressMessage}",values:{progress:Math.round(100*r),progressMessage:i}}))),Object(l.jsx)(c.EuiFlexItem,{css:h?m:void 0},Object(l.jsx)(c.EuiProgress,{"aria-label":Ur.i18n.translate("xpack.aiops.progressAriaLabel",{defaultMessage:"Progress"}),value:Math.round(100*r),max:100,size:"m"})))),e)};var Yr=n(14),qr=n.n(Yr),Br=n(33),$r=n(34);const zr="YYYY-MM-DD",Vr="HH:mm:ss",Xr=({label:t,marginLeft:e,timestampFrom:n,timestampTo:r,width:i})=>{const o=Object($r.formatDate)(n,zr),a=Object($r.formatDate)(r,zr),s=Object($r.formatDate)(n,Vr),f=Object($r.formatDate)(r,Vr);return Object(l.jsx)("div",{css:Object(l.css)({position:"absolute",marginLeft:`${e}px`},"","")},Object(l.jsx)(c.EuiToolTip,{content:Object(l.jsx)(c.EuiText,{size:"xs"},o," ",s," -"," ",o!==a&&Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)("br",null),a," "),f),position:"top"},Object(l.jsx)(c.EuiBadge,{css:Object(l.css)({width:i,textAlign:"center"},"","")},t)))},Wr="document_count";var Zr;!function(t){t.ZOOM="zoom",t.BRUSH="brush"}(Zr||(Zr={}));var Gr={name:"1fepiy1",styles:"margin-bottom:-4px"};const Qr=t=>{var e,n,r,i,o,c,h;const{dependencies:d,brushSelectionUpdateHandler:p,width:g,chartPoints:m,chartPointsSplit:v,timeRangeEarliest:y,timeRangeLatest:b,interval:w,chartPointsSplitLabel:M,isBrushCleared:x,autoAnalysisStart:_,barColorOverride:j,barStyleAccessor:k,barHighlightColorOverride:S,deviationBrush:O={},baselineBrush:T={}}=t,{data:A,uiSettings:C,fieldFormats:N,charts:E}=d,D=E.theme.useChartsTheme(),F=E.theme.useChartsBaseTheme(),P=N.deserialize({id:"date"}),I=C.get("visualization:useLegacyTimeAxis",!1),L=Ur.i18n.translate("xpack.aiops.dataGrid.field.documentCountChart.seriesLabel",{defaultMessage:"document count"}),U=Ur.i18n.translate("xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel",{defaultMessage:"Other document count"}),[R]=Object(a.useState)(Zr.BRUSH),H=Object(a.useMemo)((()=>(void 0===m||m.length<1)&&(void 0===v||Array.isArray(v)&&v.length<1)),[m,v]),Y=Object(a.useMemo)((()=>H?[{time:y,value:0}]:1===m.length?[...m,{time:w?Number(m[0].time)+w:y,value:0}]:m),[m,y,b,w]),q=Object(a.useMemo)((()=>H?[{time:y,value:0}]:Array.isArray(v)&&1===v.length?[...v,{time:w?Number(v[0].time)+w:y,value:0}]:v),[v,y,b,w]),B=Object(a.useMemo)((()=>{const t=[];let e=y;for(;e<=b+w;)t.push(e),e+=w;return t}),[y,b,w]),$=Object(a.useCallback)((t=>{A.query.timefilter.timefilter.setTime({from:qr()(t.from).toISOString(),to:qr()(t.to).toISOString(),mode:"absolute"})}),[A]),z=function(t){return t.isDefault("dateFormat:tz")?qr.a.tz.guess()||qr()().format("Z"):t.get("dateFormat:tz","Browser")}(C),[V,X]=Object(a.useState)(),[W,Z]=Object(a.useState)(),[G,Q]=Object(a.useState)(),J=Object(a.useCallback)((t=>{if(R===Zr.ZOOM&&"number"==typeof t)$({from:t,to:t+w});else if(R===Zr.BRUSH&&void 0===V&&void 0===W&&void 0!==Y){const e="number"==typeof t?Object(kr.d)(t+w/2,y,b+w):t,n=Object(kr.c)(e,B);X(n),Z(n),void 0!==p&&p(n,!0,Object(kr.b)(Y,n))}}),[w,y,b,B,V,Z,p,Y,$,R,W]),K=Object(a.useCallback)((([t])=>{if(void 0===p)return;const e=t[0].x;J(e)}),[J,p]);Object(a.useEffect)((()=>{void 0!==_&&J(_)}),[J,_]),Object(a.useEffect)((()=>{x&&void 0!==V&&(X(void 0),Z(void 0))}),[x,V]);const[tt,et]=Object(a.useState)(),[nt,rt]=Object(a.useState)();Object(a.useEffect)((()=>{R!==Zr.BRUSH&&(X(void 0),Z(void 0))}),[R]);const it=V&&W&&nt&&tt&&tt>0,ot=G?function(t,e){const{baselineMin:n,baselineMax:r,deviationMin:i}=t,o=r-n;return i{if(!t)return;const[e,n]=t;$({from:e,to:n})}:void 0,onElementClick:K,onProjectionAreaChange:({projection:t})=>{rt(t.left),et(t.width)},theme:D,baseTheme:F,debugState:null!==(h=window._echDebugStateFlag)&&void 0!==h&&h,showLegend:!1,showLegendExtra:!1}),Object(l.jsx)(s.Axis,{id:"aiops-histogram-left-axis",position:s.Position.Left,ticks:2,integersOnly:!0}),Object(l.jsx)(s.Axis,{id:"aiops-histogram-bottom-axis",position:s.Position.Bottom,showOverlappingTicks:!0,tickFormat:t=>P.convert(t),labelFormat:I?void 0:()=>"",timeAxisLayerCount:I?0:2,style:I?{}:Br.MULTILAYER_TIME_AXIS_STYLE}),(null==Y?void 0:Y.length)&&Object(l.jsx)(s.HistogramBarSeries,{id:Wr,name:v?U:L,xScaleType:s.ScaleType.Time,yScaleType:s.ScaleType.Linear,xAccessor:"time",yAccessors:["value"],data:Y,timeZone:z,color:ut,yNice:!0,styleAccessor:k}),(null==q?void 0:q.length)&&Object(l.jsx)(s.HistogramBarSeries,{id:`${Wr}_split`,name:M,xScaleType:s.ScaleType.Time,yScaleType:s.ScaleType.Linear,xAccessor:"time",yAccessors:["value"],data:q,timeZone:z,color:st,yNice:!0}),W&&Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)(f,{id:"aiopsBaseline",min:W.baselineMin,max:W.baselineMax,style:T.annotationStyle}),Object(l.jsx)(f,{id:"aiopsDeviation",min:W.deviationMin,max:W.deviationMax,style:O.annotationStyle})))))}},95:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n(1);var r=n(0),i=n(22),o=n(2),a=n(13),u=n(38),s=n(66),c={name:"1wnowod",styles:"display:flex;align-items:center;justify-content:center"};const l=({chartData:t,isLoading:e,label:n,barColorOverride:l,barHighlightColorOverride:f})=>{const{charts:h}=Object(u.b)(),d=Object(s.a)(),p=h.theme.useChartsTheme(),g=Object(r.css)({width:"80px",height:d.euiSizeL,margin:"0px"},"",""),m=c;if(e)return Object(r.jsx)("div",{css:[g,m,"",""]},Object(r.jsx)(o.EuiLoadingChart,{mono:!0}));if(!t)return Object(r.jsx)("div",{css:[g,m,"",""]},Object(r.jsx)(o.EuiTextColor,{color:"subdued"},Object(r.jsx)(a.FormattedMessage,{id:"xpack.aiops.miniHistogram.noDataLabel",defaultMessage:"N/A"})));const v=l?[l]:void 0,y=f?[f]:["orange"];return Object(r.jsx)("div",{css:g},Object(r.jsx)(i.Chart,null,Object(r.jsx)(i.Tooltip,{type:i.TooltipType.None}),Object(r.jsx)(i.Settings,{theme:[{chartMargins:{left:0,right:0,top:0,bottom:0},chartPaddings:{left:0,right:0,top:0,bottom:0},scales:{barsPadding:.1},background:{color:"transparent"}},p],showLegend:!1}),Object(r.jsx)(i.BarSeries,{id:"doc_count_overall",xScaleType:i.ScaleType.Time,yScaleType:i.ScaleType.Linear,xAccessor:"key",yAccessors:["doc_count_overall"],data:t,stackAccessors:[0],color:v}),Object(r.jsx)(i.BarSeries,{id:n,xScaleType:i.ScaleType.Time,yScaleType:i.ScaleType.Linear,xAccessor:"key",yAccessors:["doc_count_significant_term"],data:t,stackAccessors:[0],color:y})))}}}]);