"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3403],{36750:(t,e,o)=>{o.d(e,{Z:()=>a});var r=o(4942),n=o(5259),i=o(11482),s=o(77552),l=o(33230);class a extends n.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo(t){let{info:e}=t;const{object:o}=e;return o&&o.__source&&o.__source.parent&&o.__source.parent.id===this.id?(e.object=o.__source.object,e.index=o.__source.index,e):e}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}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={index:-1,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){var e;void 0===t&&(t={});const{opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:u,highlightColor:c,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:g,positionFormat:h,modelMatrix:f,extensions:y,fetch:b,operation:v,_subLayerProps:m}=this.props,x={id:"",updateTriggers:{},opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:u,highlightColor:c,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:g,positionFormat:h,modelMatrix:f,extensions:y,fetch:b,operation:v},_=m&&t.id&&m[t.id],k=_&&_.updateTriggers,w=t.id||"sublayer";if(_){const e=this.props[l.Wb],o=t.type?t.type._propTypes:{};for(const t in _){const r=o[t]||e[t];r&&"accessor"===r.type&&(_[t]=this.getSubLayerAccessor(_[t]))}}Object.assign(x,t,_),x.id="".concat(this.props.id,"-").concat(w),x.updateTriggers={all:null===(e=this.props.updateTriggers)||void 0===e?void 0:e.all,...t.updateTriggers,...k};for(const t of y){const e=t.getSubLayerProps.call(this,t);e&&Object.assign(x,e,{updateTriggers:Object.assign(x.updateTriggers,e.updateTriggers)})}return x}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let o=this.internalState.subLayers;const r=!o||this.needsUpdate();if(r){const t=this.renderLayers();o=(0,s.x)(t,Boolean),this.internalState.subLayers=o}(0,i.Z)("compositeLayer.renderLayers",this,r,o);for(const t of o)t.parent=this}}(0,r.Z)(a,"layerName","CompositeLayer")},34634:(t,e,o)=>{o.d(e,{F:()=>f});var r=o(18446),n=o.n(r),i=o(67294),s=o(90530),l=o(10025),a=o(85716),u=o(51995),c=o(32103),p=o(11965);const d=u.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:n}=e,i="string"==typeof n?(0,c.Ul)(n):n;return(0,p.tZ)(d,{top:r,left:o},i)}const h=(0,i.memo)((0,i.forwardRef)(((t,e)=>{const[o,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(null),[d,h]=(0,i.useState)(t.viewport),f=(0,a.D)(t.viewport);(0,i.useImperativeHandle)(e,(()=>({setTooltip:r})),[]);const y=(0,i.useCallback)((()=>{if(u&&Date.now()-u>250){const e=t.setControlValue;e&&e("viewport",d),c(null)}}),[u,t.setControlValue,d]);(0,i.useEffect)((()=>{const t=setInterval(y,250);return clearInterval(t)}),[y]),(0,i.useEffect)((()=>{n()(t.viewport,f)||h(t.viewport)}),[f,t.viewport]);const b=(0,i.useCallback)((t=>{let{viewState:e}=t;h(e),c(Date.now())}),[]),v=(0,i.useCallback)((()=>t.layers.some((t=>"function"==typeof t))?t.layers.map((t=>"function"==typeof t?t():t)):t.layers),[t.layers]),{children:m=null,height:x,width:_}=t;return(0,p.tZ)(i.Fragment,null,(0,p.tZ)("div",{style:{position:"relative",width:_,height:x}},(0,p.tZ)(l.Z,{controller:!0,width:_,height:x,layers:v(),viewState:d,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:b},(0,p.tZ)(s.Z3,{preserveDrawingBuffer:!0,mapStyle:t.mapStyle||"light",mapboxApiAccessToken:t.mapboxApiAccessToken})),m),(0,p.tZ)(g,{tooltip:o}))}))),f=(0,u.iK)(h)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},51805:(t,e,o)=>{o.d(e,{Z:()=>n}),o(67294);var r=o(11965);const n=t=>{let{label:e,value:o}=t;return(0,r.tZ)("div",null,e,(0,r.tZ)("strong",null,o))}},1262:(t,e,o)=>{o.r(e),o.d(e,{default:()=>w,getLayer:()=>_});var r=o(67294),n=o(69588),i=o(29319),s=o.n(i),l=o(34634),a=o(89503),u=o(63241),c=o(58371),p=o(51805),d=o(40461),g=o(11965);const h={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},f=(t,e)=>{const o={};return Object.keys(t).forEach((e=>{e in h?o[h[e]]=t[e]:o[e]=t[e]})),"string"==typeof t.fillColor&&(o.fillColor=(0,a.hexToRGB)(t.fillColor)),"string"==typeof t.strokeColor&&(o.strokeColor=(0,a.hexToRGB)(t.strokeColor)),{...o,...e}};let y;const b=(t,e,o)=>{if(null!=t&&t.features&&t.features.forEach((r=>{b(r,e,t.extraProps||o)})),null!=t&&t.geometry){const r={...t,properties:f(t.properties,e)};r.extraProps||(r.extraProps=o),y.push(r)}};function v(t){return t.object.extraProps&&(0,g.tZ)("div",{className:"deckgl-tooltip"},Object.keys(t.object.extraProps).map(((e,o)=>(0,g.tZ)(p.Z,{key:`prop-${o}`,label:`${e}: `,value:`${t.object.extraProps[e]}`}))))}const m=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.fillColor},x=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.strokeColor};function _(t,e,o,r){const i=t,s=i.fill_color_picker,l=i.stroke_color_picker,a=[s.r,s.g,s.b,255*s.a],p=[l.r,l.g,l.b,255*l.a],d={};let g;return a[3]>0&&(d.fillColor=a),p[3]>0&&(d.strokeColor=p),y=[],b(e.data,d),i.js_data_mutator&&(g=(0,u.Z)(i.js_data_mutator),y=g(y)),new n.Z({id:`geojson-layer-${i.slice_id}`,data:y,extruded:i.extruded,filled:i.filled,stroked:i.stroked,getFillColor:m,getLineColor:x,getLineWidth:i.line_width||1,pointRadiusScale:i.point_radius_scale,lineWidthUnits:i.line_width_unit,...(0,c.N)(i,r,v)})}const k=t=>{var e;const o=(0,r.useRef)(),n=(0,r.useCallback)((t=>{const{current:e}=o;e&&e.setTooltip(t)}),[]),{formData:i,payload:a,setControlValue:u,onAddFilter:c,height:p,width:h}=t,f=(0,r.useMemo)((()=>{if(i.autozoom){var e,o;const r=(null==a||null==(e=a.data)||null==(o=e.features)||null==o.reduce?void 0:o.reduce(((t,e)=>{const o=s()(e);return o?[...t,[o[0],o[1]],[o[2],o[3]]]:t}),[]))||[];if(r.length)return(0,d.Z)(t.viewport,{width:h,height:p,points:r})}return t.viewport}),[i.autozoom,p,null==a||null==(e=a.data)?void 0:e.features,t.viewport,h]),y=_(i,a,0,n);return(0,g.tZ)(l.F,{ref:o,mapboxApiAccessToken:a.data.mapboxApiKey,viewport:f,layers:[y],mapStyle:i.mapbox_style,setControlValue:u,height:p,width:h})},w=(0,r.memo)(k)},58371:(t,e,o)=>{o.d(e,{N:()=>i,Z:()=>l});var r=o(4065),n=o(63241);function i(t,e,o,r){const i=t;let s,l,a=o;return i.js_tooltip&&(a=(0,n.Z)(i.js_tooltip)),a&&(s=t=>(t.picked?e({content:a(t),x:t.x,y:t.y}):e(null),!0)),i.js_onclick_href?l=t=>{const e=(0,n.Z)(i.js_onclick_href)(t);return window.open(e),!0}:i.table_filter&&void 0!==r&&(l=t=>(r(t.object[i.line_column]),!0)),{onClick:l,onHover:s,pickable:Boolean(s)}}const s={p1:.01,p5:.05,p95:.95,p99:.99};function l(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 s?(o,n)=>{let i;return i=e?o.sort(((t,o)=>r.ascending(e(t),e(o)))):o.sort(r.ascending),r.quantile(i,s[t],n)}:r[t],e?t=>o(t.map((t=>e(t)))):t=>o(t)}},89503:(t,e,o)=>{o.r(e),o.d(e,{hexToRGB:()=>n});var r=o(50667);function n(t,e){if(void 0===e&&(e=255),!t)return[0,0,0,e];const{r:o,g:n,b:i}=(0,r.B8)(t);return[o,n,i,e]}},40461:(t,e,o)=>{o.d(e,{Z:()=>a});var r=o(17013),n=o(4065);const i=[-90,90],s=[-180,180];function l(t,e,o){let[r,n]=t,[i,s]=e;return void 0===o&&(o=.25),r<n?[r,n]:[Math.max(i,r-o),Math.min(s,n+o)]}function a(t,e){let{points:o,width:a,height:u,minExtent:c,maxZoom:p,offset:d,padding:g=20}=e;const{bearing:h,pitch:f}=t,y=function(t){const e=l((0,n.extent)(t,(t=>t[1])),i),o=l((0,n.extent)(t,(t=>t[0])),s);return[[o[0],e[0]],[o[1],e[1]]]}(o);try{return{...(0,r.Xg)({bounds:y,width:a,height:u,minExtent:c,maxZoom:p,offset:d,padding:g}),bearing:h,pitch:f}}catch(t){console.error("Could not fit viewport",t)}return t}},63241:(t,e,o)=>{o.d(e,{Z:()=>u});var r=o(55140),n=o.n(r),i=o(59050),s=o(4065),l=o(89503);const a={console,_:i.ZP,colors:l,d3array:s};function u(t,e,o){const r={},i=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;r[i]={};const s=`${i}=${t}`,l={...a,...e};Object.keys(l).forEach((t=>{r[t]=l[t]}));try{return n().runInNewContext(s,r,o),r[i]}catch(t){return()=>t}}}}]);
//# sourceMappingURL=c969572ba3fabb7eab5a.chunk.js.map