"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[868],{88274:(t,e,r)=>{r.d(e,{Z:()=>F});var s=r(5872),i=r.n(s),o=r(67294),n=r(47859),a=r(49302),h=r(22222),l=r(68135),d=r(80644),u=r(11064),c=r(55867),p=r(54085),m=r(74464),f=r(9330),g=r(89453),v=r(11965);function y(t){return t}const P=()=>null,Z={id:"",className:"",preTransformProps:y,overrideTransformProps:void 0,postTransformProps:y,onRenderSuccess(){},onRenderFailure(){}},w=new f.Z;class R extends o.PureComponent{constructor(){super(...arguments),this.container=void 0,this.processChartProps=(0,h.P1)([t=>t.chartProps,t=>t.preTransformProps,t=>t.transformProps,t=>t.postTransformProps],(function(t,e,r,s){return void 0===e&&(e=y),void 0===r&&(r=y),void 0===s&&(s=y),s(r(e(t)))})),this.createLoadableRenderer=(0,h.P1)([t=>t.chartType,t=>t.overrideTransformProps],((t,e)=>{if(t){const r=(0,g.Z)({loader:{Chart:()=>(0,p.Z)().getAsPromise(t),transformProps:e?()=>Promise.resolve(e):()=>(0,m.Z)().getAsPromise(t)},loading:e=>this.renderLoading(e,t),render:this.renderChart});return r.preload(),r}return P})),this.renderChart=(t,e)=>{const{Chart:r,transformProps:s}=t,{chartProps:i,preTransformProps:o,postTransformProps:n}=e;return(0,v.tZ)(r,this.processChartProps({chartProps:i,preTransformProps:o,transformProps:s,postTransformProps:n}))},this.renderLoading=(t,e)=>{const{error:r}=t;return r?(0,v.tZ)("div",{className:"alert alert-warning",role:"alert"},(0,v.tZ)("strong",null,(0,c.t)("ERROR"))," ",(0,v.tZ)("code",null,'chartType="',e,'"')," —",r.toString()):null},this.setRef=t=>{this.container=t}}render(){const{id:t,className:e,preTransformProps:r,postTransformProps:s,chartProps:o=w,onRenderSuccess:n,onRenderFailure:a}=this.props,h=this.createLoadableRenderer(this.props);if(null===o)return null;const l={};return t&&(l.id=t),e&&(l.className=e),(0,v.tZ)("div",i()({},l,{ref:this.setRef}),(0,v.tZ)(h,{preTransformProps:r,postTransformProps:s,chartProps:o,onRenderSuccess:n,onRenderFailure:a}))}}R.defaultProps=Z;var S=r(51995);const D={maxWidth:800},C=S.iK.div`
  ${t=>{let{theme:e,width:r,height:s}=t;return v.iv`
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    height: ${s}px;
    width: ${r}px;
    padding: ${4*e.gridUnit}px;

    & .no-results-title {
      font-size: ${e.typography.sizes.l}px;
      font-weight: ${e.typography.weights.bold};
      padding-bottom: ${2*e.gridUnit};
    }

    & .no-results-body {
      font-size: ${e.typography.sizes.m}px;
    }
  `}}
