(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[1161],{85531:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var s=n(67294),r=n(45697),i=n.n(r),a=n(84502),o=n(42441),l=n.n(o),p=n(51995),d=n(55867),u=n(19322),c=n.n(u),h=n(11965);const g=p.iK.div`
  ${t=>{let{theme:e}=t;return`\n    .slider-selection {\n      background: ${e.colors.grayscale.light2};\n    }\n    .slider-handle {\n      background: ${e.colors.grayscale.light1};\n    }\n  `}}
`;function m(t){return(0,h.tZ)(g,null,(0,h.tZ)(c(),t))}const f=p.iK.div`
  ${t=>{let{theme:e}=t;return`\n    display: flex;\n    height: 40px;\n    width: 100%;\n    margin: 0;\n\n    .play-slider-controls {\n      flex: 0 0 80px;\n      text-align: middle;\n    }\n\n    .play-slider-scrobbler {\n      flex: 1;\n    }\n\n    .slider.slider-horizontal {\n      width: 100% !important;\n    }\n\n    .slider-button {\n      color: ${e.colors.grayscale.light1};\n      margin-right: ${e.gridUnit}px;\n    }\n\n    div.slider > div.tooltip.tooltip-main.top.in {\n      margin-left: 0 !important;\n    }\n  `}}
`,b={start:i().number.isRequired,step:i().number.isRequired,end:i().number.isRequired,values:i().array.isRequired,onChange:i().func,loopDuration:i().number,maxFrames:i().number,orientation:i().oneOf(["horizontal","vertical"]),reversed:i().bool,disabled:i().bool,range:i().bool};class v extends s.PureComponent{constructor(t){super(t),this.state={intervalId:null};const e=t.end-t.start,n=Math.min(t.maxFrames,e/t.step),s=e/n;this.intervalMilliseconds=t.loopDuration/n,this.increment=s<t.step?t.step:s-s%t.step,this.onChange=this.onChange.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stepBackward=this.stepBackward.bind(this),this.stepForward=this.stepForward.bind(this),this.getPlayClass=this.getPlayClass.bind(this),this.formatter=this.formatter.bind(this)}componentDidMount(){l().bind(["space"],this.play)}componentWillUnmount(){l().unbind(["space"])}onChange(t){this.props.onChange(t.target.value),null!=this.state.intervalId&&this.pause()}getPlayClass(){return null==this.state.intervalId?"fa fa-play fa-lg slider-button":"fa fa-pause fa-lg slider-button"}play(){if(!this.props.disabled)if(null!=this.state.intervalId)this.pause();else{const t=setInterval(this.stepForward,this.intervalMilliseconds);this.setState({intervalId:t})}}pause(){clearInterval(this.state.intervalId),this.setState({intervalId:null})}stepForward(){const{start:t,end:e,step:n,values:s,disabled:r}=this.props;if(r)return;const i=(Array.isArray(s)?s:[s,s+n]).map((t=>t+this.increment)),a=i[1]>e?i[0]-t:0;this.props.onChange(i.map((t=>t-a)))}stepBackward(){const{start:t,end:e,step:n,values:s,disabled:r}=this.props;if(r)return;const i=(Array.isArray(s)?s:[s,s+n]).map((t=>t-this.increment)),a=i[0]<t?e-i[1]:0;this.props.onChange(i.map((t=>t+a)))}formatter(t){if(this.props.disabled)return(0,d.t)("Data has no time steps");let e=t;return Array.isArray(t)?t[0]===t[1]&&(e=[t[0]]):e=[t],e.map((t=>new Date(t).toUTCString())).join(" : ")}render(){const{start:t,end:e,step:n,orientation:s,reversed:r,disabled:i,range:a,values:o}=this.props;return(0,h.tZ)(f,null,(0,h.tZ)("div",{className:"play-slider-controls padded"},(0,h.tZ)("i",{className:"fa fa-step-backward fa-lg slider-button ",onClick:this.stepBackward}),(0,h.tZ)("i",{className:this.getPlayClass(),onClick:this.play}),(0,h.tZ)("i",{className:"fa fa-step-forward fa-lg slider-button ",onClick:this.stepForward})),(0,h.tZ)("div",{className:"play-slider-scrobbler padded"},(0,h.tZ)(m,{value:a?o:o[0],range:a,formatter:this.formatter,change:this.onChange,min:t,max:e,step:n,orientation:s,reversed:r,disabled:i?"disabled":"enabled"})))}}v.propTypes=b,v.defaultProps={onChange:()=>{},loopDuration:15e3,maxFrames:100,orientation:"horizontal",reversed:!1,disabled:!1,range:!0};const y={getLayers:i().func.isRequired,start:i().number.isRequired,end:i().number.isRequired,getStep:i().func,values:i().array.isRequired,aggregation:i().bool,disabled:i().bool,viewport:i().object.isRequired,children:i().node,mapStyle:i().string,mapboxApiAccessToken:i().string.isRequired,setControlValue:i().func,onValuesChange:i().func,width:i().number.isRequired,height:i().number.isRequired};class w extends s.PureComponent{constructor(){super(...arguments),this.containerRef=s.createRef(),this.setTooltip=t=>{const{current:e}=this.containerRef;e&&e.setTooltip(t)}}render(){const{start:t,end:e,getStep:n,disabled:s,aggregation:r,children:i,getLayers:o,values:l,onValuesChange:p,viewport:d,setControlValue:u,mapStyle:c,mapboxApiAccessToken:g,height:m,width:f}=this.props,b=o(l);return(0,h.tZ)("div",null,(0,h.tZ)(a.F,{ref:this.containerRef,viewport:d,layers:b,setControlValue:u,mapStyle:c,mapboxApiAccessToken:g,bottomMargin:s?0:20,width:f,height:m}),!s&&(0,h.tZ)(v,{start:t,end:e,step:n(t),values:l,range:!r,onChange:p}),i)}}w.propTypes=y,w.defaultProps={aggregation:!1,disabled:!1,mapStyle:"light",setControlValue:()=>{},onValuesChange:()=>{}}},84502:(t,e,n)=>{"use strict";n.d(e,{F:()=>b});var s=n(18446),r=n.n(s),i=n(67294),a=n(45697),o=n.n(a),l=n(90530),p=n(65274),d=n(51995),u=n(32103),c=n(11965);const h=d.iK.div`
  ${t=>{let{theme:e,top:n,left:s}=t;return`\n    position: absolute;\n    top: ${n}px;\n    left: ${s}px;\n    padding: ${2*e.gridUnit}px;\n    margin: ${2*e.gridUnit}px;\n    background: ${e.colors.grayscale.dark2};\n    color: ${e.colors.grayscale.light5};\n    maxWidth: 300px;\n    fontSize: ${e.typography.sizes.s}px;\n    zIndex: 9;\n    pointerEvents: none;\n  `}}
`;function g(t){const{tooltip:e}=t;if(null==e)return null;const{x:n,y:s,content:r}=e,i="string"==typeof r?(0,u.Ul)(r):r;return(0,c.tZ)(h,{top:s,left:n},i)}const m={viewport:o().object.isRequired,layers:o().array.isRequired,setControlValue:o().func,mapStyle:o().string,mapboxApiAccessToken:o().string.isRequired,children:o().node,bottomMargin:o().number,width:o().number.isRequired,height:o().number.isRequired,onViewportChange:o().func};class f extends i.Component{constructor(t){super(t),this.setTooltip=t=>{this.setState({tooltip:t})},this.tick=this.tick.bind(this),this.onViewStateChange=this.onViewStateChange.bind(this),this.state={timer:setInterval(this.tick,250),tooltip:null,viewState:t.viewport}}UNSAFE_componentWillReceiveProps(t){r()(t.viewport,this.props.viewport)||this.setState({viewState:t.viewport})}componentWillUnmount(){clearInterval(this.state.timer)}onViewStateChange(t){let{viewState:e}=t;this.setState({viewState:e,lastUpdate:Date.now()})}tick(){const{lastUpdate:t}=this.state;if(t&&Date.now()-t>250){const t=this.props.setControlValue;t&&t("viewport",this.state.viewState),this.setState({lastUpdate:null})}}layers(){return this.props.layers.some((t=>"function"==typeof t))?this.props.layers.map((t=>"function"==typeof t?t():t)):this.props.layers}render(){const{children:t,bottomMargin:e,height:n,width:s}=this.props,{viewState:r,tooltip:a}=this.state,o=n-e,d=this.layers();return(0,c.tZ)(i.Fragment,null,(0,c.tZ)("div",{style:{position:"relative",width:s,height:o}},(0,c.tZ)(p.Z,{initWebGLParameters:!0,controller:!0,width:s,height:o,layers:d,viewState:r,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:this.onViewStateChange},(0,c.tZ)(l.Z3,{preserveDrawingBuffer:!0,mapStyle:this.props.mapStyle,mapboxApiAccessToken:this.props.mapboxApiAccessToken})),t),(0,c.tZ)(g,{tooltip:a}))}}f.propTypes=m,f.defaultProps={mapStyle:"light",setControlValue:()=>{},children:null,bottomMargin:0};const b=(0,d.iK)(f)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},1740:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var s=n(67294),r=n(45697),i=n.n(r),a=n(11965);const o={label:i().string.isRequired,value:i().string.isRequired};class l extends s.PureComponent{render(){const{label:t,value:e}=this.props;return(0,a.tZ)("div",null,t,(0,a.tZ)("strong",null,e))}}l.propTypes=o},52154:(t,e,n)=>{"use strict";n.d(e,{N:()=>i,Z:()=>o});var s=n(4065),r=n(21207);function i(t,e,n,s){const i=t;let a,o,l=n;return i.js_tooltip&&(l=(0,r.Z)(i.js_tooltip)),l&&(a=t=>{t.picked?e({content:l(t),x:t.x,y:t.y}):e(null)}),i.js_onclick_href?o=t=>{const e=(0,r.Z)(i.js_onclick_href)(t);window.open(e)}:i.table_filter&&void 0!==s&&(o=t=>s(t.object[i.line_column])),{onClick:o,onHover:a,pickable:Boolean(a)}}const a={p1:.01,p5:.05,p95:.95,p99:.99};function o(t,e){if(void 0===t&&(t="sum"),void 0===e&&(e=null),"count"===t)return t=>t.length;let n;return n=t in a?(n,r)=>{let i;return i=e?n.sort(((t,n)=>s.ascending(e(t),e(n)))):n.sort(s.ascending),s.quantile(i,a[t],r)}:s[t],e?t=>n(t.map((t=>e(t)))):t=>n(t)}},64106:(t,e,n)=>{"use strict";n.r(e),n.d(e,{hexToRGB:()=>r});var s=n(50667);function r(t,e){if(void 0===e&&(e=255),!t)return[0,0,0,e];const{r:n,g:r,b:i}=(0,s.B8)(t);return[n,r,i,e]}},21207:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var s=n(55140),r=n.n(s),i=n(59050),a=n(4065),o=n(64106);const l={console,_:i.ZP,colors:o,d3array:a};function p(t,e,n){const s={},i=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;s[i]={};const a=`${i}=${t}`,o={...l,...e};Object.keys(o).forEach((t=>{s[t]=o[t]}));try{return r().runInNewContext(a,s,n),s[i]}catch(t){return()=>t}}},66911:(t,e,n)=>{"use strict";n.d(e,{g:()=>p});var s=n(78580),r=n.n(s),i=n(30381),a=n.n(i);const o=[1,0,1,0,0,0,0];function l(t,e){const n=parseInt(a()(e).format("x"),10);return parseInt(a()(e).add(t).format("x"),10)-n}function p(t,e){const n=a()(Number(t.reduce(((t,e)=>t<e?t:e)))),s=a()(Number(t.reduce(((t,e)=>t>e?t:e))));let i,p,d;if(r()(e).call(e,"/")){const t=e.split("/",2);t[0].endsWith("Z")?(p=a()(t[0]),i=a().duration(t[1])):(p=a()(t[1]),i=a().duration(t[0]))}else i=a().duration(e),p=function(t,e){const n=a()(t).subtract(e),s=t.toArray(),r=n.toArray(),i=s.map(((t,e)=>r[e]!==t)).indexOf(!0),l=s.map(((t,e)=>{if(e===i){const n=t-r[e];return t-(t-o[e])%n}return e<i||-1===i?t:o[e]}));return a()(l)}(n,i);const u=n.valueOf();for(d=p.clone();d.valueOf()<u;)d.add(i);for(;d.valueOf()>u;)d.subtract(i);let c;const h=s.valueOf();for(c=p.clone();c.valueOf()>h;)c.subtract(i);for(;c.valueOf()<h;)c.add(i);const g=null!=e?[d,d.clone().add(i)]:[d,c],m=t.every((t=>null===t));return{start:parseInt(d.format("x"),10),end:parseInt(c.format("x"),10),getStep:l.bind(this,i),values:g.map((t=>parseInt(t.format("x"),10))),disabled:m}}},40461:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var s=n(17013),r=n(4065);const i=[-90,90],a=[-180,180];function o(t,e,n){let[s,r]=t,[i,a]=e;return void 0===n&&(n=.25),s<r?[s,r]:[Math.max(i,s-n),Math.min(a,r+n)]}function l(t,e){let{points:n,width:l,height:p,minExtent:d,maxZoom:u,offset:c,padding:h=20}=e;const{bearing:g,pitch:m}=t,f=function(t){const e=o((0,r.extent)(t,(t=>t[1])),i),n=o((0,r.extent)(t,(t=>t[0])),a);return[[n[0],e[0]],[n[1],e[1]]]}(n);try{return{...(0,s.Xg)({bounds:f,width:l,height:p,minExtent:d,maxZoom:u,offset:c,padding:h}),bearing:g,pitch:m}}catch(t){console.error("Could not fit viewport",t)}return t}},92540:()=>{},75307:()=>{}}]);
//# sourceMappingURL=949f079381e033adcd80.chunk.js.map