(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3745],{78918:(t,e,o)=>{"use strict";o.d(e,{Z:()=>n});var r=o(95772),i=o(63803),s=o(61855);class n extends r.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id?(t.object=e.__source.object,t.index=e.__source.index,t):t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){const{_subLayerProps:o}=this.props;return e&&e.length||o&&o[t]}getSubLayerClass(t,e){const{_subLayerProps:o}=this.props;return o&&o[t]&&o[t].type||e}getSubLayerRow(t,e,o){return t.__source={parent:this,object:e,index:o},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(o,r)=>o&&o.__source?(e.index=o.__source.index,t(o.__source.object,e)):t(o,r)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:o,visible:r,parameters:i,getPolygonOffset:s,highlightedObjectIndex:n,autoHighlight:a,highlightColor:l,coordinateSystem:p,coordinateOrigin:c,wrapLongitude:u,positionFormat:d,modelMatrix:h,extensions:g,fetch:f,_subLayerProps:y}=this.props,b={opacity:e,pickable:o,visible:r,parameters:i,getPolygonOffset:s,highlightedObjectIndex:n,autoHighlight:a,highlightColor:l,coordinateSystem:p,coordinateOrigin:c,wrapLongitude:u,positionFormat:d,modelMatrix:h,extensions:g,fetch:f},m=y&&y[t.id],v=m&&m.updateTriggers,x=t.id||"sublayer";if(m){const e=this.constructor._propTypes,o=t.type?t.type._propTypes:{};for(const t in m){const r=o[t]||e[t];r&&"accessor"===r.type&&(m[t]=this.getSubLayerAccessor(m[t]))}}Object.assign(b,t,m),b.id="".concat(this.props.id,"-").concat(x),b.updateTriggers={all:this.props.updateTriggers.all,...t.updateTriggers,...v};for(const t of g){const e=t.getSubLayerProps.call(this,t);e&&Object.assign(b,e,{updateTriggers:Object.assign(b.updateTriggers,e.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=(0,s.x)(t,Boolean),this.internalState.subLayers=t),(0,i.Z)("compositeLayer.renderLayers",this,e,t);for(const e of t)e.parent=this}}n.layerName="CompositeLayer"},84502:(t,e,o)=>{"use strict";o.d(e,{F:()=>b});var r=o(18446),i=o.n(r),s=o(67294),n=o(45697),a=o.n(n),l=o(90530),p=o(65274),c=o(51995),u=o(32103),d=o(11965);const h=c.iK.div`
  ${t=>{let{theme:e,top:o,left:r}=t;return`\n    position: absolute;\n    top: ${o}px;\n    left: ${r}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:o,y:r,content:i}=e,s="string"==typeof i?(0,u.Ul)(i):i;return(0,d.tZ)(h,{top:r,left:o},s)}const f={viewport:a().object.isRequired,layers:a().array.isRequired,setControlValue:a().func,mapStyle:a().string,mapboxApiAccessToken:a().string.isRequired,children:a().node,bottomMargin:a().number,width:a().number.isRequired,height:a().number.isRequired,onViewportChange:a().func};class y extends s.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){i()(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:o,width:r}=this.props,{viewState:i,tooltip:n}=this.state,a=o-e,c=this.layers();return(0,d.tZ)(s.Fragment,null,(0,d.tZ)("div",{style:{position:"relative",width:r,height:a}},(0,d.tZ)(p.Z,{initWebGLParameters:!0,controller:!0,width:r,height:a,layers:c,viewState:i,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:this.onViewStateChange},(0,d.tZ)(l.Z3,{preserveDrawingBuffer:!0,mapStyle:this.props.mapStyle,mapboxApiAccessToken:this.props.mapboxApiAccessToken})),t),(0,d.tZ)(g,{tooltip:n}))}}y.propTypes=f,y.defaultProps={mapStyle:"light",setControlValue:()=>{},children:null,bottomMargin:0};const b=(0,c.iK)(y)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},1740:(t,e,o)=>{"use strict";o.d(e,{Z:()=>l});var r=o(67294),i=o(45697),s=o.n(i),n=o(11965);const a={label:s().string.isRequired,value:s().string.isRequired};class l extends r.PureComponent{render(){const{label:t,value:e}=this.props;return(0,n.tZ)("div",null,t,(0,n.tZ)("strong",null,e))}}l.propTypes=a},3251:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>Z,getLayer:()=>C});var r=o(67294),i=o(45697),s=o.n(i),n=o(21497),a=o(29319),l=o.n(a),p=o(84502),c=o(64106),u=o(21207),d=o(52154),h=o(1740),g=o(40461),f=o(11965);const y={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},b=(t,e)=>{const o={};return Object.keys(t).forEach((e=>{e in y?o[y[e]]=t[e]:o[e]=t[e]})),"string"==typeof t.fillColor&&(o.fillColor=(0,c.hexToRGB)(t.fillColor)),"string"==typeof t.strokeColor&&(o.strokeColor=(0,c.hexToRGB)(t.strokeColor)),{...o,...e}};let m;const v=(t,e,o)=>{if(t&&t.features&&t.features.forEach((r=>{v(r,e,t.extraProps||o)})),t&&t.geometry){const r={...t,properties:b(t.properties,e)};r.extraProps||(r.extraProps=o),m.push(r)}};function x(t){return t.object.extraProps&&(0,f.tZ)("div",{className:"deckgl-tooltip"},Object.keys(t.object.extraProps).map(((e,o)=>(0,f.tZ)(h.Z,{key:`prop-${o}`,label:`${e}: `,value:`${t.object.extraProps[e]}`}))))}const _=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.fillColor},w=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.strokeColor};function C(t,e,o,r){const i=t,s=i.fill_color_picker,a=i.stroke_color_picker,l=[s.r,s.g,s.b,255*s.a],p=[a.r,a.g,a.b,255*a.a],c={};let h;return l[3]>0&&(c.fillColor=l),p[3]>0&&(c.strokeColor=p),m=[],v(e.data,c),i.js_data_mutator&&(h=(0,u.Z)(i.js_data_mutator),m=h(m)),new n.Z({id:`geojson-layer-${i.slice_id}`,data:m,extruded:i.extruded,filled:i.filled,stroked:i.stroked,getFillColor:_,getLineColor:w,getLineWidth:i.line_width||1,pointRadiusScale:i.point_radius_scale,lineWidthUnits:i.line_width_unit,...(0,d.N)(i,r,x)})}const S={formData:s().object.isRequired,payload:s().object.isRequired,setControlValue:s().func.isRequired,viewport:s().object.isRequired,onAddFilter:s().func},k={onAddFilter(){}};class L extends r.Component{constructor(){super(...arguments),this.containerRef=r.createRef(),this.setTooltip=t=>{const{current:e}=this.containerRef;e&&e.setTooltip(t)}}render(){const{formData:t,payload:e,setControlValue:o,onAddFilter:r,height:i,width:s}=this.props;let{viewport:n}=this.props;if(t.autozoom){var a,c;const t=(null==e||null==(a=e.data)||null==(c=a.features)||null==c.reduce?void 0:c.reduce(((t,e)=>{const o=l()(e);return o?[...t,[o[0],o[1]],[o[2],o[3]]]:t}),[]))||[];t.length&&(n=(0,g.Z)(n,{width:s,height:i,points:t}))}const u=C(t,e,0,this.setTooltip);return(0,f.tZ)(p.F,{ref:this.containerRef,mapboxApiAccessToken:e.data.mapboxApiKey,viewport:n,layers:[u],mapStyle:t.mapbox_style,setControlValue:o,height:i,width:s})}}L.propTypes=S,L.defaultProps=k;const Z=L},52154:(t,e,o)=>{"use strict";o.d(e,{N:()=>s,Z:()=>a});var r=o(4065),i=o(21207);function s(t,e,o,r){const s=t;let n,a,l=o;return s.js_tooltip&&(l=(0,i.Z)(s.js_tooltip)),l&&(n=t=>{t.picked?e({content:l(t),x:t.x,y:t.y}):e(null)}),s.js_onclick_href?a=t=>{const e=(0,i.Z)(s.js_onclick_href)(t);window.open(e)}:s.table_filter&&void 0!==r&&(a=t=>r(t.object[s.line_column])),{onClick:a,onHover:n,pickable:Boolean(n)}}const n={p1:.01,p5:.05,p95:.95,p99:.99};function a(t,e){if(void 0===t&&(t="sum"),void 0===e&&(e=null),"count"===t)return t=>t.length;let o;return o=t in n?(o,i)=>{let s;return s=e?o.sort(((t,o)=>r.ascending(e(t),e(o)))):o.sort(r.ascending),r.quantile(s,n[t],i)}:r[t],e?t=>o(t.map((t=>e(t)))):t=>o(t)}},64106:(t,e,o)=>{"use strict";o.r(e),o.d(e,{hexToRGB:()=>i});var r=o(50667);function i(t,e){if(void 0===e&&(e=255),!t)return[0,0,0,e];const{r:o,g:i,b:s}=(0,r.B8)(t);return[o,i,s,e]}},21207:(t,e,o)=>{"use strict";o.d(e,{Z:()=>p});var r=o(55140),i=o.n(r),s=o(59050),n=o(4065),a=o(64106);const l={console,_:s.ZP,colors:a,d3array:n};function p(t,e,o){const r={},s=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;r[s]={};const n=`${s}=${t}`,a={...l,...e};Object.keys(a).forEach((t=>{r[t]=a[t]}));try{return i().runInNewContext(n,r,o),r[s]}catch(t){return()=>t}}},40461:(t,e,o)=>{"use strict";o.d(e,{Z:()=>l});var r=o(17013),i=o(4065);const s=[-90,90],n=[-180,180];function a(t,e,o){let[r,i]=t,[s,n]=e;return void 0===o&&(o=.25),r<i?[r,i]:[Math.max(s,r-o),Math.min(n,i+o)]}function l(t,e){let{points:o,width:l,height:p,minExtent:c,maxZoom:u,offset:d,padding:h=20}=e;const{bearing:g,pitch:f}=t,y=function(t){const e=a((0,i.extent)(t,(t=>t[1])),s),o=a((0,i.extent)(t,(t=>t[0])),n);return[[o[0],e[0]],[o[1],e[1]]]}(o);try{return{...(0,r.Xg)({bounds:y,width:l,height:p,minExtent:c,maxZoom:u,offset:d,padding:h}),bearing:g,pitch:f}}catch(t){console.error("Could not fit viewport",t)}return t}},92540:()=>{},75307:()=>{}}]);
//# sourceMappingURL=8f3ee2bd81ca66645cbb.chunk.js.map