`,b=t=>{let{className:e,height:r,id:s,width:i}=t;const o="string"==typeof i||i>250,n=(0,c.t)("No results were returned for this query. If you expected results to be returned, ensure any filters are configured properly and the datasource contains data for the selected time range.");return(0,v.tZ)(C,{height:r,width:i,className:e,id:s,title:o?void 0:n},(0,v.tZ)("div",{style:D},(0,v.tZ)("div",{className:"no-results-title"},(0,c.t)("No Results")),o&&(0,v.tZ)("div",{className:"no-results-body"},n)))},T={FallbackComponent:function(t){let{componentStack:e,error:r,height:s,width:i}=t;return(0,v.tZ)("div",{css:t=>({backgroundColor:t.colors.grayscale.dark2,color:t.colors.grayscale.light5,overflow:"auto",padding:32}),style:{height:s,width:i}},(0,v.tZ)("div",null,(0,v.tZ)("div",null,(0,v.tZ)("b",null,(0,c.t)("Oops! An error occurred!"))),(0,v.tZ)("code",null,r?r.toString():"Unknown Error")),e&&(0,v.tZ)("div",null,(0,v.tZ)("b",null,(0,c.t)("Stack Trace:")),(0,v.tZ)("code",null,e.split("\n").map((t=>(0,v.tZ)("div",{key:t},t))))))},height:400,width:"100%",enableNoResults:!0};class x extends o.PureComponent{constructor(){super(...arguments),this.core=void 0,this.createChartProps=f.Z.createSelector(),this.parseDimension=(0,h.P1)([t=>{let{width:e}=t;return e},t=>{let{height:e}=t;return e}],((t,e)=>{const r=(0,d.Z)(t),s=(0,d.Z)(e),i={height:s.isDynamic?100*s.multiplier+"%":s.value,width:r.isDynamic?100*r.multiplier+"%":r.value};return{BoundingBox:r.isDynamic&&s.isDynamic&&1===r.multiplier&&1===s.multiplier?o.Fragment:t=>{let{children:e}=t;return(0,v.tZ)("div",{style:i},e)},heightInfo:s,widthInfo:r}})),this.setRef=t=>{this.core=t},this.getQueryCount=()=>{var t,e;return null!=(t=null==(e=(0,u.Z)().get(this.props.chartType))?void 0:e.queryObjectCount)?t:1}}renderChart(t,e){const{id:r,className:s,chartType:o,preTransformProps:a,overrideTransformProps:h,postTransformProps:l,onRenderSuccess:d,onRenderFailure:u,disableErrorBoundary:c,FallbackComponent:p,onErrorBoundary:m,Wrapper:f,queriesData:g,enableNoResults:y,noResults:P,theme:Z,...w}=this.props,S=this.createChartProps({...w,queriesData:g,height:e,width:t,theme:Z});let D;if(!y||g&&!g.slice(0,this.getQueryCount()).every((t=>{let{data:e}=t;return!e||Array.isArray(e)&&0===e.length}))){const i=(0,v.tZ)(R,{ref:this.setRef,id:r,className:s,chartType:o,chartProps:S,preTransformProps:a,overrideTransformProps:h,postTransformProps:l,onRenderSuccess:d,onRenderFailure:u});D=f?(0,v.tZ)(f,{width:t,height:e},i):i}else D=P||(0,v.tZ)(b,{id:r,className:s,height:e,width:t});return!0===c?D:(0,v.tZ)(n.ZP,{FallbackComponent:r=>(0,v.tZ)(p,i()({width:t,height:e},r)),onError:m},D)}render(){const{heightInfo:t,widthInfo:e,BoundingBox:r}=this.parseDimension(this.props);if(e.isDynamic||t.isDynamic){const{debounceTime:s}=this.props;return(0,v.tZ)(r,null,(0,v.tZ)(a.Z,{debounceTime:s},(r=>{let{width:s,height:i}=r;return this.renderChart(e.isDynamic?Math.floor(s):e.value,t.isDynamic?Math.floor(i):t.value)})))}return this.renderChart(e.value,t.value)}}x.defaultProps=T;const F=(0,l.b)(x)},89453:(t,e,r)=>{r.d(e,{Z:()=>n});var s=r(68356),i=r.n(s);const o={onRenderFailure(){},onRenderSuccess(){}};function n(t){const e=i().Map(t);class r extends e{componentDidMount(){this.afterRender()}componentDidUpdate(){this.afterRender()}afterRender(){const{loaded:t,loading:e,error:r}=this.state,{onRenderFailure:s,onRenderSuccess:i}=this.props;e||(r?s(r):t&&Object.keys(t).length>0&&i())}}return r.defaultProps=void 0,r.defaultProps=o,r.preload=e.preload,r}},9330:(t,e,r)=>{r.d(e,{Z:()=>a});var s=r(22222),i=r(78036);const o=800,n=600;class a{constructor(t){void 0===t&&(t={}),this.annotationData=void 0,this.datasource=void 0,this.rawDatasource=void 0,this.initialValues=void 0,this.formData=void 0,this.rawFormData=void 0,this.height=void 0,this.hooks=void 0,this.ownState=void 0,this.filterState=void 0,this.legendState=void 0,this.queriesData=void 0,this.width=void 0,this.behaviors=void 0,this.displaySettings=void 0,this.appSection=void 0,this.isRefreshing=void 0,this.inputRef=void 0,this.inContextMenu=void 0,this.emitCrossFilters=void 0,this.theme=void 0;const{annotationData:e={},datasource:r={},formData:s={},hooks:a={},ownState:h={},filterState:l={},legendState:d,initialValues:u={},queriesData:c=[],behaviors:p=[],displaySettings:m={},width:f=o,height:g=n,appSection:v,isRefreshing:y,inputRef:P,inContextMenu:Z=!1,emitCrossFilters:w=!1,theme:R}=t;this.width=f,this.height=g,this.annotationData=e,this.datasource=(0,i.Z)(r),this.rawDatasource=r,this.formData=(0,i.Z)(s),this.rawFormData=s,this.hooks=a,this.initialValues=u,this.queriesData=c,this.ownState=h,this.filterState=l,this.legendState=d,this.behaviors=p,this.displaySettings=m,this.appSection=v,this.isRefreshing=y,this.inputRef=P,this.inContextMenu=Z,this.emitCrossFilters=w,this.theme=R}}a.createSelector=void 0,a.createSelector=function(){return(0,s.P1)((t=>t.annotationData),(t=>t.datasource),(t=>t.formData),(t=>t.height),(t=>t.hooks),(t=>t.initialValues),(t=>t.queriesData),(t=>t.width),(t=>t.ownState),(t=>t.filterState),(t=>t.legendState),(t=>t.behaviors),(t=>t.displaySettings),(t=>t.appSection),(t=>t.isRefreshing),(t=>t.inputRef),(t=>t.inContextMenu),(t=>t.emitCrossFilters),(t=>t.theme),((t,e,r,s,i,o,n,h,l,d,u,c,p,m,f,g,v,y,P)=>new a({annotationData:t,datasource:e,formData:r,height:s,hooks:i,initialValues:o,queriesData:n,ownState:l,filterState:d,legendState:u,width:h,behaviors:c,displaySettings:p,appSection:m,isRefreshing:f,inputRef:g,inContextMenu:v,emitCrossFilters:y,theme:P})))}},80644:(t,e,r)=>{r.d(e,{Z:()=>i});const s={isDynamic:!0,multiplier:1};function i(t){return"auto"===t||"100%"===t?s:"string"==typeof t&&t.length>0&&"%"===t[t.length-1]?{isDynamic:!0,multiplier:parseFloat(t)/100}:{isDynamic:!1,value:"number"==typeof t?t:parseFloat(t)}}},28291:(t,e,r)=>{r.d(e,{S:()=>o});var s=r(67294),i=r(85716);function o(t,e){const r=(0,i.D)(t);(0,s.useEffect)((()=>{t!==r&&e(r,t)}),[t,r,e])}},78036:(t,e,r)=>{r.d(e,{Z:()=>l});var s=r(68929),i=r.n(s),o=r(68630),n=r.n(o),a=r(67523),h=r.n(a);function l(t){if(null==t)return t;if(n()(t))return h()(t,((t,e)=>i()(e)));throw new Error(`Cannot convert input that is not a plain object: ${t}`)}}}]);
//# sourceMappingURL=68d3817faf986cabcaef.chunk.js.map