(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3574],{83505:(t,e,o)=>{"use strict";o.d(e,{Z:()=>n});var r=o(96540);function n(t,e){const o=(0,r.useRef)(e);return(0,r.useEffect)((()=>{o.current=t}),[t]),o.current}},70957:(t,e,o)=>{"use strict";o.d(e,{S:()=>v});var r=o(2404),n=o.n(r),l=o(96540),i=o(88813),s=o(82487),a=o(83505),c=o(96453),u=o(58642),p=o(2445);const d=c.I4.div`
  ${({theme:t,top:e,left:o})=>`\n    position: absolute;\n    top: ${e}px;\n    left: ${o}px;\n    padding: ${2*t.gridUnit}px;\n    margin: ${2*t.gridUnit}px;\n    background: ${t.colors.grayscale.dark2};\n    color: ${t.colors.grayscale.light5};\n    maxWidth: 300px;\n    fontSize: ${t.typography.sizes.s}px;\n    zIndex: 9;\n    pointerEvents: none;\n  `}
`;function f(t){const{tooltip:e}=t;if(null==e)return null;const{x:o,y:r,content:n}=e,l="string"==typeof n?(0,u.nn)(n):n;return(0,p.Y)(d,{top:r,left:o,children:l})}const h=(0,l.memo)((0,l.forwardRef)(((t,e)=>{const[o,r]=(0,l.useState)(null),[c,u]=(0,l.useState)(null),[d,h]=(0,l.useState)(t.viewport),v=(0,a.Z)(t.viewport);(0,l.useImperativeHandle)(e,(()=>({setTooltip:r})),[]);const g=(0,l.useCallback)((()=>{if(c&&Date.now()-c>250){const e=t.setControlValue;e&&e("viewport",d),u(null)}}),[c,t.setControlValue,d]);(0,l.useEffect)((()=>{const t=setInterval(g,250);return clearInterval(t)}),[g]),(0,l.useEffect)((()=>{n()(t.viewport,v)||h(t.viewport)}),[v,t.viewport]);const m=(0,l.useCallback)((({viewState:t})=>{h(t),u(Date.now())}),[]),k=(0,l.useCallback)((()=>t.layers.some((t=>"function"==typeof t))?t.layers.map((t=>"function"==typeof t?t():t)):t.layers),[t.layers]),{children:w=null,height:x,width:y}=t;return(0,p.FD)(p.FK,{children:[(0,p.FD)("div",{style:{position:"relative",width:y,height:x},children:[(0,p.Y)(s.A,{controller:!0,width:y,height:x,layers:k(),viewState:d,onViewStateChange:m,children:(0,p.Y)(i.b,{preserveDrawingBuffer:!0,mapStyle:t.mapStyle||"light",mapboxApiAccessToken:t.mapboxApiAccessToken})}),w]}),(0,p.Y)(f,{tooltip:o})]})}))),v=(0,c.I4)(h)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},32548:(t,e,o)=>{"use strict";o.d(e,{A:()=>n});var r=o(2445);const n=({label:t,value:e})=>(0,r.FD)("div",{children:[t,(0,r.Y)("strong",{children:e})]})},17861:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>b,getLayer:()=>y});var r=o(96540),n=o(63947),l=o(25879),i=o.n(l),s=o(70957),a=o(49443),c=o(25564),u=o(41857),p=o(32548),d=o(95490),f=o(2445);const h={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},v=(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 g=[];const m=(t,e,o)=>{if(null!=t&&t.features&&t.features.forEach((r=>{m(r,e,t.extraProps||o)})),null!=t&&t.geometry){const r={...t,properties:v(t.properties,e)};r.extraProps||(r.extraProps=o),g.push(r)}};function k(t){var e;return(null==(e=t.object)?void 0:e.extraProps)&&(0,f.Y)("div",{className:"deckgl-tooltip",children:Object.keys(t.object.extraProps).map(((e,o)=>{var r;return(0,f.Y)(p.A,{label:`${e}: `,value:`${null==(r=t.object.extraProps)?void 0:r[e]}`},`prop-${o}`)}))})}const w=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 y(t,e,o,r){const l=t,i=l.fill_color_picker,s=l.stroke_color_picker,a=[i.r,i.g,i.b,255*i.a],p=[s.r,s.g,s.b,255*s.a],d={};a[3]>0&&(d.fillColor=a),p[3]>0&&(d.strokeColor=p),g=[],m(e.data,d);let f=g;return l.js_data_mutator&&(f=(0,c.A)(l.js_data_mutator)(g)),new n.A({id:`geojson-layer-${l.slice_id}`,data:f,extruded:l.extruded,filled:l.filled,stroked:l.stroked,getFillColor:w,getLineColor:x,getLineWidth:l.line_width||1,pointRadiusScale:l.point_radius_scale,lineWidthUnits:l.line_width_unit,...(0,u.T)(l,r,k)})}const C=t=>{var e;const o=(0,r.useRef)(),n=(0,r.useCallback)((t=>{const{current:e}=o;e&&e.setTooltip(t)}),[]),{formData:l,payload:a,setControlValue:c,onAddFilter:u,height:p,width:h}=t,v=(0,r.useMemo)((()=>{if(l.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=i()(e);return o?[...t,[o[0],o[1]],[o[2],o[3]]]:t}),[]))||[];if(r.length)return(0,d.A)(t.viewport,{width:h,height:p,points:r})}return t.viewport}),[l.autozoom,p,null==a||null==(e=a.data)?void 0:e.features,t.viewport,h]),g=y(l,a,0,n);return(0,f.Y)(s.S,{ref:o,mapboxApiAccessToken:a.data.mapboxApiKey,viewport:v,layers:[g],mapStyle:l.mapbox_style,setControlValue:c,height:p,width:h})},b=(0,r.memo)(C)},41857:(t,e,o)=>{"use strict";o.d(e,{T:()=>l,g:()=>a});var r=o(12619),n=o(25564);function l(t,e,o,r){const l=t;let i,s,a=o;return l.js_tooltip&&(a=(0,n.A)(l.js_tooltip)),a&&(i=t=>(t.picked?e({content:a(t),x:t.x,y:t.y}):e(null),!0)),l.js_onclick_href?s=t=>{const e=(0,n.A)(l.js_onclick_href)(t);return window.open(e),!0}:l.table_filter&&void 0!==r&&(s=t=>(r(t.object[l.line_column]),!0)),{onClick:s,onHover:i,pickable:Boolean(i)}}const i={p1:.01,p5:.05,p95:.95,p99:.99},s={sum:r.sum,min:r.min,max:r.max,mean:r.mean,median:r.median,variance:r.variance,deviation:r.deviation};function a(t="sum",e=null){if("count"===t)return t=>t.length;let o;if(t in i)o=(o,n)=>{let l;return l=e?o.sort(((t,o)=>(0,r.ascending)(e(t),e(o)))):o.sort(r.ascending),(0,r.quantile)(l,i[t],n)};else{if(!(t in s))throw new Error(`Unsupported aggregation type: ${t}`);o=s[t]}return e?t=>o(t.map((t=>e(t)))):t=>o(t)}},49443:(t,e,o)=>{"use strict";o.r(e),o.d(e,{hexToRGB:()=>n});var r=o(2117);function n(t,e=255){if(!t)return[0,0,0,e];const{r:o,g:n,b:l}=(0,r.Qh)(t);return[o,n,l,e]}},95490:(t,e,o)=>{"use strict";o.d(e,{A:()=>a});var r=o(55016),n=o(12619);const l=[-90,90],i=[-180,180];function s([t,e],[o,r],n=.25){return t<e?[t,e]:[Math.max(o,t-n),Math.min(r,e+n)]}function a(t,{points:e,width:o,height:a,minExtent:c,maxZoom:u,offset:p,padding:d=20}){const{bearing:f,pitch:h}=t,v=function(t){const e=s((0,n.extent)(t,(t=>t[1])),l),o=s((0,n.extent)(t,(t=>t[0])),i);return[[o[0],e[0]],[o[1],e[1]]]}(e);try{return{...(0,r.Fe)({bounds:v,width:o,height:a,minExtent:c,maxZoom:u,offset:p,padding:d}),bearing:f,pitch:h}}catch(t){console.error("Could not fit viewport",t)}return t}},25564:(t,e,o)=>{"use strict";o.d(e,{A:()=>c});var r=o(68961),n=o.n(r),l=o(4523),i=o(12619),s=o(49443);const a={console,_:l.Ay,colors:s,d3array:i};function c(t,e,o){const r={},l=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;r[l]={};const i=`${l}=${t}`,s={...a,...e};Object.keys(s).forEach((t=>{r[t]=s[t]}));try{return n().runInNewContext(i,r,o),r[l]}catch(t){return()=>t}}},42634:()=>{}}]);