(self.webpackChunk_openagenda_agenda_portal=self.webpackChunk_openagenda_agenda_portal||[]).push([[5751],{83894:function(t,e,n){var o={"./ar.js":[85126,5126],"./bg.js":[99845,9845],"./bn.js":[93046,3046],"./ca.js":[84514,4514],"./cs.js":[44622,4622],"./da.js":[99094,9094],"./de.js":[62934,2934],"./el.js":[22913,2913],"./en-AU.js":[42969,2969],"./en-GB.js":[68841,8841],"./en.js":[70179,8941],"./es.js":[77831,7831],"./eu.js":[17148,7148],"./fa.js":[71728,4951],"./fi.js":[95376,5376],"./fil.js":[95752,5752],"./fr.js":[87562,7562],"./gl.js":[85886,5886],"./gu.js":[92975,2975],"./hi.js":[49234,9234],"./hr.js":[90973,973],"./hu.js":[28592,8592],"./id.js":[18816,1728],"./it-IT.js":[87850,7850],"./it.js":[54886,4886],"./iw.js":[95342,5342],"./ja.js":[52306,2306],"./kn.js":[51292,1292],"./ko.js":[19983,9983],"./lt.js":[3777,3777],"./lv.js":[30245,245],"./ml.js":[36251,6251],"./mr.js":[73790,3790],"./nl.js":[77986,7986],"./no.js":[76500,6500],"./pl.js":[11715,1715],"./pt-BR.js":[12161,2161],"./pt-PT.js":[87251,7251],"./pt.js":[5059,5059],"./ro.js":[32150,2150],"./ru.js":[76047,823],"./sk.js":[51601,1601],"./sl.js":[99298,9298],"./sr.js":[77313,7313],"./sv.js":[7118,7118],"./ta.js":[47278,7278],"./te.js":[65255,5255],"./th.js":[34843,4843],"./tl.js":[40699,699],"./tr.js":[97922,7922],"./uk.js":[44357,4357],"./vi.js":[20711,711],"./zh-CN.js":[43933,3933],"./zh-TW.js":[31918,1918]};function a(t){if(!n.o(o,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=o[t],a=e[0];return n.e(e[1]).then((function(){return n(a)}))}a.keys=function(){return Object.keys(o)},a.id=83894,t.exports=a},71749:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return x}});var o=(0,n(63060).vU)({searchHere:{id:"ReactFilters.messages.map.searchHere",defaultMessage:"Search here"}}),a=n(28165),s=n(83112),r=n(52903);function l({searchHere:t}){const e=(0,s.Z)();return(0,r.tZ)("div",{css:a.iv`
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        z-index: 400;
      `,children:(0,r.tZ)("button",{type:"button",onClick:t,css:a.iv`
          outline: none;
          overflow: hidden;
          transition-duration: 0.2s;
          cursor: pointer;
          background: white;
          height: 24px;
          border-radius: 16px;
          padding: 0px 12px;
          box-shadow: rgba(0, 0, 0, 0.16) 0px 2px 8px 0px;
          border: 0px;

          &:hover {
            background-color: #f3f3f3;
          }

          &:active {
            background-color: #eaeaea;
          }
        `,children:e.formatMessage(o.searchHere)})})}var u=n(34848),i=n(2784),c=n(72779),d=n(93645),g=n(41698),h=n(46604),v=n(87319),f=n(85062),j=(n(89717),n(76860)),p=-1/(1.4/.2),m={bottomRight:{latitude:-90,longitude:180},topLeft:{latitude:90,longitude:-180}};function b(t,e=16){return new Promise(((n,o)=>{const a=()=>{try{const e=t.getBounds();if(!e)throw new Error("Bounds not available");n(e)}catch(t){setTimeout(a,e)}};setTimeout((()=>a()))}))}function w(t){return new f.LatLngBounds(new f.LatLng(t.bottomRight.latitude,t.bottomRight.longitude),new f.LatLng(t.topLeft.latitude,t.topLeft.longitude))}function S(t,e=1){const n=t.getSouthWest(),o=t.getNorthEast(),a=Math.abs(n.lat-o.lat),s=Math.abs(n.lng-o.lng),r=a*e,l=Math.min(s,360)*e,u=a>170?n.lat:n.lat-r,i=s>360?-180:n.lng-l,c=a>170?o.lat:o.lat+r,d=s>360?180:o.lng+l;return new f.LatLngBounds(new f.LatLng(u,i),new f.LatLng(c,d))}function k(t,e){return e>=1e3?`${t.formatNumber((e/1e3).toFixed(1))}k`:e.toString()}function L({latitude:t,longitude:e,eventCount:n}){const o=(0,s.Z)(),a=(0,d.Sx)(),l=(0,i.useMemo)((()=>[t,e]),[t,e]),u=(0,i.useMemo)((()=>new f.DivIcon({html:`<div style="pointer-events: none;"><span>${k(o,n)}</span></div>`,className:c("marker-cluster leaflet-interactive",{"marker-cluster-small":n<10,"marker-cluster-medium":n<100,"marker-cluster-large":n>=100}),iconSize:new f.Point(40,40)})),[n]);return(0,r.tZ)(g.J,{position:l,icon:u,eventHandlers:{click:()=>{a.setView(l,Math.min(a.getZoom()+1,a.getMaxZoom()))}}})}function C({onChange:t}){return(0,d.zV)({moveend(){t()}}),null}var x=i.forwardRef((({input:t,tileAttribution:e,tileUrl:o,loadGeoData:a,initialViewport:c,defaultViewport:d,className:g,searchHereControl:k=l},x)=>{const Z=(0,s.Z)(),B=(0,j.cI)(),{filtersOptions:{manualSubmit:E}}=(0,i.useContext)(u.k),W=(0,i.useRef)(),_=(0,i.useRef)(!1),[M]=(0,i.useState)((()=>t.value?function(t){const e=new f.LatLngBounds(new f.LatLng(t.northEast.lat,t.northEast.lng),new f.LatLng(t.southWest.lat,t.southWest.lng)),n=e.getSouthEast(),o=e.getNorthWest();return{bottomRight:{latitude:n.lat,longitude:n.lng},topLeft:{latitude:o.lat,longitude:o.lng}}}(t.value):c)),H=(0,i.useRef)(!!c),[y,N]=(0,i.useState)((()=>[])),[R,D]=(0,i.useState)(!1),[F]=(0,i.useState)((()=>w(M||d||m).pad(.2)));(0,i.useImperativeHandle)(x,(()=>({setData:N,onQueryChange:t=>{const e=W.current;function n(){b(e).then((t=>{const n=S(t,p),o=e.getBoundsZoom(t);a(n,o).then((t=>{N((null==t?void 0:t.reverse())??[]),D(!0)})).catch((t=>{console.log("Failed to load geo data",t)}))}))}H.current?n():(e.once("moveend",(()=>n())),_.current=!0,e.fitBounds(w(t||d||m).pad(.2))),H.current=!1}})));const O=(0,i.useCallback)((({target:t})=>{var e,o;W.current=t,e=t.gestureHandling,o=Z.locale,n(83894)(`./${o}.js`).then((t=>{const n=t.default||t,o=e._isMacUser()?n.scrollMac:n.scroll;e._map._container.setAttribute("data-gesture-handling-touch-content",n.touch),e._map._container.setAttribute("data-gesture-handling-scroll-content",o),e._touchWarning=n.touch,e._scrollWarning=o})).catch((t=>{console.log(`Cannot load gestureHandling locale "${o}"`,t)})),t.attributionControl.setPrefix('<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">Leaflet</a>'),c&&b(t).then((e=>{const n=S(e,p),o=t.getBoundsZoom(e);a(n,o).then((t=>{N((null==t?void 0:t.reverse())??[]),D(!0)})).catch((t=>{console.log("Failed to load geo data",t)})).finally((()=>{H.current=!1}))}))}),[F,a]),T=(0,i.useCallback)((e=>{e.preventDefault();const n=W.current;if(!n)return;H.current=!0;const o=S(n.getBounds(),p),a=o.getNorthEast().wrap(),s=o.getSouthWest().wrap();t.onChange({northEast:{lat:String(a.lat),lng:String(a.lng)},southWest:{lat:String(s.lat),lng:String(s.lng)}}),E&&B.submit()}),[t,W]),[U,z]=(0,i.useState)(!1),A=(0,i.useCallback)((()=>{const t=W.current,e=t.getBounds(),n=S(e,p),o=t.getBoundsZoom(e);if(z(n),_.current)return void(_.current=!1);const{current:s}=x;a(n,o).then((t=>s.setData((null==t?void 0:t.reverse())??[]))).catch((t=>{console.log("Failed to geo data",t)}))}),[a,x]),I=(0,i.useMemo)((()=>{return!U||(e=t.value,n={northEast:U.getNorthEast().wrap(),southWest:U.getSouthWest().wrap()},String(null==(o=null==e?void 0:e.northEast)?void 0:o.lat)===String(null==(a=null==n?void 0:n.northEast)?void 0:a.lat)&&String(null==(s=null==e?void 0:e.northEast)?void 0:s.lng)===String(null==(r=null==n?void 0:n.northEast)?void 0:r.lng)&&String(null==(l=null==e?void 0:e.southWest)?void 0:l.lat)===String(null==(u=null==n?void 0:n.southWest)?void 0:u.lat)&&String(null==(i=null==e?void 0:e.southWest)?void 0:i.lng)===String(null==(c=null==n?void 0:n.southWest)?void 0:c.lng));var e,n,o,a,s,r,l,u,i,c}),[t.value,U]),P=(0,i.useMemo)((()=>({locale:Z.locale})),[Z.locale]);return(0,r.BX)(r.HY,{children:[(0,r.BX)(h.h,{className:g,bounds:F,whenReady:O,gestureHandling:!0,gestureHandlingOptions:P,doubleClickZoom:!0,worldCopyJump:!0,children:[(0,r.tZ)(v.I,{attribution:e,url:o}),R?y.map((t=>(0,r.tZ)(L,{eventCount:t.eventCount,latitude:t.latitude,longitude:t.longitude},t.key))):null,(0,r.tZ)(C,{onChange:A})]}),I?null:(0,r.tZ)(k,{searchHere:T})]})}))}}]);