@nextgis/ngw-leaflet 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ngw-leaflet.esm-browser.js +17 -7
- package/lib/ngw-leaflet.esm-browser.js.map +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js +1 -1
- package/lib/ngw-leaflet.esm-browser.prod.js.map +1 -1
- package/lib/ngw-leaflet.esm-bundler.js +1 -1
- package/lib/ngw-leaflet.global.js +17 -7
- package/lib/ngw-leaflet.global.js.map +1 -1
- package/lib/ngw-leaflet.global.prod.js +1 -1
- package/lib/ngw-leaflet.global.prod.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var NgwLeaflet=function(){"use strict";function t(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}t('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');function e(){}function i(){i.init.call(this)}function o(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function n(t,i,n,r){var s,a,l,h;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",i,n.listener?n.listener:n),a=t._events),l=a[i]):(a=t._events=new e,t._eventsCount=0),l){if("function"==typeof l?l=a[i]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(s=o(t))&&s>0&&l.length>s){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+i+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=i,c.count=l.length,h=c,"function"==typeof console.warn?console.warn(h):console.log(h)}}else l=a[i]=n,++t._eventsCount;return t}function r(t,e,i){var o=!1;function n(){t.removeListener(e,n),o||(o=!0,i.apply(t,arguments))}return n.listener=i,n}function s(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function a(t,e){for(var i=new Array(e);e--;)i[e]=t[e];return i}t(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}"),e.prototype=Object.create(null),i.EventEmitter=i,i.usingDomains=!1,i.prototype.domain=void 0,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.init=function(){this.domain=null,i.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new e,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(t){var e,i,o,n,r,s,l,h="error"===t;if(s=this._events)h=h&&null==s.error;else if(!h)return!1;if(l=this.domain,h){if(e=arguments[1],!l){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=l,e.domainThrown=!1,l.emit("error",e),!1}if(!(i=s[t]))return!1;var u="function"==typeof i;switch(o=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var o=t.length,n=a(t,o),r=0;r<o;++r)n[r].call(i)}(i,u,this);break;case 2:!function(t,e,i,o){if(e)t.call(i,o);else for(var n=t.length,r=a(t,n),s=0;s<n;++s)r[s].call(i,o)}(i,u,this,arguments[1]);break;case 3:!function(t,e,i,o,n){if(e)t.call(i,o,n);else for(var r=t.length,s=a(t,r),l=0;l<r;++l)s[l].call(i,o,n)}(i,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,o,n,r){if(e)t.call(i,o,n,r);else for(var s=t.length,l=a(t,s),h=0;h<s;++h)l[h].call(i,o,n,r)}(i,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];!function(t,e,i,o){if(e)t.apply(i,o);else for(var n=t.length,r=a(t,n),s=0;s<n;++s)r[s].apply(i,o)}(i,u,this,n)}return!0},i.prototype.on=i.prototype.addListener=function(t,e){return n(this,t,e,!1)},i.prototype.prependListener=function(t,e){return n(this,t,e,!0)},i.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,r(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,r(this,t,e)),this},i.prototype.removeListener=function(t,i){var o,n,r,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(o=n[t]))return this;if(o===i||o.listener&&o.listener===i)0==--this._eventsCount?this._events=new e:(delete n[t],n.removeListener&&this.emit("removeListener",t,o.listener||i));else if("function"!=typeof o){for(r=-1,s=o.length;s-- >0;)if(o[s]===i||o[s].listener&&o[s].listener===i){a=o[s].listener,r=s;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new e,this;delete n[t]}else!function(t,e){for(var i=e,o=i+1,n=t.length;o<n;i+=1,o+=1)t[i]=t[o];t.pop()}(o,r);n.removeListener&&this.emit("removeListener",t,a||i)}return this},i.prototype.off=function(t,e){return this.removeListener(t,e)},i.prototype.removeAllListeners=function(t){var i,o;if(!(o=this._events))return this;if(!o.removeListener)return 0===arguments.length?(this._events=new e,this._eventsCount=0):o[t]&&(0==--this._eventsCount?this._events=new e:delete o[t]),this;if(0===arguments.length){for(var n,r=Object.keys(o),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new e,this._eventsCount=0,this}if("function"==typeof(i=o[t]))this.removeListener(t,i);else if(i)do{this.removeListener(t,i[i.length-1])}while(i[0]);return this},i.prototype.listeners=function(t){var e,i=this._events;return i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(e):[]},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):s.call(t,e)},i.prototype.listenerCount=s,i.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var l={exports:{}};(function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var o,n,r,s;return s=function(){o=!1,n&&(r.apply(i,n),n=!1)},r=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(s,e),o=!0)},r}function l(t,e,i){var o=e[1],n=e[0],r=o-n;return t===o&&i?t:((t-n)%r+r)%r+n}function h(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function g(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,O=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function M(t){t&&O.call(window,t)}var k={extend:i,create:o,bind:n,lastId:r,stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:c,trim:u,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:y,indexOf:g,emptyImageUrl:v,requestFn:P,cancelFn:O,requestAnimFrame:C,cancelAnimFrame:M};function A(){}function E(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,r=o(n);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(E(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(o(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},A.include=function(t){return i(this.prototype,t),this},A.mergeOptions=function(t){return i(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var T={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},r=o,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(n)},_off:function(t,e,i){var o,n,r;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,r=o.length;n<r;n++){var s=o[n];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,r=o.length;n<r;n++)o[n].fn=h;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var r=n((function(){this.off(t,e,i).off(t,r,i)}),this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};T.addEventListener=T.on,T.removeEventListener=T.clearAllEventListeners=T.off,T.addOneTimeEventListener=T.once,T.fireEvent=T.fire,T.hasEventListeners=T.listens;var I=A.extend(T);function S(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var z=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function j(t,e,i){return t instanceof S?t:y(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function Z(t,e){return!t||t instanceof B?t:new B(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function R(t,e){return t instanceof N?t:new N(t,e)}function D(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof D?t:y(t)&&"object"!=typeof t[0]?3===t.length?new D(t[0],t[1],t[2]):2===t.length?new D(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new D(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new D(t,e,i)}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(t){return this.clone()._add(j(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(j(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new S(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new S(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(t){var e=(t=j(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=j(t)).x===this.x&&t.y===this.y},contains:function(t){return t=j(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},B.prototype={extend:function(t){return t=j(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new S((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new S(this.min.x,this.max.y)},getTopRight:function(){return new S(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof S?j(t):Z(t))instanceof B?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof D)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(F(t)||R(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new D(e.lat,e.lng),this._northEast=new D(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new N(new D(e.lat-o,e.lng-n),new D(i.lat+o,i.lng+n))},getCenter:function(){return new D((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new D(this.getNorth(),this.getWest())},getSouthEast:function(){return new D(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof D||"lat"in t?F(t):R(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=R(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},D.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return R([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new D(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new B(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new D(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new N(new D(r.lat-o,r.lng-n),new D(s.lat-o,s.lng-n))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(o)*Math.cos(n)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),q=6378137,V={R:q,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new S(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new D((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=q*Math.PI,new B([-U,-U],[U,U]))};function G(t,e,i,o){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new S((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,o,n,r,s,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,r=(s=t[i]).length;o<r;o++)l+=(o?"L":"M")+(a=s[o]).x+" "+a.y;l+=e?Et?"z":"x":""}return l||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=It("webkit"),nt=It("android"),rt=It("android 2")||It("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&It("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ht=!it&&It("chrome"),ct=It("gecko")&&!ot&&!lt&&!tt,ut=!ht&&It("safari"),pt=It("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,yt="MozPerspective"in $,gt=!window.L_DISABLE_3D&&(mt||_t||yt)&&!dt&&!pt,vt="undefined"!=typeof orientation||It("mobile"),bt=vt&&ot,wt=vt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=vt&<,Ct=vt&&ct,Mt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,kt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),At=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!Q("svg").createSVGRect),Tt=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var St={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:rt,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:yt,any3d:gt,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Ot,mobileGecko:Ct,retina:Mt,passiveEvents:kt,canvas:At,svg:Et,vml:Tt},zt=xt?"MSPointerDown":"pointerdown",jt=xt?"MSPointerMove":"pointermove",Bt=xt?"MSPointerUp":"pointerup",Zt=xt?"MSPointerCancel":"pointercancel",Nt={},Rt=!1;function Dt(t,e,i,o){return"touchstart"===e?Ut(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(jt,o,!1):"touchend"===e&&(t.removeEventListener(Bt,o,!1),t.removeEventListener(Zt,o,!1)),this}function Ut(t,e,i){var o=n((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),Vt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Rt||(document.addEventListener(zt,Wt,!0),document.addEventListener(jt,Ht,!0),document.addEventListener(Bt,qt,!0),document.addEventListener(Zt,qt,!0),Rt=!0)}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function qt(t){delete Nt[t.pointerId]}function Vt(t,e){for(var i in t.touches=[],Nt)t.touches.push(Nt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(jt,o,!1)}function Jt(t,e,i){var o=function(t){Vt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Bt,o,!1),t.addEventListener(Zt,o,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var o,n,r=!1,s=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,r=i>0&&i<=s,o=e}function l(t){if(r&&!n.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in n)a[s]=(i=n[s])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=l,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!kt&&{passive:!1}),t.addEventListener(Yt,l,!!kt&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!kt&&{passive:!1}),t.removeEventListener(Yt,i,!!kt&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function ce(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var r=ve(t);ge(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):ge(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function ge(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var o=e||new S(0,0);t.style[re]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,gt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new S(0,0)}if("onselectstart"in document)te=function(){ze(window,"selectstart",He)},ee=function(){Be(window,"selectstart",He)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function Me(){ze(window,"dragstart",He)}function ke(){Be(window,"dragstart",He)}function Ae(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ee(),oe=t,ne=t.style.outline,t.style.outline="none",ze(window,"keydown",Ee))}function Ee(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Be(window,"keydown",Ee))}function Te(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Se={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:he,create:ce,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ye,setClass:ge,getClass:ve,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Oe,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Me,enableImageDrag:ke,preventOutline:Ae,restoreOutline:Ee,getSizedParentNode:Te,getScale:Ie};function ze(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)Re(t,e[r],i,o);return this}var je="_leaflet_events";function Be(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,o);else{for(var a in t[je])De(t,a,t[je][a]);delete t[je]}return this}function Ze(){if(Lt)return!(it||ut)}var Ne={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Re(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):"");if(t[je]&&t[je][n])return this;var r=function(e){return i.call(o||t,e||window.event)},a=r;Lt&&0===e.indexOf("touch")?Dt(t,e,r,n):Pt&&"dblclick"===e&&!Ze()?Xt(t,r,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ne[e]||e,r,!!kt&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Ne[e],r=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[je]=t[je]||{},t[je][n]=r}function De(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):""),r=t[je]&&t[je][n];if(!r)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,n):Pt&&"dblclick"===e&&!Ze()?$t(t,n):"removeEventListener"in t?t.removeEventListener(Ne[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[je][n]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return Re(t,"wheel",Fe),this}function We(t){return ze(t,"mousedown touchstart dblclick",Fe),Re(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function qe(t){return He(t),Fe(t),this}function Ve(t,e){if(!e)return new S(t.clientX,t.clientY);var i=Ie(e),o=i.boundingClientRect;return new S((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var $e={on:ze,off:Be,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:qe,getMousePosition:Ve,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:ze,removeListener:Be},ti=I.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){M(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=I.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&>&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(gt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(gt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),r=(t instanceof S?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),s=this.containerPointToLatLng(n.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():R(t);var i=j(e.paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var r=o.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(s.add(a).divideBy(2).add(r),n),zoom:n}},fitBounds:function(t,e){if(!(t=R(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=j(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!gt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),r=this.getSize(),s=this._zoom;t=F(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=n.distanceTo(o)||1,c=1.42,u=c*c;function p(t){var e=(l*l-a*a+(t?-1:1)*u*u*h*h)/(2*(t?l:a)*u*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function y(t){return a*(f(_)/f(_+c*t))}function g(t){return a*(f(_)*m(_+c*t)-d(_))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/c,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,r=v(i)*w;i<=1?(this._flyToFrame=C(L,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(g(r)/h)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=R(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,R(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=j((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),r=this.project(n),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=Z([a.min.add(i),a.max.subtract(o)]);if(!h.contains(s)){this._enforcingBounds=!0;var c=r.subtract(s),u=j(s.x+c.x,s.y+c.y);(s.x<h.min.x||s.x>h.max.x)&&(u.x=r.x-c.x,c.x>0?u.x+=l.x-i.x:u.x-=l.x-o.x),(s.y<h.min.y||s.y>h.max.y)&&(u.y=r.y-c.y,c.y>0?u.y+=l.y-i.y:u.y-=l.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=e.divideBy(2).round(),s=o.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=R(t),i=j(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=Z(this.project(a,o),this.project(s,o)).getSize(),c=gt?this.options.zoomSnap:1,u=l.x/h.x,p=l.y/h.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(r,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new S(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(j(t),e)},layerPointToLatLng:function(t){var e=j(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return j(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return j(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(j(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Ve(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&>,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(Mt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new S(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new S(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Be:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!Xe(r,t))break;if(o.push(i),n)break}if(r===this._container)break;r=r.parentNode}return o.length||a||n||!Xe(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Ae(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var r=o[0];"contextmenu"===e&&r.listens(e,!0)&&He(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<o.length;l++)if(o[l].fire(e,s,!0),s.originalEvent._stopped||!1===o[l].options.bubblingMouseEvents&&-1!==g(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new S(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return Z([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),r=new B(o.subtract(n),o.add(n)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(o.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new B(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),r=o.max.subtract(t.max);return new S(this._rebound(n.x,-r.x),this._rebound(n.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=gt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ni=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=ce("div",e+"control-container",this._container);function o(o,n){t[o+n]=ce("div",e+o+" "+e+n,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var o=this._section=ce("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||ze(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=ce("a",t+"-toggle",e);n.href="#",n.title="Layers",Pt?(ze(n,"click",qe),ze(n,"click",this.expand,this)):ze(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=ce("div",t+"-base",o),this._separator=ce("div",t+"-separator",o),this._overlaysList=ce("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(n((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&n>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+s(this),o),this._layerControlInputs.push(e),e.layerId=s(t.layer),ze(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])&&this._map.removeLayer(n[r]);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])||this._map.addLayer(o[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ri(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=ce("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var r=ce("a",i,o);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),We(r),ze(r,"click",qe),ze(r,"click",n,this),ze(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var li=function(t){return new ai(t)},hi=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=ce("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=ce("div",e,i)),t.imperial&&(this._iScale=ce("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,n=3.2808399*t;n>5280?(i=this._getRoundNum(e=n/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),ci=function(t){return new hi(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=ai,oi.Scale=hi,oi.Attribution=ui,ni.layers=si,ni.zoom=li,ni.scale=ci,ni.attribution=pi;var di=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:T},_i=Pt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},gi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},vi=I.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(),Be(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(vi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(vi._dragging=this,this._preventOutline&&Ae(this._element),Me(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Te(this._element);this._startPoint=new S(e.clientX,e.clientY),this._parentScale=Ie(i),ze(document,gi[t.type],this._onMove,this),ze(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new S(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Oe(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,M(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),gi)Be(document,gi[t],this._onMove,this),Be(document,yi[t],this._onUp,this);ke(),ee(),this._moved&&this._moving&&(M(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,vi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Oi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ei(t,e,i,!0))}function xi(t,e,i){return Ei(t,e,i)}function Li(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Pi(t,o,e,0,i-1);var n,r=[];for(n=0;n<i;n++)o[n]&&r.push(t[n]);return r}function Pi(t,e,i,o,n){var r,s,a,l=0;for(s=o+1;s<=n-1;s++)(a=Ei(t[s],t[o],t[n],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Pi(t,e,i,o,r),Pi(t,e,i,r,n))}function Oi(t,e){for(var i=[t[0]],o=1,n=0,r=t.length;o<r;o++)Ai(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<r-1&&i.push(t[r-1]),i}function Ci(t,e,i,o,n){var r,s,a,l=o?fi:ki(t,i),h=ki(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=ki(s=Mi(t,e,r=l||h,i,n),i),r===l?(t=s,l=a):(e=s,h=a)}}function Mi(t,e,i,o,n){var r,s,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.max;return 8&i?(r=t.x+a*(c.y-t.y)/l,s=c.y):4&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):2&i?(r=c.x,s=t.y+l*(c.x-t.x)/a):1&i&&(r=h.x,s=t.y+l*(h.x-t.x)/a),new S(r,s,n)}function ki(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ai(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ei(t,e,i,o){var n,r=e.x,s=e.y,a=i.x-r,l=i.y-s,h=a*a+l*l;return h>0&&((n=((t.x-r)*a+(t.y-s)*l)/h)>1?(r=i.x,s=i.y):n>0&&(r+=a*n,s+=l*n)),a=t.x-r,l=t.y-s,o?a*a+l*l:new S(r,s)}function Ti(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ii(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ti(t)}var Si={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:Mi,_getBitCode:ki,_sqClosestPointOnSegment:Ei,isFlat:Ti,_flat:Ii};function zi(t,e,i){var o,n,r,s,a,l,h,c,u,p=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=ki(t[n],e);for(s=0;s<4;s++){for(c=p[s],o=[],n=0,r=(h=t.length)-1;n<h;r=n++)l=t[r],(a=t[n])._code&c?l._code&c||((u=Mi(l,a,c,e,i))._code=ki(u,e),o.push(u)):(l._code&c&&((u=Mi(l,a,c,e,i))._code=ki(u,e),o.push(u)),o.push(a));t=o}return t}var ji={clipPolygon:zi},Bi={project:function(t){return new S(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,n=this.R_MINOR/i,r=Math.sqrt(1-n*n),s=r*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-s)/(1+s),r/2);return o=-i*Math.log(Math.max(a,1e-10)),new S(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,r=Math.sqrt(1-n*n),s=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new D(a*i,t.x*i/o)}},Ni={LonLat:Bi,Mercator:Zi,SphericalMercator:V},Ri=i({},H,{code:"EPSG:3395",projection:Zi,transformation:function(){var t=.5/(Math.PI*Zi.R);return J(t,.5,-t,.5)}()}),Di=i({},H,{code:"EPSG:4326",projection:Bi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Bi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});W.Earth=H,W.EPSG3395=Ri,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=Di,W.Simple=Fi;var Ui=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Hi=function(t,e){return new Wi(t,e)},qi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Vi=function(t,e){return new qi(t,e)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=j(o),r=j("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Mt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new vi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,r=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=Z(s.min._subtract(a).add(n),s.max._subtract(a).subtract(n));if(!l.contains(r)){var h=j((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(M(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Oe(e._icon),n=e._map.layerPointToLatLng(o);i&&Pe(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){M(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),r=!1;n!==this._shadow&&(this._removeShadow(),r=!0),n&&(_e(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),to=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new B(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===H.distance){var n=Math.PI/180,r=this._mRadius/H.R/n,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(r*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(isNaN(c)||0===c)&&(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-s.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var no=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,r=Ei,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],h=1,c=l.length;h<c;h++){var u=r(t,e=l[h-1],i=l[h],!0);u<o&&(o=u,n=r(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if((o+=i=(n=a[t]).distanceTo(r=a[t+1]))>e)return this._map.layerPointToLatLng([r.x-(s=(o-e)/i)*(r.x-n.x),r.y-s*(r.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ti(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ti(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new B;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new S(t,t);this._pxBounds=new B([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,r=t.length;if(t[0]instanceof D){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,r,s,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Ci(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[o].push(s[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(o=0,n=(s=(a=this._parts[i]).length)-1;o<s;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new no(t,e)}no._flat=Ii;var so=no.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a,l=this._rings[0],h=l.length;if(!h)return null;for(r=s=a=0,t=0,e=h-1;t<h;e=t++)s+=((i=l[t]).x+(o=l[e]).x)*(n=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*n,r+=3*n;return this._map.layerPointToLatLng(0===r?l[0]:[s/r,a/r])},_convertLatLngs:function(t){var e=no.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof D&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){no.prototype._setLatLngs.call(this,t),Ti(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ti(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new S(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,n=0,r=this._rings.length;n<r;n++)(o=zi(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,r,s,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(r=0,s=(l=(e=this._parts[n]).length)-1;r<l;s=r++)(i=e[r]).y>t.y!=(o=e[s]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||no.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new so(t,e)}var lo=qi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=y(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=ho(t,r);return s?(s.feature=yo(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function ho(t,e){var i,o,n,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!s)return null;switch(s.type){case"Point":return co(h,t,i=c(a),e);case"MultiPoint":for(n=0,r=a.length;n<r;n++)i=c(a[n]),l.push(co(h,t,i,e));return new qi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===s.type?0:1,c),new no(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===s.type?1:2,c),new so(o,e);case"GeometryCollection":for(n=0,r=s.geometries.length;n<r;n++){var u=ho({geometry:s.geometries[n],type:"Feature",properties:t.properties},e);u&&l.push(u)}return new qi(l);default:throw new Error("Invalid GeoJSON object.")}}function co(t,e,i,o){return t?t(e,i):new Qi(i,o&&o.markersInheritOptions&&o)}function uo(t){return new D(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],r=0,s=t.length;r<s;r++)o=e?po(t[r],e-1,i):(i||uo)(t[r]),n.push(o);return n}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function mo(t,e,i,o){for(var n=[],r=0,s=t.length;r<s;r++)n.push(e?mo(t[r],e-1,i,o):fo(t[r],o));return!e&&i&&n.push(n[0]),n}function _o(t,e){return t.feature?i({},t.feature,{geometry:e}):yo(e)}function yo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var go={toGeoJSON:function(t){return _o(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function vo(t,e){return new lo(t,e)}Qi.include(go),io.include(go),to.include(go),no.include({toGeoJSON:function(t){var e=!Ti(this._latlngs);return _o(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),so.include({toGeoJSON:function(t){var e=!Ti(this._latlngs),i=e&&!Ti(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),_o(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_o(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var r=yo(n);"FeatureCollection"===r.type?o.push.apply(o,r.features):o.push(r)}}})),i?_o(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var bo=vo,wo=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=R(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=n(this.fire,this,"load"),e.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Lo=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=n(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],r=0;r<i.length;r++)o.push(i[r].src);this._url=i.length>0?o:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=ce("source");a.src=this._url[s],e.appendChild(a)}}}});function Po(t,e,i){return new Lo(t,e,i)}var Oo=wo.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function Co(t,e,i){return new Oo(t,e,i)}var Mo=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(n(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof qi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=j(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),ko=Mo.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Mo.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){Mo.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=Mo.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",i),We(e),Ue(this._contentNode),ze(e,"contextmenu",Fe),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=ce("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",ze(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,n="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",_e(t,n)):ye(t,n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new S(this._containerLeft,-i-this._containerBottom);n._add(Oe(this._container));var r=t.layerPointToContainerPoint(n),s=j(this.options.autoPanPadding),a=j(this.options.autoPanPaddingTopLeft||s),l=j(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),c=0,u=0;r.x+o+l.x>h.x&&(c=r.x+o-h.x+l.x),r.x-c-a.x<0&&(c=r.x-a.x),r.y+i+l.y>h.y&&(u=r.y+i-h.y+l.y),r.y-u-a.y<0&&(u=r.y-a.y),(c||u)&&t.fire("autopanstart").panBy([c,u])}},_onCloseButtonClick:function(t){this._close(),qe(t)},_getAnchor:function(){return j(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ao=function(t,e){return new ko(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof ko||(t=new ko(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof ko?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new ko(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(qe(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Eo=Mo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Mo.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Mo.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Mo.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=ce("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,n=this._container,r=o.latLngToContainerPoint(o.getCenter()),s=o.layerPointToContainerPoint(t),a=this.options.direction,l=n.offsetWidth,h=n.offsetHeight,c=j(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=l,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=l+2*(c.x+u.x),i=h/2),t=t.subtract(j(e,i,!0)).add(c).add(u),ye(n,"leaflet-tooltip-right"),ye(n,"leaflet-tooltip-left"),ye(n,"leaflet-tooltip-top"),ye(n,"leaflet-tooltip-bottom"),_e(n,"leaflet-tooltip-"+a),Pe(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return j(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),To=function(t,e){return new Eo(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Eo?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Eo(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Io=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=j(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function So(t){return new Io(t)}Gi.Default=Ki;var zo=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:vt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof S?t:new S(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,r=i.length;n<r;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var r=Math.min(1,(t-n.loaded)/200);be(n.el,r),r<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),h(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new S(+n,+r);a.z=+s;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>o&&this._retainParent(n,r,s,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var r=2*e;r<2*e+2;r++){var s=new S(n,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<o&&this._retainChildren(n,r,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=Math.round(e);n=void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom?void 0:this._clampZoom(n),o&&!(this.options.updateWhenZooming&&n!==this._tileZoom)||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();gt?Le(t.el,n,o):Pe(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*o);return new B(n.subtract(r),n.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),r=n.getCenter(),s=[],a=this.options.keepBuffer,l=new B(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new S(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=n.min.y;u<=n.max.y;u++)for(var p=n.min.x;p<=n.max.x;p++){var d=new S(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new S(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&be(t,this.options.opacity),nt&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&C(n(this._tileReady,this,t,null,r)),Pe(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new S(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function jo(t){return new zo(t)}var Bo=zo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Mt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ze(i,"load",n(this._tileOnLoad,this,e,i)),ze(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Mt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=v,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",v),zo.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return zo.prototype._tileReady.call(this,t,e,i)}});function Zo(t,e){return new Bo(t,e)}var No=Bo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var n in e)n in this.options||(o[n]=e[n]);var r=(e=d(this,e)).detectRetina&&Mt?2:1,s=this.getTileSize();o.width=s.x*r,o.height=s.y*r,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Bo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=Z(i.project(e[0]),i.project(e[1])),n=o.min,r=o.max,s=(this._wmsVersion>=1.3&&this._crs===Di?[n.y,n.x,r.y,r.x]:[n.x,n.y,r.x,r.y]).join(","),a=Bo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new No(t,e)}Bo.WMS=No,Zo.wms=Ro;var Do=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Oe(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=n.multiplyBy(-i).add(o).add(n).subtract(s);gt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Do.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,ue(this._container),Be(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Mt?2:1;Pe(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Mt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Do.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new B,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=s[i].length;o<n;o++)l[o?"lineTo":"moveTo"]((r=s[i][o]).x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(_e(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(n((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return At?new Fo(t):null}var Wo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Ho={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Do.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wo("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Wo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?y(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Wo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},qo=Tt?Wo:Q,Vo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=qo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Be(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=qo("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return Et||Tt?new Vo(t):null}Tt&&Vo.include(Ho),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Uo(t)||Go(t)}});var Jo=so.extend({initialize:function(t,e){so.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}Vo.create=qo,Vo.pointsToPath=X,lo.geometryToLayer=ho,lo.coordsToLatLng=uo,lo.coordsToLatLngs=po,lo.latLngToCoords=fo,lo.latLngsToCoords=mo,lo.getFeature=_o,lo.asFeature=yo,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Be(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),Me(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:qe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ee(),ke(),Be(document,{contextmenu:qe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var Qo=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ei.addInitHook("addHandler","doubleClickZoom",Qo),ei.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xo=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new vi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=R(this._map.options.maxBounds);this._offsetLimit=Z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,r=(o+e+i)%t-e-i,s=Math.abs(n+i)<Math.abs(r+i)?n:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),r=i.easeLinearity,s=n.multiplyBy(r/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),l=Math.min(i.inertiaMaxSpeed,a),h=s.multiplyBy(l/a),c=l/(i.inertiaDeceleration*r),u=h.multiplyBy(-c/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C((function(){e.panBy(u,{duration:c,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xo),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $o=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Be(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Be(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=j(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}qe(t)}}});ei.addInitHook("addHandler","keyboard",$o),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=di.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Be(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n(this._performZoom,this),o),qe(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,n=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?n:-n))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ei.addInitHook("addHandler","scrollWheelZoom",tn),ei.mergeOptions({tap:!0,tapTolerance:15});var en=di.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new S(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(n((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),ze(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Be(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new S(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ut||ei.addInitHook("addHandler","tap",en),ei.mergeOptions({touchZoom:Pt&&!rt,bounceAtZoomLimits:!0});var on=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var a=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",on),ei.BoxZoom=Yo,ei.DoubleClickZoom=Qo,ei.Drag=Xo,ei.Keyboard=$o,ei.ScrollWheelZoom=tn,ei.Tap=en,ei.TouchZoom=on,t.version=e,t.Control=oi,t.control=ni,t.Browser=St,t.Evented=I,t.Mixin=mi,t.Util=k,t.Class=A,t.Handler=di,t.extend=i,t.bind=n,t.stamp=s,t.setOptions=d,t.DomEvent=$e,t.DomUtil=Se,t.PosAnimation=ti,t.Draggable=vi,t.LineUtil=Si,t.PolyUtil=ji,t.Point=S,t.point=j,t.Bounds=B,t.bounds=Z,t.Transformation=G,t.transformation=J,t.Projection=Ni,t.LatLng=D,t.latLng=F,t.LatLngBounds=N,t.latLngBounds=R,t.CRS=W,t.GeoJSON=lo,t.geoJSON=vo,t.geoJson=bo,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=qi,t.featureGroup=Vi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Lo,t.videoOverlay=Po,t.SVGOverlay=Oo,t.svgOverlay=Co,t.DivOverlay=Mo,t.Popup=ko,t.popup=Ao,t.Tooltip=Eo,t.tooltip=To,t.Icon=Gi,t.icon=Ji,t.DivIcon=Io,t.divIcon=So,t.Marker=Qi,t.marker=Xi,t.TileLayer=Bo,t.tileLayer=Zo,t.GridLayer=zo,t.gridLayer=jo,t.SVG=Vo,t.svg=Go,t.Renderer=Do,t.Canvas=Fo,t.canvas=Uo,t.Path=$i,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=no,t.polyline=ro,t.Polygon=so,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(l.exports);var h=l.exports;function c(t,e={},i){return new(h.Control.extend({onAdd(){const o=document.createElement("div"),n=t.onAdd(i);return o.classList.add("leaflet-control"),e.bar&&o.classList.add("leaflet-bar"),e.addClass&&o.classList.add(e.addClass),e.margin||e.bar||(o.style.marginBottom="0px",o.style.marginTop="0px",o.style.marginLeft="0px",o.style.marginRight="0px"),n&&o.appendChild(n),h.DomEvent.disableClickPropagation(o),o},onRemove(){t.onRemove()}}))}function u(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const n=void 0===i.replace||i.replace;e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((i=>{const r=-1!==o.indexOf(i);if(!n&&!r||n){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}}))}))}function p(t){return null!=t}function d(t){return"string"==typeof t?!!t:p(t)}function f(t,e,i=!1){let o=t;const n=e,r=Array.isArray(n);let s=r&&[]||{};return r&&Array.isArray(n)?i?(o=o||[],s=s.concat(o),n.forEach(((t,e)=>{void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=f(o[e],t,i):-1===o.indexOf(t)&&s.push(t)}))):s=n:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){s[t]=o[t]})),Object.keys(n).forEach((function(t){s[t]="object"==typeof n[t]&&n[t]&&"object"==typeof o[t]&&"object"==typeof n[t]?f(o[t],n[t],i):n[t]}))),s}function m(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function _(t,e=10){let i;function o(...n){o.clear(),i=setTimeout((()=>{i=null,t.apply(this,n)}),e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}const y=6371;function g(t){return{type:"Polygon",coordinates:[v(t)]}}function v(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const b=Math.PI/180,w=180/Math.PI;function x(t,e,i=10,o=6){const n=i/y*w,r=n/Math.cos(e*b),s=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),l=t+r*Math.cos(i),h=e+n*Math.sin(i);s.push([l,h])}return s}function P(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function O(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:C(t,e));return t===e}function C(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let n=0;n<i.length;n++){if(!O(t[i[n]],e[o[n]],t,e))return!1}return!0}function M(t){const e={};return Object.keys(t).forEach((i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=M(t[i])})),e}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function A(t){return t.replace(/([^:]\/)\/+/g,"$1")}function E(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}function T(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}const I={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},S={stroke:!1,opacity:1},z={};for(const L in I){const t=I[L],e=z[t]||[];e.push(L),z[t]=e}function j(t,e){return-1!==(z[e]||[]).indexOf(t)}function B(t){const e=new h.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((t=>e.addData(t))),e.getBounds()}function Z(t){return{getBounds:()=>function(t){return E(B(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=B(t).getCenter();return[i,e]}(t)}}var N=Object.defineProperty,R=(t,e,i)=>((t,e,i)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class D{constructor(t,e){if(this.map=t,this.options=e,R(this,"layer"),R(this,"pane","order-0"),void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}function F(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:n}=i;return{latLng:i,lngLat:[n,o],pixel:{left:e.x,top:e.y},source:t}}var U=Object.defineProperty,W=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,V=(t,e,i)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function G({layer:t,source:e}){const i=e.target.feature;return((t,e)=>{for(var i in e||(e={}))H.call(e,i)&&V(t,i,e[i]);if(W)for(var i of W(e))q.call(e,i)&&V(t,i,e[i]);return t})({layer:t,feature:i,event:F(e),source:e},Z(i))}var J=Object.defineProperty,K=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,X=(t,e,i)=>e in t?J(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$=(t,e)=>{for(var i in e||(e={}))Y.call(e,i)&&X(t,i,e[i]);if(K)for(var i of K(e))Q.call(e,i)&&X(t,i,e[i]);return t},tt=(t,e,i)=>X(t,"symbol"!=typeof e?e+"":e,i);class et{constructor(t){tt(this,"layer"),tt(this,"_onclick"),tt(this,"_ondblclick"),tt(this,"_mouseout"),tt(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onDoubleClick:i,onLayerClick:o,onMouseOut:n,onMouseOver:r}=this.layer.options,s=e||o;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s($({selected:i},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),i&&(this._ondblclick=e=>{h.DomEvent.stopPropagation(e);const o=!!this.layer._getSelected(t);i($({selected:o},this._createMouseEvent(e)))},t.on("dblclick",this._ondblclick,this)),n&&(this._mouseout=t=>{n(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),r&&(this._mouseover=t=>{r(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return G({layer:this.layer,source:t})}}function it(t){return"[object Object]"===Object.prototype.toString.call(t)}function ot(t){return"function"==typeof t}function nt(t){return(e,i)=>{const o=e.map((t=>t()));return t(o,i)}}const rt={"!":nt((function([t]){return!t})),"!=":nt((function([t,e]){return t!==e})),"<":nt((function([t,e]){return t<e})),"<=":nt((function([t,e]){return t<=e})),"==":nt((function([t,e]){return t===e})),">":nt((function([t,e]){return t>e})),">=":nt((function([t,e]){return t>=e})),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),n=i.splice(-1,i.length%2)[0];for(let r=0;r<i.length-1;r+=2){if(i[r]()===o)return i[r+1]()}return n()}},st={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function at(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return lt(t);if("string"==typeof(e=t)&&e in st)return function(t){return lt(st[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function lt(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function ht(t,e,i,o,n){if("number"==typeof i&&"number"==typeof n)return i+(t-e)/(o-e)*(n-i);try{const r=at(i),s=at(n);return function(t){return`rgb(${t.join(",")})`}(r.map(((i,n)=>Math.ceil(ht(t,e,i,o,s[n])))))}catch(r){console.log(r)}throw new Error("Unsupported output type for linear interpolation.")}const ct={step:t=>{const[e,i,...o]=t,n=e();if("number"!=typeof n)return i();for(let r=0;r<o.length-2;r+=2){const t=o[r](),e=o[r+1](),i=o[r+2]();if(n>=t&&n<i)return e}return n>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const n=t();for(let r=0;r<i.length-2;r+=2){const t=i[r](),e=i[r+1](),s=i[r+2](),a=i[r+3]();if(o>=t&&o<=s&&"linear"===n[0])return ht(o,t,e,s,a)}throw new Error("Invalid interpolation type.")}};const ut={get:nt((function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null})),length:nt((([t])=>{if("string"==typeof t||Array.isArray(t))return t.length})),at:nt((function([t,e]){return e[t]})),has:nt((function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))})),in:nt((function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)})),"index-of":nt((function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)})),slice:nt((function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}))},pt={"+":nt((t=>t.reduce(((t,e)=>t+e),0))),"-":nt((t=>t.reduce(((t,e)=>t-e)))),"*":nt((t=>t.reduce(((t,e)=>t*e),1))),"/":nt((t=>t.reduce(((t,e)=>t/e)))),"%":nt((t=>t[0]%t[1])),"^":nt((t=>Math.pow(t[0],t[1]))),abs:nt((t=>Math.abs(t[0]))),acos:nt((t=>Math.acos(t[0]))),asin:nt((t=>Math.asin(t[0]))),atan:nt((t=>Math.atan(t[0]))),ceil:nt((t=>Math.ceil(t[0]))),cos:nt((t=>Math.cos(t[0]))),e:()=>Math.E,floor:nt((t=>Math.floor(t[0]))),ln:nt((t=>Math.log(t[0]))),ln2:()=>Math.LN2,log10:nt((t=>Math.log10(t[0]))),log2:nt((t=>Math.log2(t[0]))),max:nt((t=>Math.max(...t))),min:nt((t=>Math.min(...t))),pi:()=>Math.PI,round:nt((t=>Math.round(t[0]))),sin:nt((t=>Math.sin(t[0]))),sqrt:nt((t=>Math.sqrt(t[0]))),tan:nt((t=>Math.tan(t[0])))},dt={concat:nt((t=>t.reduce(((t,e)=>String(t)+String(e)),""))),downcase:nt((t=>String(t[0]).toLowerCase())),upcase:nt((t=>String(t[0]).toUpperCase()))},ft=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch(o){}};function mt(t){return(e,i)=>{for(const o of e){const e=ft(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}const _t={array:nt((t=>{const[e,i,o]=t;let n,r,s;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof i?(r=i,s=o):s=i):Array.isArray(e)&&(s=e),!Array.isArray(s))throw new Error("Expected an array");if(n&&!s.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(r&&s.length!==r)throw new Error(`Expected array of length ${r}`);return s})),boolean:nt(mt((t=>"boolean"==typeof t?t:void 0))),literal:nt((([t])=>t)),number:nt(mt((t=>"number"==typeof t?t:void 0))),object:nt(mt((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t))),string:nt(mt((t=>"string"==typeof t?t:void 0))),"to-boolean":nt(mt(Boolean)),"to-number":nt(mt(Number)),"to-string":nt(mt(String)),typeof:nt((([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every((t=>"number"==typeof t))?e="number":t.every((t=>"string"==typeof t))?e="string":t.every((t=>"boolean"==typeof t))&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t)))};var yt=Object.defineProperty,gt=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable,wt=(t,e,i)=>e in t?yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,xt=(t,e)=>{for(var i in e||(e={}))vt.call(e,i)&&wt(t,i,e[i]);if(gt)for(var i of gt(e))bt.call(e,i)&&wt(t,i,e[i]);return t};function Lt(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in Pt&&i.length>0}return!1}const Pt=xt(xt(xt(xt(xt(xt({},pt),_t),dt),ut),rt),ct);function Ot(t,e={}){const[i,...o]=t,n=Pt[i];if(n)return n(o.map((t=>()=>Lt(t)?Ot(t,e):t)),e);throw new Error(`Expression "${i}" is not supported.`)}var Ct=Object.defineProperty,Mt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Et=(t,e,i)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Tt=(t,e)=>{for(var i in e||(e={}))kt.call(e,i)&&Et(t,i,e[i]);if(Mt)for(var i of Mt(e))At.call(e,i)&&Et(t,i,e[i]);return t};function It(t){return e=>{const i=e.properties;return!!i&&Ot(t,i)}}const St=["iconSize","iconAnchor"];var zt=Object.defineProperty,jt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Nt=(t,e,i)=>e in t?zt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rt=(t,e)=>{for(var i in e||(e={}))Bt.call(e,i)&&Nt(t,i,e[i]);if(jt)for(var i of jt(e))Zt.call(e,i)&&Nt(t,i,e[i]);return t};function Dt(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(o,i?"i":"").exec(t)}const Ft={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>Dt(t,e),ilike:(t,e)=>Dt(t,e,!0)};function Ut(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function Wt(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(Ut(e)){const[i,o,n]=e,r=Ft[o];if(r){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,((o,r)=>(e=t[r],i.replace(r,n))));return r(e,o)}return r(t[i],n)}return!1}return Wt(t,e)},n=e.filter((t=>Array.isArray(t)));return"any"===i?n.some(o):n.every(o)}var Ht=Object.defineProperty,qt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,Jt=(t,e,i)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e)=>{for(var i in e||(e={}))Vt.call(e,i)&&Jt(t,i,e[i]);if(qt)for(var i of qt(e))Gt.call(e,i)&&Jt(t,i,e[i]);return t};function Yt(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find((e=>function(t,e){const i=Rt({},t.properties);return!!i&&(i.$id=t.id,Wt(i,e))}(t,e[0])));return o?Kt(Kt({},e),o[1]):e}}function Qt({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===St.indexOf(o)){const n=o,r=t[n];Lt(r)&&(e=!0,i[n]=It(r))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return Tt(Tt({},t),o)}}(t);if(i){const o=t=>$t({paint:i(t),defaultPaint:e});return o.paint=Xt({paint:t,defaultPaint:e}),o}return Xt({paint:t,defaultPaint:e})}function Xt({paint:t,defaultPaint:e}){var i;let o=Kt({},e);return o=Kt(Kt({},o),t),o.fill=null==(i=o.fill)||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function $t({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o=Kt({},e);if(ot(t)){const o=o=>{const n=$t({paint:t(o),defaultPaint:e,getPaintFunctions:i});return n.type=t.type,n};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>$t({paint:Yt(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);n&&(o=$t({paint:n,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=Qt({paint:t,defaultPaint:e})}return ot(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}var te=Object.defineProperty,ee=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,se=(t,e,i)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ae=(t,e)=>{for(var i in e||(e={}))ne.call(e,i)&&se(t,i,e[i]);if(oe)for(var i of oe(e))re.call(e,i)&&se(t,i,e[i]);return t};class le{constructor(t){var e;se(this,"layer"+"",e),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let i;const{layer:o,feature:n}=t;if(o&&n&&(ot(e)?i=e(n):it(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,n]of e){const e=this.layer.options.opacity;let r=t[n];p(e)&&-1!==n.toLowerCase().indexOf("opacity")&&(r=Number(r)*e),void 0!==r&&Object.defineProperty(i,o,{enumerable:!0,value:r})}return i}return S}_createDivIcon(t){const e=t,{html:i,rotate:o,className:n}=e,r=((t,e)=>{var i={};for(var o in t)ne.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&oe)for(var o of oe(t))e.indexOf(o)<0&&re.call(t,o)&&(i[o]=t[o]);return i})(e,["html","rotate","className"]),s=document.createElement("div");n&&(s.className=n),o&&(s.style.transform=`rotateZ(${o}deg)`),i&&(s.innerHTML=i);var a;return new h.DivIcon((a=ae({className:""},r),ee(a,ie({html:s}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,i)=>{const o=this._createDivIcon(t);return new h.Marker(i,{icon:o})}}else if("pin"===t.type)return(t,e)=>new h.Marker(e);return(e,i)=>new h.CircleMarker(i,this.preparePaint(ae(ae({},S),t)))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}var he=Object.defineProperty,ce=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,me=(t,e,i)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,_e=(t,e)=>{for(var i in e||(e={}))de.call(e,i)&&me(t,i,e[i]);if(pe)for(var i of pe(e))fe.call(e,i)&&me(t,i,e[i]);return t},ye=(t,e)=>ce(t,ue(e)),ge=(t,e,i)=>me(t,"symbol"!=typeof e?e+"":e,i);function ve({src:t,headers:e,withCredentials:i}){let o=()=>{};return[new Promise(((n,r)=>{const s=new XMLHttpRequest;s.open("GET",t),s.responseType="arraybuffer";for(const t in e)s.setRequestHeader(t,e[t]);i&&(s.withCredentials=i),s.onload=function(){const t=new Uint8Array(this.response),e=new Blob([t],{type:"image/png"}),i=(window.URL||window.webkitURL).createObjectURL(e);n(i)},s.onerror=r,s.send(),o=()=>{s.abort(),n("")}})),o]}var be=Object.defineProperty,we=(t,e,i)=>((t,e,i)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const xe=new class{constructor({concurrency:t=1,delay:e=0}={}){we(this,"queue",[]),we(this,"concurrency"),we(this,"activeCount",0),we(this,"timeoutId"),we(this,"delay"),we(this,"toAbort",[]),this.concurrency=t,this.delay=e}add(t,e){this.queue.push({promise:t,abort:e}),this.debouncedNext()}abort(){for(const t of this.toAbort)t();this.toAbort=[],this.queue=[],this._clearTimeout()}debouncedNext(){this._clearTimeout(),this.timeoutId=setTimeout((()=>this._next()),this.delay)}_clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}_next(){for(;this.activeCount<this.concurrency&&this.queue.length>0;){const{promise:t,abort:e}=this.queue.shift();this.activeCount++;let i,o=e;const n=t();Array.isArray(n)?(i=n[0],o=n[1]):i=n,o&&this.toAbort.push(o),i.finally((()=>{this.activeCount--,o&&(this.toAbort=this.toAbort.filter((t=>t!==o))),this.debouncedNext()}))}}}({concurrency:6,delay:200});var Le=Object.defineProperty,Pe=(t,e,i)=>((t,e,i)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oe extends h.ImageOverlay{constructor(t,e,i){super(t,e,i),Pe(this,"_aborter")}cancelLoad(){this._aborter&&(this._aborter(),this._aborter=void 0)}_initImage(){super._initImage();const{headers:t,withCredentials:e}=this.options,i=this._image,o=i.src;i.src="",xe.add((()=>{const[n,r]=ve({src:o,headers:t,withCredentials:e});return n.then((t=>{i.src=t})),this._aborter=r,n}))}}var Ce=Object.defineProperty,Me=(t,e,i)=>((t,e,i)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ke extends h.Layer{constructor(t,e){super(e),Me(this,"defaultWmsParams",{request:"GetMap"}),Me(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,withCredentials:!1,viewPortBuffer:0,setViewDelay:100}),Me(this,"wmsParams"),Me(this,"_url"),Me(this,"_currentUrl"),Me(this,"_currentOverlay"),Me(this,"_loadedOverlay"),this._url=t;const i={},o={};let n;for(n in e)n in this.options?o[n]=e[n]:i[n]=e[n];h.Util.setOptions(this,o),this.wmsParams=h.Util.extend({},this.defaultWmsParams,i)}setParams(t){h.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:_(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e);this._loadedOverlay&&(this._loadedOverlay.cancelLoad(),this._loadedOverlay.off("load"),this._loadedOverlay=void 0);const o=new Oe(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers,withCredentials:this.options.withCredentials});o.addTo(this._map),this._loadedOverlay=o,o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._loadedOverlay=void 0,this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:n,maxZoom:r}=this.options;(n&&this._map.getZoom()<n||r&&this._map.getZoom()>r)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const n=this.options.crs||t.options.crs;if(n){const t=n.project(i.getNorthWest()),e=n.project(i.getSouthEast()),r={width:o.x,height:o.y};r.bbox=[t.x,e.y,e.x,t.y],h.Util.extend(this.wmsParams,r)}}getImageUrl(){const t=h.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var Ae=Object.defineProperty,Ee=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Se=(t,e,i)=>e in t?Ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ze=(t,e)=>{for(var i in e||(e={}))Te.call(e,i)&&Se(t,i,e[i]);if(Ee)for(var i of Ee(e))Ie.call(e,i)&&Se(t,i,e[i]);return t},je=(t,e,i)=>Se(t,"symbol"!=typeof e?e+"":e,i);class Be extends D{constructor(){super(...arguments),je(this,"layer")}addLayer(t){const e=t&&t.url;if(e){const i=(t=ze({transparent:!0},t)).updateWmsParams;if(this.layer=new ke(e,ze(ze(ze({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}}function Ze(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=_(((...t)=>{h.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img"),[n,r]=ve({src:i,withCredentials:this.options.withCredentials,headers:this.options.headers});return n.then((t=>{o.src=t,e(null,o)})),o.abort=r,(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const i in t)if(t[i].coords.z!==e){const e=t[i].el;e.onload=h.Util.falseFn,e.onerror=h.Util.falseFn,e.complete||(e.abort&&e.abort(),e.src=h.Util.emptyImageUrl,h.DomUtil.remove(e),delete t[i])}}}}je(Be,"queue",xe);const Ne=Ze(class extends h.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var Re=Object.defineProperty,De=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,qe=(t,e,i)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ve=(t,e)=>{for(var i in e||(e={}))We.call(e,i)&&qe(t,i,e[i]);if(Ue)for(var i of Ue(e))He.call(e,i)&&qe(t,i,e[i]);return t};class Ge extends D{addLayer(t){if(this.options=Object.assign(this.options,t),t){const i=t,{url:o}=i,n=((t,e)=>{var i={};for(var o in t)We.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Ue)for(var o of Ue(t))e.indexOf(o)<0&&He.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const t=Ve({pane:this.pane,attribution:n.attribution,minZoom:n.minZoom,maxZoom:n.maxZoom},n.nativeOptions);let i;return n.subdomains&&(t.subdomains=n.subdomains),i=n.headers||n.withCredentials?new Ne(o,(e=Ve({},t),De(e,Fe({headers:n.headers,withCredentials:n.withCredentials,setViewDelay:n.setViewDelay})))):new h.TileLayer(o,t),i}}var e}updateLayer(){if(this.layer){const t=this.layer._url,e=(new Date).getTime(),i=t.includes("?")?"&":"?",o=t.replace(/(\?|&)timestamp=\d*/g,"")+i+`timestamp=${e}`;this.layer.setUrl(o),this.layer.redraw()}}}var Je=Object.defineProperty,Ke=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ti=(t,e,i)=>e in t?Je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const ei=Ze(class extends h.TileLayer.WMS{constructor(t,e){super(t,e)}});var ii=Object.defineProperty,oi=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,ri=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,li=(t,e,i)=>e in t?ii(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,hi=(t,e)=>{for(var i in e||(e={}))si.call(e,i)&&li(t,i,e[i]);if(ri)for(var i of ri(e))ai.call(e,i)&&li(t,i,e[i]);return t};function ci(t){return[[t[3],t[0]],[t[1],t[2]]]}var ui=Object.defineProperty,pi=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,mi=(t,e,i)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,_i=(t,e)=>{for(var i in e||(e={}))di.call(e,i)&&mi(t,i,e[i]);if(pi)for(var i of pi(e))fi.call(e,i)&&mi(t,i,e[i]);return t},yi=(t,e,i)=>mi(t,"symbol"!=typeof e?e+"":e,i);const gi=class t{constructor(){yi(this,"options",{target:"map"}),yi(this,"layerAdapters",t.layerAdapters),yi(this,"controlAdapters",t.controlAdapters),yi(this,"emitter",new i),yi(this,"map"),yi(this,"_resizeObserver"),yi(this,"_unselectCb",[]),yi(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),yi(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=_i({},t),this.options.target){const{zoom:t,center:e,maxZoom:i,minZoom:o,maxBounds:n,mapAdapterOptions:r}=this.options;this.map=this.options.map||new h.Map(this.options.target,_i({attributionControl:!1,zoomControl:!1,maxBounds:n?ci(n):void 0,maxZoom:i,minZoom:o,center:e&&[e[1],e[0]],zoom:t},r)),this._updateMinZoomForBounds(o),this._watchSizeChangeToUpdateMinZoom();const s=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},s.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:r,minZoom:s,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),r&&this.fitBounds(r),void 0!==n)if(n){const t=ci(n);i.setMaxBounds(t),this._updateMinZoomForBounds()}else i.setMaxBounds(null),this._updateMinZoomForBounds();void 0!==a&&i.setMaxZoom(a),void 0!==s&&this._updateMinZoomForBounds(s)}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,r={};i&&(r.maxZoom=i),n&&(r.padding=[n,n]),o&&(r.padding=o),this.map.fitBounds(ci(t),r)}}getLayerAdapter(e){return t.layerAdapters[e]}createControl(t,e){return c(t,e,this)}createButtonControl(t){return function(t,e){const i=document.createElement("a"),o=t.title||"";i.href="#",i.title=o,i.setAttribute("role","button"),i.setAttribute("aria-label",o),t.addClass&&i.classList.add(t.addClass),h.DomEvent.disableClickPropagation(i),h.DomEvent.on(i,"click",h.DomEvent.stop),t.html instanceof HTMLElement?i.appendChild(t.html):"string"==typeof t.html&&(i.innerHTML=t.html);const n=e=>{e.stopPropagation(),t.onClick()};return c({onAdd:()=>(void 0!==t.onClick&&i.addEventListener("click",n),i),onRemove(){const e=i.parentNode;e&&e.removeChild(i),void 0!==t.onClick&&i.removeEventListener("click",n)}},{bar:!0},e)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=F(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(){this._stopWatchSizeChangeToUpdateMinZoom();const t=this.getContainer();t&&this.map&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{this._updateMinZoomForBounds()})),this._resizeObserver.observe(t))}_stopWatchSizeChangeToUpdateMinZoom(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);t.on("movestart",(()=>{Be.queue.abort()})),t.on("zoomstart",(()=>{Be.queue.abort()}));for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,F(t))),t)}}_updateMinZoomForBounds(t){var e;const i=this.map;if(i){t=null!=t?t:i.getMinZoom();const o=h.latLngBounds(h.latLng(-90,-18e3),h.latLng(90,18e3)),n=null!=(e=i.options.maxBounds)?e:o;if(void 0!==n){i.setMinZoom(0);const e=i.getBoundsZoom(n,!0),o=t<e?e:t;i.options.minZoom=o,i.setMinZoom(o),i.getZoom()<o&&i.setZoom(o)}}}};yi(gi,"layerAdapters",{GEOJSON:class extends D{constructor(t,e){super(t,e),ge(this,"layer"),ge(this,"selected",!1),ge(this,"type"),ge(this,"_layers",[]),ge(this,"_events"),ge(this,"paint"),ge(this,"selectedPaint"),ge(this,"_selectedLayers",[]),ge(this,"_filteredLayers",[]),ge(this,"_filterFun"),ge(this,"_openedPopup",[]),ge(this,"_paint"),ge(this,"$updateTooltip",_((()=>{this.updateTooltip()}),300)),ge(this,"$unselect",(()=>{this.unselect()})),this._events=new et(this),this._paint=new le(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new h.FeatureGroup([],ye(_e({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>_e({target:this,feature:t.feature,layer:t},Z(t.feature))))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t(_e({target:this,feature:i,layer:n},Z(i)))?(e.addLayer(n),o.push(_e({target:this,feature:i,layer:n},Z(i)))):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>_e({feature:e,layer:t,visible:t&&!!t._map,target:this},Z(e))))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:r}=o;if(n&&r){t(n)&&(e.removeLayer(r),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let i;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?T(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?T(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=I[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>j(t.geometry.type,e)));else if("Feature"===t.type){if(!j(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>j(t.type,e))));return t}(t,o),t&&(i=this._getGeoJsonOptions(e,o))}new h.GeoJSON(t||void 0,i)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return E(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=_e(_e({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=_e(_e({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:i}=t,{label:o,labelField:n,labelOnHover:r}=this.options;if(i){let s;if(i.unbindTooltip(),e.properties&&n?s=e.properties[n]:o&&(s=o(_e(_e({target:this},t),Z(e)))),s){const t=!r;i.bindTooltip(String(s),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,i=arguments,o=function*(t,e={},i,o){var n,r;const{feature:s,layer:a}=t,{minWidth:l,autoPan:h,maxWidth:c,closeButton:u}=_e({minWidth:300},e),d=null!=u?u:!this.options.selectOnHover;let f;const m=[],_=t=>{m.push(t)},y=()=>{f&&this._removePopup(f)};let g;if(g=e.createPopupContent?yield e.createPopupContent(_e({layer:a,feature:s,target:this,type:i,close:y,onClose:_},Z(s))):e.popupContent,g&&a){const e={minWidth:l,autoPan:h,closeButton:d,closeOnClick:!1,autoClose:!1};if(p(c)&&(e.maxWidth=c),f=a.bindPopup(g,e),null==(r=null==(n=this.options.popupOptions)?void 0:n.unselectOnClose)||r){const t=a.getPopup();t&&t.once("remove",(()=>{y()}),this)}this._openedPopup.push([f,m,t]),f.openPopup(o)}},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null==(i=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||i,[,n,r]=this._openedPopup[o];for(const e of n)e(r);n.length=0,t&&this._unSelectLayer(r),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?_e(_e({},S),i(t)):ye(_e({},S),{type:"path"}))}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o=_e({target:this,feature:t,layer:e},Z(t));e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:r,selectable:s,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!p(a)||a,i.addLayer(e),s&&(l?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{n&&this._openPopup(_e({target:this,layer:e,feature:t},Z(t)),r,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){h.DomEvent.stopPropagation(t);const e=t.target,i=e.feature,o=_e({target:this,layer:e,feature:i},Z(i)),n=this._getSelected(e);n?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(n):this._selectLayer(o,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:n,popupOnSelect:r,popupOptions:s}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),r&&this._openPopup(t,s,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect(_e({type:e,layer:this,features:i},Z(i)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:i,labelOnHover:o}=this.options;this._addMapClickListener(),!i&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:Be,TILE:Ge,WMS:class extends D{addLayer(t){Object.assign(this.options,t);const e=t,{url:i}=e,o=((t,e)=>{var i={};for(var o in t)si.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ri)for(var o of ri(t))e.indexOf(o)<0&&ai.call(t,o)&&(i[o]=t[o]);return i})(e,["url"]);if(i){const e=hi({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,transparent:!0},t.nativeOptions);let r;return r=o.headers||o.withCredentials?new ei(i,(n=hi({},e),oi(n,ni({headers:o.headers,withCredentials:o.withCredentials})))):new h.TileLayer.WMS(i,e),r}var n}},OSM:class extends Ge{addLayer(t){return super.addLayer((e=((t,e)=>{for(var i in e||(e={}))Xe.call(e,i)&&ti(t,i,e[i]);if(Qe)for(var i of Qe(e))$e.call(e,i)&&ti(t,i,e[i]);return t})({name:"OpenStreetMap",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),Ke(e,Ye({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),yi(gi,"controlAdapters",{ZOOM:h.Control.Zoom,ATTRIBUTION:class extends h.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}}),yi(gi,"Map",h.Map);let vi=gi;var bi=Object.defineProperty,wi=(t,e,i)=>((t,e,i)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class xi extends Error{constructor(){super(),wi(this,"name","CancelError"),Object.setPrototypeOf(this,xi.prototype)}}var Li=Object.defineProperty,Pi=(t,e,i)=>((t,e,i)=>e in t?Li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oi{constructor(t={}){this.options=t,Pi(this,"_promises",new Map)}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const i=e||t,o=this._promises.get(i);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(i,t),t.finally((()=>{this.remove(i)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const i=this.get(e=e||t.name);return i||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),i=this.add.bind(this);return function(o,n,r){const s=r.value;return t=t||n,r.value=function(...o){const n=e(t);if(n)return n;return i(s.apply(this,o),t)},r}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}var Ci=Object.defineProperty,Mi=(t,e,i)=>((t,e,i)=>e in t?Ci(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class ki extends Error{constructor(){super(),Mi(this,"name","TimeoutError"),Object.setPrototypeOf(this,ki.prototype)}}var Ai,Ei=Object.defineProperty,Ti=(t,e,i)=>((t,e,i)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const Ii=(t,e,i,o)=>{try{t(i(o))}catch(n){e(n)}};let Si=0;Ai=Symbol.toStringTag;const zi=class t{constructor(e,i){Ti(this,Ai),Ti(this,"id",Si++),Ti(this,"_isCanceled",!1),Ti(this,"_isPending",!0),Ti(this,"_promise"),Ti(this,"_cancelPromise"),Ti(this,"_cancelHandlers",[]),Ti(this,"_setCanceledCallback"),Ti(this,"_parentPromise"),Ti(this,"_children",[]),this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new xi)}));const o=[this._cancelPromise,new Promise(((i,o)=>e((e=>{e instanceof t?this.attach(e):this._isPending=!1,i(e)}),(t=>{this._isPending=!1,o(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];i&&o.push(new Promise(((t,e)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{e(new ki)}}),i)}))),this._promise=Promise.race(o)}static createControl(t){return new Oi(t)}static resolve(e){return new t((t=>t(e)))}static reject(e){return new t(((t,i)=>i(e)))}static all(e){return new t(((t,i)=>{Promise.all(e).then(t).catch(i)})).catch((t=>{if(t instanceof this.CancelError)for(const i of e){"cancel"in i&&i.cancel()}throw t}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(e,i){const o=new t(((t,o)=>{if(this._promise){const n=e=>{i?Ii(t,o,i,e):o(e)};this._promise.then((i=>{this._isCanceled?n(i):e?Ii(t,o,e,i):t(i)}),n)}}));return o._parentPromise=this,this._children.push(o),o}catch(t){return this._isCanceled&&t&&t(new xi),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new xi:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}};Ti(zi,"CancelError",xi),Ti(zi,"TimeoutError",ki),Ti(zi,"PromiseControl",Oi);let ji=zi;Object.setPrototypeOf(ji.prototype,Promise.prototype);const Bi={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'},Zi=12;var Ni=Object.defineProperty,Ri=(t,e,i)=>((t,e,i)=>e in t?Ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const Di=class t{constructor(e={}){var i;Ri(this,"cache",[]);const o=null!=(i=e.namespace)?i:"default";return t.instance[o]?t.instance[o]:(t.instance[o]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i){return this.add(t,e,i,!0)}add(t,e,i,o){const n=this._find(t,i);if(n)return n.value;{let n;n=e instanceof Function?e():e;const r=i&&JSON.parse(JSON.stringify(M(i))),s={key:t,value:n,props:r,options:r};return o&&!d(n)?n:(this.cache.push(s),n instanceof Promise?(n.catch((e=>{throw this.delete(t,i),e})),o&&n.then((e=>(d(e)||this.delete(t,i),e))),n):n)}}match(t,e){const i=this._find(t,e);if(i)return i.value}matchAll(t,e){return t?this.cache.filter((i=>this._filter(i,t,e))).map((t=>t.value)):this.cache.map((t=>t.value))}delete(t,e){let i=[];"string"==typeof t?i=this.cache.filter((i=>this._filter(i,t,e))):i.push(t);for(const o of i){const t=this.cache.indexOf(o);this.cache.splice(t,1)}}_find(t,e){return this.cache.find((i=>this._filter(i,t,e)))}_filter(t,e,i){if(t.key===e){if(i){return C(t.props||t.options||{},M(i))}return!0}return!1}};Ri(Di,"instance",{});let Fi=Di;var Ui="2.5.2",Wi=Object.defineProperty,Hi=(t,e,i)=>((t,e,i)=>e in t?Wi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class qi extends Error{constructor(t){super(),Hi(this,"name","NgwError"),Hi(this,"title"),Hi(this,"message"),Hi(this,"detail"),Hi(this,"exception"),Hi(this,"status_code"),Hi(this,"data"),Hi(this,"guru_meditation"),Object.assign(this,t),Object.setPrototypeOf(this,qi.prototype)}}var Vi=Object.defineProperty,Gi=(t,e,i)=>((t,e,i)=>e in t?Vi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ji extends qi{constructor(t){super(t),Gi(this,"name","ResourceNotFoundError"),Gi(this,"exception","nextgisweb.resource.exception.ResourceNotFound"),Object.setPrototypeOf(this,Ji.prototype)}}function Ki(t){return"[object Object]"===Object.prototype.toString.call(t)}const Yi=["description"];function Qi(t,e=""){e=e?e+"__":"";const i={};for(const[o,n]of Object.entries(t))if(-1===Yi.indexOf(o))if(Ki(n))if("owner_user"===o){const t=Qi(n,o);Object.assign(i,t)}else"parent"===o&&"id"in n&&(i.parent_id=n.id);else p(n)&&(i[e+o]=n);return i}var Xi=Object.defineProperty,$i=Object.defineProperties,to=Object.getOwnPropertyDescriptors,eo=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,no=(t,e,i)=>e in t?Xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ro=(t,e)=>{for(var i in e||(e={}))io.call(e,i)&&no(t,i,e[i]);if(eo)for(var i of eo(e))oo.call(e,i)&&no(t,i,e[i]);return t},so=(t,e,i)=>no(t,"symbol"!=typeof e?e+"":e,i);class ao{constructor({connector:t,cacheId:e}){so(this,"cache"),so(this,"connector"),this.connector=t,this.cache=new Fi({namespace:e})}getOne(t,e){const i=this.cache,o={},n=(r=ro({},e),$i(r,to({cache:!1})));var r;"string"==typeof t?o.keyname=t:"number"==typeof t?o.id=t:Ki(t)&&(void 0!==t.id?o.id=t.id:(t.keyname&&(o.keyname=t.keyname),t.display_name&&(o.display_name=t.display_name)));const s=()=>"string"==typeof t?this._fetchResourceBy({keyname:t},n):"number"==typeof t?this._fetchResourceById(t,n):Ki(t)?this._fetchResourceBy(t,n):ji.resolve(void 0);return(null==e?void 0:e.cache)?i.addFull("resource",s,o):s()}getOneOrFail(t,e){return this.getOne(t,e).then((t=>{if(t)return t;throw new Ji}))}getId(t,e){return"number"==typeof t?ji.resolve(t):"string"==typeof t||Ki(t)?this.getOne(t,e).then((t=>{if(t)return t.resource.id})):ji.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then((t=>{if(void 0===t)throw new Error;return t}))}getMany(t,e){return this._resourceCacheFilter(t).then((i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Qi(t)),this.connector.get("resource.search",e,ro({serialization:"full"},i)).then((t=>{if(t)for(const e of t)this.cache.add("resource.item",ji.resolve(e),{id:e.resource.id});return t}))}return i}))}getParent(t,e){return this.getOne(t,e).then((t=>t?this.getOne(t.resource.parent.id,e):ji.resolve(void 0)))}getChildrenOf(t,e){return this.getIdOrFail(t).then((t=>this._getChildrenOf(t,e)))}update(t,e){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})}))}delete(t){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then((()=>{this._cleanResourceItemCache(t)}))}))}_getChildrenOf(t,e,i=[]){return this.connector.get("resource.collection",ro({cache:!0},e),{parent:t}).then((t=>{const o=[];for(const n of t)this.cache.add("resource.item",ji.resolve(n),{id:n.resource.id}),i.push(n),(null==e?void 0:e.recursive)&&n.resource.children&&o.push(this._getChildrenOf(n.resource.id,e,i));return o.length?ji.all(o).then((()=>i)):i}))}_cleanResourceItemCache(t){return e=this,i=null,o=function*(){const e=this.cache.all(),i=[];for(const o of e){const e=o.options&&o.options.id;["resource.item","resource"].includes(o.key)&&void 0!==e&&("number"==typeof e?e===t&&i.push(o):(yield this.getId(e))===t&&i.push(o))}for(const t of i)this.cache.delete(t)},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}_fetchResourceById(t,e){const i=()=>this.connector.get("resource.item",e,{id:t});return(null==e?void 0:e.cache)?this.cache.add("resource.item",i,{id:t}).catch((t=>{if(!(t instanceof Ji))throw t})):i()}_fetchResourceBy(t,e){return this.getMany(t,e).then((t=>t[0]))}_resourceCacheFilter(t){return ji.all(this.cache.matchAll("resource.item")).then((e=>(e.filter((e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:p(t.id)&&p(e.resource.id)?t.id===e.resource.id:C(t,e.resource)})),[])))}}const lo=[];function ho(t){lo.push(t)}var co=Object.defineProperty,uo=(t,e,i)=>((t,e,i)=>e in t?co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class po extends qi{constructor(t){super(t),uo(this,"name","InsufficientPermissionsError"),uo(this,"exception","nextgisweb.core.exception.InsufficientPermissions"),Object.setPrototypeOf(this,po.prototype)}}const fo=/\{ *([\w_-]+) *\}/g;function mo(t,e){return t.replace(fo,((t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o}))}var _o=Object.defineProperty,yo=(t,e,i)=>((t,e,i)=>e in t?_o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class go extends Error{constructor(t){super(),yo(this,"name","NetworkError"),Object.setPrototypeOf(this,go.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}let vo;vo=(t,e,i={},o,n)=>{i.method=i.method||"GET";const r=new XMLHttpRequest;r.open(i.method||"GET",t,!0),"blob"===i.responseType&&(r.responseType=i.responseType);const s=()=>{try{return JSON.parse(r.responseText)}catch(t){return r.responseText}};r.onload=()=>{-1!==[401,403,404,422,500].indexOf(r.status)&&o(new qi(s())),((t=!1)=>{const n=t?o:e;"blob"===i.responseType?n(r.response):r.responseText?n(s()):o({message:""})})()},r.onerror=e=>{o(0===r.status?new go(t):e)},r.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const h in a){const t=a[h];"string"==typeof t&&r.setRequestHeader(h,t)}let l;if(void 0!==i.withCredentials&&(r.withCredentials=i.withCredentials),i.file){if(l=new FormData,l.append("file",i.file),i.data)for(const h in i.data)l.append(h,l[h])}else l=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;n&&n((()=>{r.abort()})),r.send(l)};var bo=Object.defineProperty,wo=Object.getOwnPropertySymbols,xo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Po=(t,e,i)=>e in t?bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Oo=(t,e)=>{for(var i in e||(e={}))xo.call(e,i)&&Po(t,i,e[i]);if(wo)for(var i of wo(e))Lo.call(e,i)&&Po(t,i,e[i]);return t},Co=(t,e,i)=>Po(t,"symbol"!=typeof e?e+"":e,i);let Mo=0;class ko{constructor(t){this.options=t,Co(this,"id",Mo++),Co(this,"emitter",new i),Co(this,"user"),Co(this,"resources"),Co(this,"cache"),Co(this,"withCredentials"),Co(this,"client",`NextGIS-NGW-Connector/${Ui}`),Co(this,"routeStr","/api/component/pyramid/route"),Co(this,"activeRequests",[]),Co(this,"requestTransform");const e=function(t){return lo.find((e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return C(e.options.auth,t.auth)}}))}(t);if(this.cache=new Fi({namespace:t.cacheId}),e)return e;{const{route:e,requestTransform:i,withCredentials:o}=this.options;e&&(this.routeStr=e),i&&(this.requestTransform=i),void 0!==o&&(this.withCredentials=o),this.resources=new ao({connector:this,cacheId:t.cacheId}),ho(this)}}static create(t){return new this(t)}clearCache(){this.cache.clean(),this.resources.cache.clean()}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,ho(this)}connect(){const t=this.options.auth;return this.cache.add("route",(()=>new ji(((e,i)=>{const o=()=>this.makeQuery(`${this.routeStr}?client=${this.client}`.toString(),{},{}).then((t=>{e(t)})).catch((t=>{i(t)}));if(t){const{login:e,password:n}=t;if(e&&n)return this._login({login:e,password:n}).then((()=>o())).catch((t=>i(t)))}return o()}))),{id:this.id,auth:t,baseUrl:this.options.baseUrl})}login(t,e){return this.logout(),ho(this),this._login(t,e)}logout(){this.abort(),function(t){const e=lo.indexOf(t);-1!==e&&lo.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.clearCache(),this.emitter.emit("logout")}getUserInfo(t,e){if(this.user&&this.user.id)return ji.resolve(this.user);t&&(this.options.auth=t);const i=Oo({headers:this.getAuthorizationHeaders(t)},e);return this.makeQuery("/api/component/auth/current_user",{},i)}getAuthorizationHeaders(t){const e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t,o=[e,i].map(encodeURIComponent).join(":");return window.btoa(o)}}abort(){for(const t of this.activeRequests)t.cancel();this.activeRequests=[]}getActiveApiRequests(){return[...this.activeRequests]}apiRequest(t,e={},i={}){var o,n;i=Oo({withCredentials:this.withCredentials},i);const{method:r,headers:s,withCredentials:a,responseType:l}=i,h=M(e=null!=(o=i.params)?o:e),c=()=>function(t){const e=t.params;return new ji(((i,o)=>t.connector.connect().then((n=>{let r=n&&n[t.name];if(r){r=[...r];let n=r.shift();if(r.length){const t={};for(let i=0;i<r.length;i++){const o=r[i];if(t[i]="{"+o+"}",void 0===e[o])throw new Error("`"+o+"` url api argument is not specified")}n&&(n=mo(n,t))}if(e){const t=[],i=e.paramList;Array.isArray(i)&&(delete e.paramList,i.forEach((e=>{t.push(`${e[0]}=${e[1]}`)})));for(const o in e)-1===r.indexOf(o)&&t.push(`${o}=${e[o]}`);t.length&&(n=n+"?"+t.join("&"))}n?i(t.connector.makeQuery(n,e,t.requestOptions)):o(new Error("request url is not set"))}else i(void 0)})).catch((t=>{o(t)}))))}({name:t,params:h,requestOptions:i,connector:this});return i.cache&&"GET"===r?this.cache.add(t,c,Oo({params:h},M({headers:s,withCredentials:a,responseType:l,baseUrl:this.options.baseUrl,userId:null==(n=this.user)?void 0:n.id}))):c()}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}makeQuery(t,e,i={}){if(t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=mo(t,e)),t=encodeURI(A(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}_loadData(t,e){if(e.responseType=e.responseType||"json",e.signal&&e.signal.aborted)return ji.reject(new ji.CancelError);const i=new ji(((i,o,n)=>{if(this.user&&((e=e||{}).headers=Oo(Oo({},this.getAuthorizationHeaders()),e.headers)),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}vo(t,i,e,o,n)})).then((t=>(this._cleanActiveRequests(i),t))).catch((t=>{if(this._cleanActiveRequests(i),t instanceof ji.CancelError);else{const e=this._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(()=>{i.cancel(),this._cleanActiveRequests(i)})),this.activeRequests.push(i),i}_login(t,e){return this.getUserInfo(t,e).then((t=>(this.user=t,this.emitter.emit("login",t),t))).catch((t=>{throw this.emitter.emit("login:error",t),t}))}_cleanActiveRequests(t){const e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)}_handleHttpError(t){if(t&&t instanceof qi){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new Ji(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new po(t)}return t}}Co(ko,"errors",{NgwError:qi,ResourceNotFoundError:Ji});var Ao=Object.defineProperty,Eo=Object.defineProperties,To=Object.getOwnPropertyDescriptors,Io=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,jo=(t,e,i)=>e in t?Ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bo=(t,e)=>{for(var i in e||(e={}))So.call(e,i)&&jo(t,i,e[i]);if(Io)for(var i of Io(e))zo.call(e,i)&&jo(t,i,e[i]);return t},Zo=(t,e)=>Eo(t,To(e));const No={srs:4326,geom_format:"geojson"};function Ro(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Do(t,e){const{extensions:i,geom:o,fields:n,srs:r,ilike:s,like:a}=e,l=i?i.join(","):"";"*"!==l&&(t.extensions=l),null!=n&&(t.fields=Array.isArray(n)?n.join(","):""),void 0!==o&&(t.geom=o?"yes":"no",o||(delete t.srs,delete t.geom_format)),p(s)?t.ilike=s:p(a)&&(t.like=a),p(r)&&(t.srs=r)}function Fo(t){const e=Wo(t);return ji.all(e).then((e=>{const i=[],o=[];for(const t of e)for(const e of t)i.includes(e.id)||(o.push(e),i.push(e.id));return t.offset||t.limit?o.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:o.length):o}))}function Uo(t){const[e,i,o]=t;let n="",r="";return[`${"id"!==e?"fld_":""}${String(e).trim().replace(/^(%?)(.+?)(%?)$/,((t,e,i,o)=>(n=e,r=o,i)))}__${i}`,n+o+r]}function Wo(t,e=[],i=[]){var o;const{filters:n}=t,r=null!=(o=t.paramList)?o:[],s="string"==typeof n[0]?n[0]:"all",a=n.filter((t=>Array.isArray(t)));if("any"===s)for(const l of a)Ut(l)?e.push(qo(Zo(Bo({},t),{paramList:[...i,...r,Uo(l)]}))):Wo(Zo(Bo({},t),{filters:l}),e,[...i]);else if("all"===s){const o=[],n=[];for(const t of a)Ut(t)?o.push(Uo(t)):n.push(t);if(n.length)for(const r of n)Wo(Zo(Bo({},t),{filters:r}),e,[...i,...o]);else e.push(qo(Zo(Bo({},t),{paramList:[...i,...r,...o]})))}return e}function Ho(t){return`POLYGON((${t.map((([t,e])=>{const[i,o]=P(t,e).map((t=>Math.round(1*(t+Number.EPSILON))/1));return i+" "+o})).join(", ")}))`}function qo(t){const e=Bo({},No),{limit:i,cache:o,signal:n,offset:r,orderBy:s,paramList:a,connector:l,geomFormat:h,intersects:c,resourceId:u}=t;if(i?i!==Number.POSITIVE_INFINITY&&(e.limit=i):e.limit=7e3,r&&(e.offset=r),h&&(e.geom_format=h),Do(e,t),s&&(e.order_by=s.join(",")),Array.isArray(c)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}(c)?v(c):c;e.intersects=Ho(t)}else"string"==typeof c&&(e.intersects=c);a&&(e.paramList=a);const p=Bo({id:u},e);return l.get("feature_layer.feature.collection",{cache:o,signal:n},p)}var Vo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,Xo=(t,e,i)=>e in t?Vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$o=(t,e)=>{for(var i in e||(e={}))Yo.call(e,i)&&Xo(t,i,e[i]);if(Ko)for(var i of Ko(e))Qo.call(e,i)&&Xo(t,i,e[i]);return t},tn=(t,e)=>Go(t,Jo(e));function en(t){const e=$o({},No);Do(e,t);const i=$o({id:t.resourceId,fid:t.featureId},e);return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},i).then((e=>tn($o({},e),{toGeojson:()=>e.geom?ji.resolve(Ro(e)):en(tn($o({},t),{geom:!0,fields:null,extensions:null})).then((t=>{const i=t.geom;return Ro(tn($o({},e),{geom:i}))}))})))}var on=Object.defineProperty,nn=(t,e,i)=>((t,e,i)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class rn{constructor(t){this.options=t,nn(this,"name"),nn(this,"resourceId"),nn(this,"item"),nn(this,"_extent"),this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(){return this._extent?ji.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((t=>{const{minLat:e,minLon:i,maxLat:o,maxLon:n}=t.extent,r=[i,e,n,o];return this._extent=r,r}))}geoJson(){return this.item.geom?ji.resolve(Ro(this.item)):en({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((t=>(this.item.geom=t.geom,Ro(this.item))))}}function sn(t,e,i,o){return!!hn(t,e,i,cn)}function an(t,e,i,o){return hn(t,e,i,un)}function ln(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function hn(t,e=(t=>!!t),i="children",o,n){return o(t,"function"==typeof e?e:t=>Wt(t,e),i)}function cn(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(e(t))return t;const o=ln(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){const t=cn(n[r],e,i,o);if(t)return t}}function un(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{e(t)&&o.push(t);const r=ln(t,i);r&&(n=r)}for(let r=0;r<n.length;r++)n[r]&&un(n[r],e,i,o);return o}function pn(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(!e(t))return!1;const o=ln(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){if(!pn(n[r],e,i,o))return!1}return!0}var dn=Object.defineProperty,fn=(t,e,i)=>((t,e,i)=>e in t?dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class mn{constructor(t){fn(this,"item"),fn(this,"_children",[]),fn(this,"_parent"),this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?an(e,t,(t=>t.tree.getParent())):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return hn(this._children,t,(t=>t.tree.getChildren()),cn)}every(t){return!!hn(this._children,t,(t=>t.tree.getChildren()),pn)}some(t){return sn(this._children,t,(t=>t.tree.getChildren()))}all(t){return this.getDescendants(t)}getDescendants(t){return an(this._children,t,(t=>t.tree.getChildren()))}getChildren(){return[...this._children]}}var _n=Object.defineProperty,yn=(t,e,i)=>((t,e,i)=>e in t?_n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class gn{constructor(t,e,o){yn(this,"options"),yn(this,"emitter",new i),yn(this,"name"),yn(this,"item"),yn(this,"_blocked",!1),yn(this,"_container"),yn(this,"_value"),yn(this,"_removeEventsListener"),this.item=e,this.options=Object.assign({},o),this.name=t,this._value=this.getProperty()}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach((i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})}))}}_calculateBlockedStatus(t){const e=t.some((t=>{var e;const i=null==(e=t.properties)?void 0:e.property(this.name);return!!i&&!i.get()}));return e}}var vn=Object.defineProperty,bn=Object.getOwnPropertySymbols,wn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Ln=(t,e,i)=>e in t?vn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pn=(t,e)=>{for(var i in e||(e={}))wn.call(e,i)&&Ln(t,i,e[i]);if(bn)for(var i of bn(e))xn.call(e,i)&&Ln(t,i,e[i]);return t};const On=class t extends gn{constructor(e,i,o){super(e,i,Pn(Pn({},t.options),o)),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every((t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()}))}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1,this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach((e=>this._blockChild(e,t)))}unblockChild(t){this.item.tree.getChildren().forEach((e=>this._unBlockChild(e,t)))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const n=i[o],r=n.properties&&n.properties.property(this.name);r&&r.set(t,Pn(Pn({},e),{propagation:!0,bubble:!1}))}}}};Ln(On,"options"+"",{hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"});let Cn=On;var Mn=Object.defineProperty,kn=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Tn=(t,e,i)=>e in t?Mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,In=(t,e,i)=>Tn(t,"symbol"!=typeof e?e+"":e,i);const Sn=class t{constructor(t,e){this.item=t,In(this,"options",{}),In(this,"_properties",{}),In(this,"_propertiesList",[]),e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach((t=>t.update()))}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map((t=>this._properties[t]))}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i=((t,e)=>{for(var i in e||(e={}))An.call(e,i)&&Tn(t,i,e[i]);if(kn)for(var i of kn(e))En.call(e,i)&&Tn(t,i,e[i]);return t})({},t);this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(e){const i=e.handler;return!i&&e.type?"boolean"===e.type?t.handlers.CheckProperty:t.handlers.BaseProperty:i}};In(Sn,"handlers",{CheckProperty:Cn});let zn=Sn;var jn=Object.defineProperty,Bn=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Rn=(t,e,i)=>e in t?jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Dn=(t,e,i)=>Rn(t,"symbol"!=typeof e?e+"":e,i);let Fn=0;class Un{constructor(t){Dn(this,"options",{}),Dn(this,"properties"),Dn(this,"tree"),Dn(this,"id",Fn),Fn+=1,this.options=((t,e)=>{for(var i in e||(e={}))Zn.call(e,i)&&Rn(t,i,e[i]);if(Bn)for(var i of Bn(e))Nn.call(e,i)&&Rn(t,i,e[i]);return t})({},t),this.tree=new mn(this)}initProperties(){this.properties=new zn(this,this.options.properties)}}var Wn=Object.defineProperty,Hn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,Gn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Kn=(t,e,i)=>e in t?Wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Yn=(t,e)=>{for(var i in e||(e={}))Gn.call(e,i)&&Kn(t,i,e[i]);if(Vn)for(var i of Vn(e))Jn.call(e,i)&&Kn(t,i,e[i]);return t},Qn=(t,e)=>Hn(t,qn(e));function Xn(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,n=t.extent_right;if(e&&i&&o&&n){const t=[i,e,n,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function $n({resourceId:t,connector:e,cache:i=!0}){return e.get("layer.extent",{cache:i},{id:t}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}function tr(t){return t.connector.getResource(t.resourceId).then((e=>{if(e)return er(e,t.connector,t)}))}function er(t,e,i){if(t.webmap)return ji.resolve(Xn(t.webmap));{const o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((t=>{if(t)return $n(Qn(Yn({},i),{resourceId:t.resource.id,connector:e}))})):$n(Qn(Yn({},i),{resourceId:o.id,connector:e}))}}var ir=Object.defineProperty,or=(t,e,i)=>((t,e,i)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),nr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class rr{constructor(){or(this,"item"),or(this,"connector"),or(this,"_extent")}getExtent(){return nr(this,null,(function*(){return this.getBounds()}))}getBounds(t){return nr(this,null,(function*(){return this._extent?this._extent:this.item?(this._extent=yield er(this.item,this.connector,t),this._extent):void 0}))}}var sr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ar(t,e){return sr(this,null,(function*(){const i=t.resource,o=i;let{keyname:n,resourceId:r}=t;if(i&&("string"==typeof i?n=i:r="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:yield ar(i,e)),!r&&n){const t=yield e.getResource(n);t&&(r=t.resource.id)}return r}))}const lr={tms:"TILE"};var hr=Object.defineProperty,cr=Object.getOwnPropertySymbols,ur=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,dr=(t,e,i)=>e in t?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fr=(t,e)=>{for(var i in e||(e={}))ur.call(e,i)&&dr(t,i,e[i]);if(cr)for(var i of cr(e))pr.call(e,i)&&dr(t,i,e[i]);return t},mr=(t,e,i)=>dr(t,"symbol"!=typeof e?e+"":e,i);const _r="https://qms.nextgis.com";function yr(t,e=_r,i={}){let o;if("webMap"in t){const n=t,{webMap:r,url:s}=n,a=((t,e)=>{var i={};for(var o in t)ur.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&cr)for(var o of cr(t))e.indexOf(o)<0&&pr.call(t,o)&&(i[o]=t[o]);return i})(n,["webMap","url"]);o=r,s&&(e=s),a&&(i=a)}else o=t;e||(e=_r);class n{constructor(t,e){mr(this,"qms"),mr(this,"options"),mr(this,"map"),this.map=t;const o=fr(fr({},i),e);this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}addLayer(t){return i=this,r=null,s=function*(){if(!this.qms&&t.qmsId)try{this.qms=yield function(t){return new Promise(((e,i)=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(4===o.readyState&&200===o.status&&o.responseText)try{e(JSON.parse(o.responseText))}catch(t){i(t)}},o.open("GET",A(t),!0),o.send()}))}(e+"/api/v1/geoservices/"+t.qmsId)}catch(a){console.error(a)}const i=this.qms;if(i){const e=lr[i.type||"tms"],a=o.mapAdapter.layerAdapters[e];if(a&&(r=n,s=a,["showLayer","hideLayer"].forEach((t=>{const e=Object.getOwnPropertyDescriptor(s.prototype,t);e&&Object.defineProperty(r.prototype,t,e)})),"TILE"===e)){if(t=fr(fr({order:0,maxZoom:o.options.maxZoom,minZoom:o.options.minZoom},this.options),function(t){const e=("https:"===location.protocol?"https":"http")+"://";let i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}(i)),i.origin_url){const[e,o]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,((t,i)=>("string"==typeof i&&i.split(",").forEach((t=>e.push(t))),"{s}"))),e]}(i.origin_url);o.length&&(t.subdomains=o,t.url=e)}return this.options=t,new a(this.map,t).addLayer(t)}}var r,s},new Promise(((t,e)=>{var o=t=>{try{a(s.next(t))}catch(i){e(i)}},n=t=>{try{a(s.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,n);a((s=s.apply(i,r)).next())}));var i,r,s}}return n}var gr=Object.defineProperty,vr=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable,xr=(t,e,i)=>e in t?gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Lr=(t,e)=>{for(var i in e||(e={}))br.call(e,i)&&xr(t,i,e[i]);if(vr)for(var i of vr(e))wr.call(e,i)&&xr(t,i,e[i]);return t},Pr=(t,e,i)=>xr(t,"symbol"!=typeof e?e+"":e,i);class Or{constructor(t){Pr(this,"options",{url:"https://qms.nextgis.com"}),Pr(this,"url"),this.options=Lr(Lr({},this.options),t),this.url=this.options.url}getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return yr({webMap:t,url:this.url})}}Pr(Or,"utils",{createQmsAdapter:yr});var Cr=Object.defineProperty,Mr=Object.defineProperties,kr=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertySymbols,Er=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Sr=Reflect.get,zr=(t,e,i)=>e in t?Cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jr=(t,e)=>{for(var i in e||(e={}))Tr.call(e,i)&&zr(t,i,e[i]);if(Ar)for(var i of Ar(e))Ir.call(e,i)&&zr(t,i,e[i]);return t},Br=(t,e)=>Mr(t,kr(e)),Zr=(t,e,i)=>Sr(Er(t),i,e),Nr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function Rr(t){let e;for(e in t){const i=t[e];if(k(i)){const o=i;if(p(o.year)&&p(o.month)&&p(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach((t=>{i.push(t)})),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}var Dr=Object.defineProperty,Fr=Object.defineProperties,Ur=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertySymbols,Hr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Vr=(t,e,i)=>e in t?Dr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Gr=(t,e)=>{for(var i in e||(e={}))Hr.call(e,i)&&Vr(t,i,e[i]);if(Wr)for(var i of Wr(e))qr.call(e,i)&&Vr(t,i,e[i]);return t},Jr=(t,e)=>Fr(t,Ur(e));function Kr(t){const e=t.filters;return e?Fo(Jr(Gr({},t),{filters:e})).then((i=>{var o;return(null!=(o=t.clientFilterValidate)?o:Yr(e))&&(i=i.filter((t=>Wt(Rr(Jr(Gr({},t.fields),{id:t.id})),e)))),i})):qo(t)}function Yr(t){if("any"===t[0])return!0;for(let e=1;e<t.length;e++){const i=t[e];if("[object Array]"===Object.prototype.toString.call(i)){if(Yr(i))return!0}}return!1}function Qr(t){return function(t){return Kr(t).then((t=>{const e=[];return t.forEach((t=>{e.push(Ro(t))})),e}))}(t).then((t=>({type:"FeatureCollection",features:t})))}const Xr=["fields","intersects","limit","orderBy","strategy"];function $r(t){const e={};return Xr.forEach((i=>{const o=t[i];void 0!==o&&(e[i]=o)})),e}var ts=Object.defineProperty,es=Object.defineProperties,is=Object.getOwnPropertyDescriptors,os=Object.getOwnPropertySymbols,ns=Object.getPrototypeOf,rs=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,as=Reflect.get,ls=(t,e,i)=>e in t?ts(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,hs=(t,e)=>{for(var i in e||(e={}))rs.call(e,i)&&ls(t,i,e[i]);if(os)for(var i of os(e))ss.call(e,i)&&ls(t,i,e[i]);return t},cs=(t,e)=>es(t,is(e)),us=(t,e,i)=>ls(t,"symbol"!=typeof e?e+"":e,i),ps=(t,e,i)=>as(ns(t),i,e),ds=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function fs(t){return ds(this,null,(function*(){var e,o;const{item:n,webMap:r,Adapter:s,connector:a,layerOptions:l,addLayerOptionsPriority:h}=t,c=null==h||h,u=l,p=s||l.Adapter||r.mapAdapter.layerAdapters.GEOJSON,d=[];let f,m,y=!1;const g=yield ar(u,a);(null==(o=null==(e=u.adapterOptions)?void 0:e.popupOptions)?void 0:o.fromProperties)&&(u.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}}));else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,n));const v=(t,e)=>ds(this,null,(function*(){return w(),f={filters:t,options:e},m=Qr(hs({resourceId:g,filters:t,connector:a,cache:!0},e)),yield m}));let b=!1;const w=()=>{m&&(m.cancel(),m=void 0)};class x extends p{constructor(){super(...arguments),us(this,"emitter",new i),us(this,"__onMapMove"),us(this,"__onMapMoveStart"),us(this,"__enableMapMoveListener"),us(this,"__disableMapMoveListener")}addLayer(t){return ds(this,null,(function*(){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==u.id&&(t.id=u.id),n&&n.vector_layer&&(t.type=Ys[n.vector_layer.geometry_type]),u.adapterOptions&&(t=c?hs(hs({},u.adapterOptions),t):hs(hs({},t),u.adapterOptions)),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const o=t.strategy||void 0;this.options.strategy=o;const r=ps(x.prototype,this,"addLayer").call(this,t);let s;return f={filters:t.propertiesFilter,options:$r(t)},e&&(s=this.updateLayer()),i&&s&&(yield s),o&&o.startsWith("BBOX")&&!y&&this._addBboxEventListener(),r}))}getExtent(){return this.getBounds()}getBounds(){return ds(this,null,(function*(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?tr({connector:a,resourceId:n.resource.id}):ps(x.prototype,this,"getBounds")?ps(x.prototype,this,"getBounds").call(this):void 0}))}beforeRemove(){b=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,w()}getCount(){return function({connector:t,resourceId:e,cache:i=!0}){return t.get("feature_layer.feature.count",{cache:i},{id:e}).then((t=>t.total_count))}({connector:a,resourceId:g,cache:!0})}updateLayer(t){return ds(this,null,(function*(){var e;if(t=t||f||{},null==(e=this.options.strategy)?void 0:e.startsWith("BBOX")){yield r.onLoad("create"),t.options=t.options||{},t.options.intersects=r.getBounds();const{minZoom:e,maxZoom:i}=this.options,o=r.getZoom();if(void 0!==o){if(void 0!==e&&o<e)return;if(void 0!==i&&o>i)return;if(y)return}}if(!b){try{this.emitter.emit("preupdate",t),r._emitLayerEvent("layer:preupdate",u.id||"",t);const e=yield v(t.filters,cs(hs({},t.options),{srs:this.options.srs}));let i=e;const o=yield this.getCount();if("BBOX+"===this.options.strategy){i={type:"FeatureCollection",features:[]};for(const t of e.features)-1===d.indexOf(String(t.id))&&(d.push(String(t.id)),i.features.push(t));y=void 0!==o&&d.length>=o,yield r.addLayerData(this,i)}else y=void 0!==o&&e.features.length>=o,yield r.setLayerData(this,e);this.emitter.emit("updated",e),r._emitLayerEvent("layer:updated",u.id||"",{data:e,newData:i,isFull:y})}catch(i){if(i instanceof Error&&"CancelError"!==i.name)throw i}ps(x.prototype,this,"updateLayer")&&ps(x.prototype,this,"updateLayer").call(this)}}))}propertiesFilter(t,e){return ds(this,null,(function*(){if(w(),this.filter&&y)this.filter((e=>{const i=e.feature&&e.feature.properties&&Rr(hs({},e.feature.properties));return!i||Wt(i,t)}));else if(this.setData){this.clearLayer&&this.clearLayer();const i=yield v(t,cs(hs({},e),{srs:this.options.srs}));this.setData(i)}}))}removeFilter(){f=void 0,this.propertiesFilter([]),this.filter&&this.filter((()=>!0))}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},r.emitter.on("layer:show",this.__enableMapMoveListener),r.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&r.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&r.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=_((()=>this.updateLayer())),this.__onMapMoveStart=w,r.emitter.on("movestart",this.__onMapMoveStart),r.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&r.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&r.emitter.removeListener("movestart",this.__onMapMoveStart)}}return x}))}var ms=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function _s({options:t,webMap:e,baseUrl:i}){var o;let n,r=t.adapter||"IMAGE";const s=e&&e.getLayerAdapters(),a=t.resource,l=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===r){if(!s||s.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const n=e+"/api/component/render/image",r={resource:t};return i&&(r.nd=i),{url:n,resourceId:t,headers:o,params:r,updateWmsParams:e=>(i&&(e.nd=i),Ks(e,t))}}({resourceId:a,headers:t.headers,nd:l,baseUrl:i});r="TILE"}if("WMS"===r){n=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:n,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===r)return n=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!=(o=t.simplification)?o:6),{url:n,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===r)return n=i+`/api/resource/${a}/terrain_provider`,{url:n,adapter:r};if("MODEL_3D"===r)return n=i+`/api/component/model_3d/${a}/data.glb`,{url:n};if("TILE"===r)return n=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+l,{url:n,adapter:r}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}var ys=Object.defineProperty,gs=Object.defineProperties,vs=Object.getOwnPropertyDescriptors,bs=Object.getOwnPropertySymbols,ws=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,Ls=(t,e,i)=>e in t?ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ps=(t,e)=>{for(var i in e||(e={}))ws.call(e,i)&&Ls(t,i,e[i]);if(bs)for(var i of bs(e))xs.call(e,i)&&Ls(t,i,e[i]);return t},Os=(t,e)=>gs(t,vs(e)),Cs=(t,e,i)=>Ls(t,"symbol"!=typeof e?e+"":e,i),Ms=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ks(t){return Ms(this,arguments,(function*({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.cls;let r=t.adapter||n&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[n]||"IMAGE";if(void 0!==r&&(t.adapter=r),"IMAGE"===r){const t=e.getLayerAdapters();!t||t.IMAGE||(r="TILE")}const s=e.mapAdapter.layerAdapters[r];if(s){const n=yield ar(t,i);return class extends s{constructor(r,s){super(r,s),this.map=r,Cs(this,"item",o),Cs(this,"resourceId",n);const a=_s({options:t,webMap:e,baseUrl:i.options.baseUrl||""});if(a){const e=Os(Ps(Ps({},a),t.adapterOptions),{params:{resource:n},layers:a.layers||String(n),resourceId:n});t.adapterOptions&&p(t.adapterOptions.setViewDelay)&&(e.setViewDelay=t.adapterOptions.setViewDelay),this.options=Ps(Ps({},this.options),e)}}addLayer(t){return super.addLayer(Ps(Ps({},this.options),t))}getLegend(t){return Ms(this,null,(function*(){const e=yield i.get("render.legend_symbols",Ps({params:{id:n},cache:!0},t)),o=this.options.id;if(void 0!==o){return[{layerId:o,legend:e.map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}return[]}))}getIdentificationIds(){return Ms(this,null,(function*(){if(this.item){if("MVT"===r)return[this.item.resource.id];const t=this.item.resource.parent.id;if(p(t))return[t]}return[]}))}}}throw new Error(r+" not supported yet. Only TILE")}))}var As=Object.defineProperty,Es=Object.defineProperties,Ts=Object.getOwnPropertyDescriptors,Is=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,zs=Object.prototype.propertyIsEnumerable,js=(t,e,i)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bs=(t,e)=>{for(var i in e||(e={}))Ss.call(e,i)&&js(t,i,e[i]);if(Is)for(var i of Is(e))zs.call(e,i)&&js(t,i,e[i]);return t},Zs=(t,e)=>Es(t,Ts(e)),Ns=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Rs={},Ds=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Fs(t){return Ns(this,arguments,(function*({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.id,r=yield i.getResourceChildren(n),s=r&&r[0];if(s)return Us(Zs(Bs({},t),{resource:s.resource.id}),e,i)}))}function Us(t,e,i){return Ns(this,null,(function*(){let o,n;const r=t.adapter,s=yield ar(t,i);if(s){const a=t.resource;if(n=a&&a.resource&&void 0!==a.resource.id?a:yield i.getResource(s),!n)throw"Resource item is not found";{const a=n.resource.cls,l={layerOptions:Zs(Bs({},t),{resource:s}),connector:i,webMap:e,item:n};if(-1!==Ds.indexOf(a))if("webmap"===a)o=function(t){return ms(this,arguments,(function*({layerOptions:t,webMap:e,connector:i}){const o=yield ar(t,i);return class extends Ta{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}}))}(l);else if("vector_layer"===a||"postgis_layer"===a){const e=l.layerOptions.adapterOptions||{};if(e.type=e.type||n.vector_layer&&Ys[n.vector_layer.geometry_type],l.layerOptions.adapterOptions=e,t.adapterOptions=l,void 0!==r&&"GEOJSON"!==r){if("MVT"!==r)return Fs(l);o=ks(l)}else o=fs(l)}else{if("raster_layer"===a)return Fs(l);if("basemap_layer"===a)o=function(t){return Nr(this,arguments,(function*({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer.qms,o=e.basemap_layer.url;if(i){const e=JSON.parse(i);return Promise.resolve(Or.utils.createQmsAdapter(t,void 0,{qms:e,baselayer:!0}))}if(o){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{addLayer(e){return Nr(this,null,(function*(){return Zr(t.prototype,this,"addLayer").call(this,Br(jr({},e),{url:o}))}))}}return t}}}}))}(l);else if("GEOJSON"===r){const e=yield i.getResource(n.resource.parent.id);if(e){const i=Zs(Bs({},t),{resource:n.resource.parent.id});o=fs(Zs(Bs({},l),{item:e,layerOptions:i}))}}else o=ks(l)}else{if(!Rs[a])throw`Resource class '${a}' not yet supported.`;{const t=Rs[a];let e;e=r&&"function"!=typeof e?t[r]:t,e&&(o=e(l))}}}}if(o)return o.then((t=>{if(t){const e=t;return n&&(e.prototype.item=n,e.prototype.resourceId=n.resource.id,e.prototype.connector=i),u(e,[rr],{replace:!1}),e}}))}))}var Ws=Object.defineProperty,Hs=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,Vs=Object.prototype.propertyIsEnumerable,Gs=(t,e,i)=>e in t?Ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Js=(t,e)=>{for(var i in e||(e={}))qs.call(e,i)&&Gs(t,i,e[i]);if(Hs)for(var i of Hs(e))Vs.call(e,i)&&Gs(t,i,e[i]);return t};function Ks(t,e){const{bbox:i,width:o,height:n,nd:r}=t;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:o+","+n,timestamp:Date.now(),nd:null!=r?r:200}}const Ys={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let Qs;function Xs(t,e=0){const i=e,o=function(){if(void 0===Qs){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),Qs=e}return Qs}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t,n=function(t){return Math.log(t/256)/Math.LN2}(o);return n}var $s=Object.defineProperty,ta=Object.defineProperties,ea=Object.getOwnPropertyDescriptors,ia=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,na=Object.prototype.propertyIsEnumerable,ra=(t,e,i)=>e in t?$s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,sa=(t,e)=>{for(var i in e||(e={}))oa.call(e,i)&&ra(t,i,e[i]);if(ia)for(var i of ia(e))na.call(e,i)&&ra(t,i,e[i]);return t},aa=(t,e)=>ta(t,ea(e)),la=(t,e,i)=>ra(t,"symbol"!=typeof e?e+"":e,i),ha=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const ca=class t extends Un{constructor(e,o,n,r,s,a){if(super(sa(sa({},t.options),n)),this.webMap=e,la(this,"item"),la(this,"connector"),la(this,"layer"),la(this,"emitter",new i),la(this,"_rootDescendantsCount",0),r&&(this.connector=r),s&&this.tree.setParent(s),this.item=o,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),a||this._init(o)}static create(e,i,o,n,r){return ha(this,null,(function*(){const s=new t(e,i,o,n,r,!0);return yield s._init(i),s}))}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}getLegend(t){return ha(this,null,(function*(){var e;const i=null==(e=this.layer)?void 0:e.id;if(void 0!==i){const e=this.connector;if(e){return[{layerId:i,legend:(yield e.get("render.legend_symbols",sa({params:{id:this.item.resourceId},cache:!0},t))).map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}}return[]}))}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o=aa(sa({visibility:!1,name:t.display_name},this.options),{params:{resource:this.item.resourceId,item:this.item}});if(this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,aa(sa({updateWmsParams:t.updateWmsParams},this.options),{url:t.url,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable}))}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return Xs(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor(this.webMap,t,this.options,this.connector,this);this.tree.addChild(e)}}return Promise.resolve()}initLayerItem(e){const i=this.getItemOptions(e),o=t=>{e._layer=t,this.layer=t;this.properties.get("visibility")&&this.properties.set("visibility",!0),void 0!==i.opacity&&this.webMap.setLayerOpacity(t,i.opacity)};let n;if("layer"===e.item_type)n=e.adapter||e.layer_adapter.toUpperCase();else if(t.GetAdapterFromLayerType[e.item_type]){n=(0,t.GetAdapterFromLayerType[e.item_type])(e,i,this.webMap,this.connector)}return n?this.webMap.addLayer(n,i).then((t=>{o(t)})):e._layer?Promise.resolve(o(e._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,n=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,r=[e,o].filter(Boolean),s=[i,n].filter(Boolean);return{minZoom:r.length?Math.max(...r):void 0,maxZoom:s.length?Math.min(...s):void 0}}_init(t){this.initItem(t).then((()=>{this.emitter.emit("init")}))}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}};la(ca,"GetAdapterFromLayerType",{}),la(ca,"options",{properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return sn(t.item,(t=>"layer_enabled"in t&&t.layer_enabled),(t=>t.children));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends gn{getProperty(){const t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce(((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)}),1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]});let ua=ca;var pa=Object.defineProperty,da=Object.getOwnPropertySymbols,fa=Object.prototype.hasOwnProperty,ma=Object.prototype.propertyIsEnumerable,_a=(t,e,i)=>e in t?pa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ya=(t,e)=>{for(var i in e||(e={}))fa.call(e,i)&&_a(t,i,e[i]);if(da)for(var i of da(e))ma.call(e,i)&&_a(t,i,e[i]);return t},ga=(t,e,i)=>_a(t,"symbol"!=typeof e?e+"":e,i),va=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ba(t){return e=this,i=arguments,o=function*({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:n="first-show-adapter"}){const r=function(t){return va(this,arguments,(function*({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){ga(this,"options",{}),ga(this,"layer",[]),ga(this,"_removed",!1),ga(this,"_creatingInProgress",!1)}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}showLayer(){return va(this,null,(function*(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)yield t.showLayer(e);else yield this.loadLayer()}))}hideLayer(){return va(this,null,(function*(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)yield t.hideLayer(e)}))}loadLayer(){return va(this,null,(function*(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const n=yield o(this);if(n){const o=new n(t.mapAdapter.map,ya({},e)),r=yield o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=r,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&(yield t.showLayer(o)),this._creatingInProgress=!1}}return this.layer}))}}}))}({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=n+"-"+i.resource_id},createAdapter:()=>Us({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)});return r},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}var wa=Object.defineProperty,xa=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Ca=Object.prototype.propertyIsEnumerable,Ma=(t,e,i)=>e in t?wa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ka=(t,e)=>{for(var i in e||(e={}))Oa.call(e,i)&&Ma(t,i,e[i]);if(Pa)for(var i of Pa(e))Ca.call(e,i)&&Ma(t,i,e[i]);return t},Aa=(t,e,i)=>Ma(t,"symbol"!=typeof e?e+"":e,i),Ea=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class Ta{constructor(t,e){this.map=t,this.options=e,Aa(this,"layer"),Aa(this,"NgwWebmapItem",ua),Aa(this,"pixelRadius",10),Aa(this,"resourceId"),Aa(this,"webmapClassName","webmap"),Aa(this,"emitter",new i),Aa(this,"_extent"),Aa(this,"response"),Aa(this,"_webmapBaselayersIds",[]),Aa(this,"_lastActiveBaselayer");const o=e.resourceId;if(Array.isArray(o)?(this.resourceId=o[0],this.options.id=o[1]):this.resourceId=o,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}addLayer(t){return Ea(this,null,(function*(){var e,i;this.options=ka(ka({},this.options),t),this.layer=yield this._getWebMapLayerItem();const o=null==(i=null==(e=this.response)?void 0:e.webmap)?void 0:i.extent_constrained;return this.options.useExtentConstrained&&this._extent&&o&&this.options.webMap.setView({maxBounds:this._extent}),this.layer}))}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((e=>{"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response}showLayer(){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)}))}hideLayer(){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)}))}setOpacity(t){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)}))}getExtent(){return this.getBounds()}getBounds(){const t=this.response&&this.response.webmap;if(t)return Xn(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id}fetchBookmarks(){const t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((i=>{var o;const n=null==(o=i.feature_layer)?void 0:o.fields.find((t=>t.label_field)),r=n&&n.keyname;return Kr({connector:e,resourceId:t,geom:!1,fields:r?[r]:void 0}).then((i=>{const o=[];for(const n of i){const i=new rn({item:n,resourceId:t,labelField:r,connector:e});o.push(i)}return o}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}getLegend(){return Ea(this,null,(function*(){const t=[];let e=this.getDependLayers();e=e.sort(((t,e)=>e.id-t.id));for(const i of e){const e=yield i.getLegend();t.push(...e)}return t}))}getIdentificationIds(){return Ea(this,null,(function*(){const t=[];let e=this.getDependLayers();return e=e.sort(((t,e)=>e.id-t.id)),e.forEach((e=>{const i=e.item,o=i.style_parent_id;if(void 0!==o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}})),t}))}_getWebMapLayerItem(){return Ea(this,null,(function*(){if(!this.resourceId)return;const t=yield this.getWebMapConfig(this.resourceId);return t&&t.root_item?new Promise((e=>{const i=this.options.connector,o=(null==i?void 0:i.options.auth)?i.getAuthorizationHeaders():void 0,n=i.withCredentials,r=(s=ka({},this.options),xa(s,La({withCredentials:n,headers:o,drawOrderEnabled:t.draw_order_enabled})));var s;const a=new this.NgwWebmapItem(this.options.webMap,t.root_item,r,i);a.emitter.on("init",(()=>{e(a)}))})):void 0}))}getWebMapConfig(t){return Ea(this,null,(function*(){const e=yield this.options.connector.getResource(t);if(e){this.response=e;const t=e[this.webmapClassName];if(this._setupBaselayers(e),t)return this._extent=[t.extent_left,t.extent_bottom,t.extent_right,t.extent_top],this._updateItemsParams(t.root_item,this.options.webMap,e),t}}))}_setupBaselayers(t){var e;const i=this.options.webMap;if(null==(e=this.options.useBasemap)||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)ba({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then((t=>{const n=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:"webmap-baselayer"+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:n}).then((t=>{t.id&&this._webmapBaselayersIds.push(t.id)}))}))}_updateItemsParams(t,e,i){if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((t=>this._updateItemsParams(t,e,i)))),"root"===t.item_type&&(t.display_name=i.resource.display_name);else if("layer"===t.item_type){const i=A(this.options.connector.options.baseUrl+"/api/component/render/image"),o=t.layer_style_id;t.url=i,t.resourceId=o,t.updateWmsParams=t=>Ks(t,o);const n=_s({options:{adapter:t.layer_adapter.toUpperCase(),resource:o},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=ka(ka({},t),n)}return t}}var Ia=Object.defineProperty,Sa=Object.getOwnPropertySymbols,za=Object.prototype.hasOwnProperty,ja=Object.prototype.propertyIsEnumerable,Ba=(t,e,i)=>e in t?Ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Za=(t,e)=>{for(var i in e||(e={}))za.call(e,i)&&Ba(t,i,e[i]);if(Sa)for(var i of Sa(e))ja.call(e,i)&&Ba(t,i,e[i]);return t},Na=(t,e,i)=>Ba(t,"symbol"!=typeof e?e+"":e,i);class Ra{constructor(t){if(this.options=t,Na(this,"url"),Na(this,"connector"),Na(this,"webMap"),this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new ko({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){Rs[t]=e}onLoadSync(t){return e=this,i=null,o=function*(){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return yield t.addLayer(Ta,Za({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},e))}}},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends Ta{constructor(t,i){super(t,i=Js(Js({},e),i))}};var e}}var Da=Object.defineProperty,Fa=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,Wa=Object.prototype.propertyIsEnumerable,Ha=(t,e,i)=>e in t?Da(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,qa=(t,e,i)=>Ha(t,"symbol"!=typeof e?e+"":e,i);class Va{constructor(t){qa(this,"id"),qa(this,"label"),qa(this,"layerId"),qa(this,"parent"),qa(this,"fields"),qa(this,"geom"),qa(this,"extensions"),qa(this,"connector"),qa(this,"_item"),qa(this,"_geojson"),qa(this,"_resource"),qa(this,"_extent");const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?ji.resolve(this._item):en(((t,e)=>{for(var i in e||(e={}))Ua.call(e,i)&&Ha(t,i,e[i]);if(Fa)for(var i of Fa(e))Wa.call(e,i)&&Ha(t,i,e[i]);return t})({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then((t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t)))}resource(){return this._resource?ji.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((t=>(this._resource=t,this._resource.feature_layer)))}getBounds(){return this._extent?ji.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0}){return i.get("feature_layer.feature.item_extent",{cache:o},{id:t,fid:e}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}({connector:this.connector,featureId:this.id,resourceId:this.layerId})}geojson(){return this._geojson?ji.resolve(this._geojson):this.identify().then((t=>t.toGeojson().then((t=>(this._geojson=t,t)))))}}function Ga(t){return en(t).then((t=>Ro(t)))}var Ja=Object.defineProperty,Ka=Object.defineProperties,Ya=Object.getOwnPropertyDescriptors,Qa=Object.getOwnPropertySymbols,Xa=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,tl=(t,e,i)=>e in t?Ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,el=(t,e)=>{for(var i in e||(e={}))Xa.call(e,i)&&tl(t,i,e[i]);if(Qa)for(var i of Qa(e))$a.call(e,i)&&tl(t,i,e[i]);return t},il=(t,e)=>Ka(t,Ya(e));function ol(t,e=!1){const i=[],o=[];for(const r in t){const t=Number(r);isNaN(t)||i.push(t)}const n=t.resources;n&&i.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)));for(let r=0;r<i.length;r++){const n=i[r],s=t[n];if("features"in s){const t=nl(s.features,Number(n),e);if(t.length&&(o.push(...t),!e))break}}return o}function nl(t,e,i){const o=[];for(const n of t){if(o.push({featureId:n.id,resourceId:e,feature:n}),!i)break}return o}function rl(t){const{geom:e,signal:i,cache:o,layers:n}=t,r="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null==(e=t.geometry)?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map((([t,e])=>{const[i,o]=P(t,e);return`${i} ${o}`})).join(",")}))`}(e);if(!r)throw new Error("Not valid geometry format to make intersection");return t.connector.post("feature_layer.identify",{data:{geom:r,srs:3857,layers:n},signal:i,cache:o})}function sl(t,e){return i=this,o=null,n=function*(){var i;const o=yield t.get("pyramid.settings",null,{component:"pyramid"});if(o&&o.company_logo&&o.company_logo.enabled){const r=document.createElement("a");r.style.position="absolute",r.style.bottom="0",r.style.right="0",r.style.padding=null!=(i=null==e?void 0:e.padding)?i:"10px",r.className="ngw-map-logo",e&&e.cssClass&&(r.className+=" "+e.cssClass);const s=new Image;s.style.maxHeight="100px",s.style.maxWidth="100px",s.src="";try{const e=yield t.get("pyramid.company_logo",{responseType:"blob"}),i=(window.URL||window.webkitURL).createObjectURL(e);s.src=i}catch(n){console.warn(n)}return null!==o.company_logo.link&&""!==o.company_logo.link.trim()&&(r.href=o.company_logo.link,r.target="_blank",-1!==o.company_logo.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),r.appendChild(s),r}},new Promise(((t,e)=>{var r=t=>{try{a(n.next(t))}catch(i){e(i)}},s=t=>{try{a(n.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((n=n.apply(i,o)).next())}));var i,o,n}var al=Object.defineProperty,ll=(t,e,i)=>((t,e,i)=>e in t?al(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class hl{constructor(){ll(this,"backspace",8),ll(this,"tab",9),ll(this,"enter",13),ll(this,"shift",16),ll(this,"ctrl",17),ll(this,"alt",18),ll(this,"pause/break",19),ll(this,"caps_lock",20),ll(this,"escape",27),ll(this,"page_up",33),ll(this,"page_down",34),ll(this,"end",35),ll(this,"home",36),ll(this,"left_arrow",37),ll(this,"up_arrow",38),ll(this,"right_arrow",39),ll(this,"down_arrow",40),ll(this,"insert",45),ll(this,"delete",46),ll(this,"left_window_key",91),ll(this,"right_window_key",92),ll(this,"select_key",93),ll(this,"numpad_0",96),ll(this,"numpad_1",97),ll(this,"numpad_2",98),ll(this,"numpad_3",99),ll(this,"numpad_4",100),ll(this,"numpad_5",101),ll(this,"numpad_6",102),ll(this,"numpad_7",103),ll(this,"numpad_8",104),ll(this,"numpad_9",105),ll(this,"multiply",106),ll(this,"add",107),ll(this,"subtract",109),ll(this,"decimal_point",110),ll(this,"divide",111),ll(this,"f1",112),ll(this,"f2",113),ll(this,"f3",114),ll(this,"f4",115),ll(this,"f5",116),ll(this,"f6",117),ll(this,"f7",118),ll(this,"f8",119),ll(this,"f9",120),ll(this,"f10",121),ll(this,"f11",122),ll(this,"f12",123),ll(this,"num_lock",144),ll(this,"scroll_lock",145),ll(this,"semi-colon",186),ll(this,"equal_sign",187),ll(this,",",188),ll(this,"-",189),ll(this,".",190),ll(this,"/",191),ll(this,"`",192),ll(this,"[",219),ll(this,"\\",220),ll(this,"]",221),ll(this,"'",222)}}var cl=Object.defineProperty,ul=(t,e,i)=>((t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);var pl=Object.defineProperty,dl=(t,e,i)=>((t,e,i)=>e in t?pl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class fl{constructor(t,e){this.webMap=t,dl(this,"name"),dl(this,"event"),dl(this,"value"),e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}var ml=Object.defineProperty,_l=(t,e,i)=>((t,e,i)=>e in t?ml(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class yl extends fl{constructor(){super(...arguments),_l(this,"name","center"),_l(this,"event","moveend")}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}var gl=Object.defineProperty,vl=(t,e,i)=>((t,e,i)=>e in t?gl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class bl extends fl{constructor(){super(...arguments),vl(this,"name","zoom"),vl(this,"event","zoomend")}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}var wl=Object.defineProperty,xl=(t,e,i)=>((t,e,i)=>e in t?wl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ll=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));let Pl=0;const Ol={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},Cl=class t{constructor(e){xl(this,"options",Ol),xl(this,"emitter",new i),xl(this,"keys",t.keys),xl(this,"mapAdapter"),xl(this,"runtimeParams",[]),xl(this,"getPaintFunctions",t.getPaintFunctions),xl(this,"mapState",[yl,bl]),xl(this,"id",Pl++),xl(this,"_initMapState",{}),xl(this,"_starterKits"),xl(this,"_mapState",[]),xl(this,"_extent"),xl(this,"_eventsStatus",{}),xl(this,"_coordFromMapClickPromise"),xl(this,"_mapEvents",{}),this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=f(Ol||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}create(){return Ll(this,null,(function*(){return this.getEventStatus("create")||(yield this._setInitMapState(this.mapState),yield this._setupMap(),this._emitStatusEvent("create",this)),this}))}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:g(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&p(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),p(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return function(t){const[e,i,o,n]=t,r=e<o&&i<n;if(!r){console.log("Error: The extent coordinates are not in the correct order."),console.log(`Received extent: [${e}, ${i}, ${o}, ${n}]`);const t=[Math.min(e,o),Math.min(i,n),Math.max(e,o),Math.max(n,i)];console.log(`Expected order: [${t.join(", ")}]`)}const s=e>=-180&&o<=180,a=i>=-90&&n<=90;s&&a||console.log("Warning: The coordinates may not be within valid geographic ranges.")}(t),t.every((t=>p(t)))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},n=null==(i=this.mapAdapter.isLoaded)||i;this.mapAdapter.map&&n?o():this.mapAdapter.emitter.once("create",(()=>{o()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new ji(((t,e,i)=>{const o=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(o),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",r),this._coordFromMapClickPromise=void 0},r=e=>{n(),m(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",r),i(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}_addLayerProviders(){return Ll(this,null,(function*(){}))}_onLoadSync(){return Ll(this,null,(function*(){}))}_setupMap(){return Ll(this,null,(function*(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return yield this.mapAdapter.create(this.options),this._zoomToInitialExtent(),yield this._addLayerProviders(),yield this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}))}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),p(t.maxzoom)&&(this.options.zoom=t.maxzoom),p(t.minzoom)&&(this.options.zoom=t.minzoom),p(t.maxzoom)&&p(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&(this.fitBounds(i),void 0!==e&&this.setZoom(e))}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((i=>{i.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}};xl(Cl,"keys",new class{constructor(){ul(this,"keyCodeAlias",new hl),ul(this,"keys",{}),ul(this,"_windowOnFocus"),ul(this,"_keysPressed"),ul(this,"_keysReleased"),this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}}),xl(Cl,"getPaintFunctions");let Ml=Cl;function kl(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}const Al={polygon:"path",line:"path",point:"circle"},El={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function Tl(t){if(t.data){const e=El[function(t){let e;e="FeatureCollection"===t.type?kl(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?kl(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&it(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":Al[e]),t.type=t.type||e}return t}var Il=Object.defineProperty,Sl=Object.defineProperties,zl=Object.getOwnPropertyDescriptors,jl=Object.getOwnPropertySymbols,Bl=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable,Nl=(t,e,i)=>e in t?Il(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rl=(t,e)=>{for(var i in e||(e={}))Bl.call(e,i)&&Nl(t,i,e[i]);if(jl)for(var i of jl(e))Zl.call(e,i)&&Nl(t,i,e[i]);return t},Dl=(t,e)=>Sl(t,zl(e)),Fl=(t,e,i)=>Nl(t,"symbol"!=typeof e?e+"":e,i),Ul=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class Wl extends Ml{constructor(t){super(t),Fl(this,"_layersIdCounter",1),Fl(this,"_layersOrderCounter",1),Fl(this,"_baselayers",[]),Fl(this,"_layers",{}),Fl(this,"_selectedLayers",[]);const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}fitLayer(t,e){return Ul(this,null,(function*(){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=yield o.call(i);t&&this.fitBounds(t,e)}}))}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const i=this._layers[e];i&&t.push(i)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}addBaseLayer(t,e){return Ul(this,null,(function*(){return yield this.addLayer(t,Dl(Rl({},e),{baselayer:!0}),void 0)}))}addLayer(t){return Ul(this,arguments,(function*(t,e={},i){var o,n;const r=this._layersIdCounter++,s=p(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=yield t);const l=e;this._updateGeoJsonOptions(l);const h=null==(o=(e=Rl({id:String(r),order:s},e)).visibility)||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options=Rl(Rl({},e),t.options),t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),yield this.onMapLoad(),t.map=this.mapAdapter.map;const o=yield t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(r),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!=(n=t.options.order)?n:s,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,l.filter&&this.filterLayer(t,l.filter),e.baselayer&&this._baselayers.push(i),h&&(yield this.showLayer(i)));const c=e.opacity;void 0!==c&&c<=1&&this.setLayerOpacity(t,c);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=yield u.call(t);e&&(yield this.fitBounds(e))}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")}))}addLayerFromAsyncAdapter(t,e,i){return Ul(this,null,(function*(){const o=i||void 0!==e.order?e.order:this.reserveOrder(),n=t(),r=yield n;return r?this.addLayer(r,e,o):Promise.reject("No adapter")}))}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}getLegend(t){return Ul(this,null,(function*(){const e=[];for(const i of this.orderedLayers())i.getLegend&&e.push(i.getLegend(t));return(yield Promise.all(e)).flat()}))}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=Tl(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",Dl(Rl({},e),{url:t}))}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",Dl(Rl({},e),{url:i}))}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),n=void 0!==e?e:!(o&&o.options.visibility),r=void 0!==i.silent&&i.silent,s=t=>Ul(this,null,(function*(){const e=String(t.id),i=n?"layer:show":"layer:hide";if(r||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)yield this.hideLayer(t)}t.showLayer?yield t.showLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.showLayer(t.layer)),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?yield t.hideLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.hideLayer(t.layer));t.options.visibility=n,r||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))}));return o?this.onMapLoad().then((()=>s(o))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null==(e=i.options.labelVisibility)||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||Wt(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let n=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(i)),n){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(t,e,i){const o=String(t);if(p(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}_onLayerClick(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}))}_onLayerDoubleClick(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:dblclick",t.layer.id||"",t),Promise.resolve(t)}))}_onLayerSelect(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}))}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onDoubleClick:n,onLayerClick:r,onMouseOut:s,onMouseOver:a}=t,l=o||r,h=n||r;t.onClick=t=>(l&&l(t),this._onLayerClick(t)),t.onDoubleClick=t=>(h&&h(t),this._onLayerDoubleClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),p(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;a&&a(t),p(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const c=e||i;t.onSelect=t=>(c&&c(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=$t({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=$t({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}var Hl=Object.defineProperty,ql=(t,e,i)=>((t,e,i)=>e in t?Hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Vl=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Gl=class t extends Wl{constructor(){super(...arguments),ql(this,"_loadControlQueue",{"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]}),ql(this,"_isControlLoading",{"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1})}addControl(t,e,i){return Vl(this,null,(function*(){let o;if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,i):t,o)return new Promise((t=>{this._setControlQueue(e,(()=>Vl(this,null,(function*(){const i=yield o,n=this.mapAdapter.addControl(i,e);t(n)}))))}))}))}createControl(t,e){return Vl(this,null,(function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}))}createButtonControl(t){return Vl(this,null,(function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}))}createToggleControl(t){return Vl(this,null,(function*(){return yield this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div");let o=!1;e.getStatus?o=e.getStatus():e.status&&(o=e.status);const n=e.title||"",r=e.html;function s(){n&&(i.title="string"==typeof n?n:o?n.on:n.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function l(){r&&("string"==typeof r||r instanceof HTMLElement?a(r):a(o?r.on:r.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach((t=>{e?i.classList.add(t):i.classList.remove(t)}))}function c(){e.addClassOn&&h(e.addClassOn,o),e.addClassOff&&h(e.addClassOff,!o)}s(),l(),e.addClass&&h(e.addClass,!0),c();const u=t=>{void 0!==t&&(o=t),l(),s(),c()},p=t=>{if(o=void 0!==t?t:!o,e.onClick){const t=e.onClick(o);Promise.resolve(t).then((()=>u())).catch((()=>o=!o))}else u()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=u,d}(this.mapAdapter.createButtonControl,t):void 0}))}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(e,i){const o=this.mapAdapter.controlAdapters[e];if(o)return new o(i);{const o=t.controls[e];if(o)return o(this,i)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}_applyControls(t){return Vl(this,null,(function*(){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];yield e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}))}};ql(Gl,"controls",{CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)});let Jl=Gl;const Kl={};var Yl=Object.getOwnPropertySymbols,Ql=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable,$l=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),th=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())})),eh=(t,e,i)=>(e=t[$l("asyncIterator")])?e.call(t):(t=t[$l("iterator")](),e={},i=(i,o)=>(o=t[i])&&(e[i]=e=>new Promise(((i,n,r)=>(e=o.call(t,e),r=e.done,Promise.resolve(e.value).then((t=>i({value:t,done:r})),n))))),i("next"),i("return"),e);class ih extends Jl{constructor(t){super(t),this._addControls(),Kl[this.id]=this}static get(t){return function(t){return Kl[t]}(t)}_addLayerProviders(){return th(this,null,(function*(){try{for(var t,e,i,o=eh(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.getLayerAdapters){const e=yield t.getLayerAdapters.call(t);if(e)try{for(var n,r,s,a=eh(e);n=!(r=yield a.next()).done;n=!1){const t=r.value,e=yield t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}catch(r){s=[r]}finally{try{n&&(r=a.return)&&(yield r.call(a))}finally{if(s)throw s[0]}}}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}}))}_onLoadSync(){return th(this,null,(function*(){try{for(var t,e,i,o=eh(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.onLoadSync)try{yield t.onLoadSync.call(t,this)}catch(n){console.error(n)}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}}))}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const o=i,{position:n}=o,r=((t,e)=>{var i={};for(var o in t)Ql.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Yl)for(var o of Yl(t))e.indexOf(o)<0&&Xl.call(t,o)&&(i[o]=t[o]);return i})(o,["position"]);this.addControl(e,n||"top-left",r)})),this._emitStatusEvent("controls:create")}}var oh=Object.defineProperty,nh=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,sh=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,lh=Object.prototype.propertyIsEnumerable,hh=(t,e,i)=>e in t?oh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ch=(t,e)=>{for(var i in e||(e={}))ah.call(e,i)&&hh(t,i,e[i]);if(sh)for(var i of sh(e))lh.call(e,i)&&hh(t,i,e[i]);return t},uh=(t,e)=>nh(t,rh(e));function ph(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(uh(ch({},i),{resource:e}));else if(Array.isArray(e)){const[n,r]=e;t.push(ch(uh(ch({},i),{resource:n,id:r}),o))}else"object"==typeof e&&t.push(ch(ch(ch({},i),e),o))}var dh=Object.defineProperty,fh=Object.defineProperties,mh=Object.getOwnPropertyDescriptors,_h=Object.getOwnPropertySymbols,yh=Object.prototype.hasOwnProperty,gh=Object.prototype.propertyIsEnumerable,vh=(t,e,i)=>e in t?dh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const bh={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};function wh(t){const e=[new Or];var i;return t.starterKits&&t.starterKits.forEach((t=>{e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new ko({baseUrl:t.baseUrl||"",auth:t.auth,withCredentials:t.withCredentials}),(t=f(bh,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Ra({connector:t.connector,auth:t.auth})),i=((t,e)=>{for(var i in e||(e={}))yh.call(e,i)&&vh(t,i,e[i]);if(_h)for(var i of _h(e))gh.call(e,i)&&vh(t,i,e[i]);return t})({},t),t=fh(i,mh({starterKits:e,create:!1}))}var xh=Object.defineProperty,Lh=Object.defineProperties,Ph=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,Ch=Object.getPrototypeOf,Mh=Object.prototype.hasOwnProperty,kh=Object.prototype.propertyIsEnumerable,Ah=Reflect.get,Eh=(t,e,i)=>e in t?xh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Th=(t,e)=>{for(var i in e||(e={}))Mh.call(e,i)&&Eh(t,i,e[i]);if(Oh)for(var i of Oh(e))kh.call(e,i)&&Eh(t,i,e[i]);return t},Ih=(t,e)=>Lh(t,Ph(e)),Sh=(t,e,i)=>Eh(t,"symbol"!=typeof e?e+"":e,i),zh=(t,e,i)=>Ah(Ch(t),i,e),jh=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Bh=class t extends ih{constructor(t){super(wh(t)),Sh(this,"emitter",new i),Sh(this,"connector"),Sh(this,"_ngwLayers",{}),Sh(this,"$$selectFromNgwRaster"),Sh(this,"$$selectFromNgwVector"),Sh(this,"_promises",{select:[],identify:[]}),t.connector&&(this.connector=t.connector),this._createWebMap().then((()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}addControl(e,i,o){return jh(this,null,(function*(){return yield this.onLoad("controls:create"),zh(t.prototype,this,"addControl").call(this,e,i,o)}))}addNgwLayer(t){return jh(this,null,(function*(){yield this.onMapLoad();const{keyname:e,resourceId:i}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const o=t.resource;if(!e&&!i&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(p(this.options.baseUrl))try{p(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},p(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay));const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),void 0!==i.withCredentials&&(t.withCredentials=i.withCredentials),Us(t,e,i)}(t,this,this.connector),i=Th(Th({visibility:!0},t),t.adapterOptions),o=yield this.addLayer(e,i),n=o&&this.getLayerId(o);if(o&&n&&(this._ngwLayers[n]={layer:o,resourceId:o.resourceId},o.options.name=o.options.name||o.item&&o.item.resource.display_name,o.options.baselayer)){if(this.getActiveBaseLayer())return o}return o}catch(n){const t=k(o)&&"id"in o?o.id:e||i||o;console.error(`Can't add NGW layer ${t}.`,n)}}))}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return en(Th({connector:this.connector},t))}fetchNgwLayerItems(t){return Kr(Th({connector:this.connector},t))}fetchNgwLayerFeature(t){return Ga(Th({connector:this.connector},t))}fetchNgwLayerFeatures(t){return Qr(Th({connector:this.connector},t))}fetchIdentifyItem(t,e){const i=function(t){const{connector:e,identify:i}=t,o=ol(i);return o&&o.length?en(el(el({connector:e},t.requestOptions),o[0])):ji.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",i),i}fetchIdentifyGeoJson(t,e=!1){const i=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const r in i){const t=Number(r);if(!isNaN(t)){const t=i[r];if("features"in t){const e=t.features.find((t=>t.geom));if(e&&e.geom){const t=e.geom;return ji.resolve(Ro(il(el({},e),{geom:t})))}}}}const n=ol(i);return n&&n.length?Ga(el(il(el({},o),{connector:e}),n[0])):ji.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return i&&"then"in i?(this._addPromise("identify",i),i):ji.resolve(i)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,e)}getNgwLayers(){return jh(this,null,(function*(){return yield this.onLoad(),this._ngwLayers}))}getNgwLayerByResourceId(t){return jh(this,null,(function*(){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=yield i.layer.getIdentificationIds();if(e&&e.some((e=>e===t)))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find((e=>e.item&&e.item.style_parent_id===t));if(e)return e.layer}}}))}fitLayer(e,i){return jh(this,null,(function*(){let o;o="string"==typeof e||"number"==typeof e?String(o):e.id;const n=o&&this._ngwLayers[o];if(n)if(n.layer.getBounds){const t=yield n.layer.getBounds();t&&this.fitBounds(t,i)}else{let t;if(n.layer.item)t=n.layer.item;else{const e=n.resourceId;t=yield this.connector.getResource(e)}t&&tr({resourceId:t.resource.id,connector:this.connector}).then((t=>{t&&this.fitBounds(t,i)}))}else zh(t.prototype,this,"fitLayer").call(this,"number"==typeof e?String(e):e,i)}))}zoomToLayer(t){return jh(this,null,(function*(){return this.fitLayer(t)}))}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach((t=>{const e=this._promises[t];e&&(e.forEach((t=>t.cancel())),this._promises[t]=[])}))}selectFromNgwRaster(t){return jh(this,null,(function*(){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort(((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1));for(const t of o){const o=t.layer,n="function"==typeof o.getIdentificationIds&&o.getIdentificationIds,r=null==(e=o.options.interactive)||e;n&&o.options.selectable&&r&&this.isLayerVisible(o)&&i.push(n.call(o))}const n=Promise.all(i),r=yield n,s=[];for(const t of r)t&&s.push(...t);if(!s.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,l=this.getCenter();let h=this.getZoom();if(h=void 0!==h?h:20,!l||!h)return void this._emitStatusEvent("ngw:select",null);const c=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(l,h,a);let u;if(this.options.highlightIdentification){const e=this.options.highlightIdentification,i="number"==typeof e?e:1e3,[o,n]=t.lngLat;u={type:"Polygon",coordinates:[x(o,n,c)]};const r=yield this.addGeoJsonLayer({data:{type:"Feature",geometry:u}});i!==1/0&&setTimeout((()=>{this.removeLayer(r)}),i)}const p=function(t,e){m(t);const[i,o]=t.lngLat,{geom:n,radius:r,signal:s,cache:a}=e,l=null!=n?n:x(i,o,r);return rl(il(el({},e),{geom:l,signal:s,cache:a}))}(t,{layers:s,connector:this.connector,radius:c,geom:u}).then((e=>{const i=Ih(Th({},e),{resources:s,sourceType:"raster",event:t}),o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o}));return this._addPromise("select",p),p}))}_addPromise(t,e){const i=this._promises[t];if(i&&-1===i.indexOf(e)){const t=()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(t),e.catch(t),i.push(e)}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}_createWebMap(){return jh(this,null,(function*(){yield this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&ph(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),ph(t,o,{},i)}for(const o of t)try{yield this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}))}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,[i]:{featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]}};return this._emitStatusEvent("ngw:select",this._prepareToIdentify(Ih(Th({},e),{resources:[i],sourceType:"vector"}))),e}}}_prepareToIdentify(t){return Ih(Th({},t),{getIdentifyItems:()=>ol(t,!0).map((t=>new Va({feature:t.feature,connector:this.connector})))})}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}_whiteLabel(){return jh(this,null,(function*(){const t=this.getContainer();if(t){const e=yield sl(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}}))}};Sh(Bh,"getIcon",(function(t={}){var e,i,o,n,r,s;const a=null!=(e=t.shape)?e:"circle",l=null!=(i=t.color)?i:"blue",h=null!=(o=t.strokeColor)?o:"white",c=null!=(n=t.size)?n:Zi,u=null!=(r=t.rotate)?r:0,p=null!=(s=t.anchor)?s:[c/2,c/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||Bi[a]||"circle",m="string"==typeof f?f:f(t),_=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const n=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${n} -${n} ${Zi+i} ${Zi+i}"\n >${o}</svg>`}({width:c,height:c,stroke:d,content:m}));return _.setAttribute("width",String(c)),_.setAttribute("height",String(c)),_.setAttribute("fill",l),d&&(_.setAttribute("stroke",h),_.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[c,c],iconAnchor:p,html:(new XMLSerializer).serializeToString(_),rotate:u,svg:_}}));let Zh=Bh;var Nh=Object.defineProperty,Rh=Object.defineProperties,Dh=Object.getOwnPropertyDescriptors,Fh=Object.getOwnPropertySymbols,Uh=Object.prototype.hasOwnProperty,Wh=Object.prototype.propertyIsEnumerable,Hh=(t,e,i)=>e in t?Nh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;delete h.Icon.Default.prototype._getIconUrl,h.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class qh extends Zh{constructor(t){var e,i;e=((t,e)=>{for(var i in e||(e={}))Uh.call(e,i)&&Hh(t,i,e[i]);if(Fh)for(var i of Fh(e))Wh.call(e,i)&&Hh(t,i,e[i]);return t})({},t),i={mapAdapter:new vi},super(t=Rh(e,Dh(i)))}static create(t){return e=this,i=null,o=function*(){return new qh(t).onLoad()},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}}return window&&!window.NgwMap&&(window.NgwMap=qh),qh}();
|
|
1
|
+
var NgwLeaflet=function(){"use strict";function t(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}t('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');function e(){}function i(){i.init.call(this)}function o(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function n(t,i,n,r){var s,a,l,h;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",i,n.listener?n.listener:n),a=t._events),l=a[i]):(a=t._events=new e,t._eventsCount=0),l){if("function"==typeof l?l=a[i]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(s=o(t))&&s>0&&l.length>s){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+i+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=i,c.count=l.length,h=c,"function"==typeof console.warn?console.warn(h):console.log(h)}}else l=a[i]=n,++t._eventsCount;return t}function r(t,e,i){var o=!1;function n(){t.removeListener(e,n),o||(o=!0,i.apply(t,arguments))}return n.listener=i,n}function s(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function a(t,e){for(var i=new Array(e);e--;)i[e]=t[e];return i}t(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}"),e.prototype=Object.create(null),i.EventEmitter=i,i.usingDomains=!1,i.prototype.domain=void 0,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.init=function(){this.domain=null,i.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new e,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(t){var e,i,o,n,r,s,l,h="error"===t;if(s=this._events)h=h&&null==s.error;else if(!h)return!1;if(l=this.domain,h){if(e=arguments[1],!l){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=l,e.domainThrown=!1,l.emit("error",e),!1}if(!(i=s[t]))return!1;var u="function"==typeof i;switch(o=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var o=t.length,n=a(t,o),r=0;r<o;++r)n[r].call(i)}(i,u,this);break;case 2:!function(t,e,i,o){if(e)t.call(i,o);else for(var n=t.length,r=a(t,n),s=0;s<n;++s)r[s].call(i,o)}(i,u,this,arguments[1]);break;case 3:!function(t,e,i,o,n){if(e)t.call(i,o,n);else for(var r=t.length,s=a(t,r),l=0;l<r;++l)s[l].call(i,o,n)}(i,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,o,n,r){if(e)t.call(i,o,n,r);else for(var s=t.length,l=a(t,s),h=0;h<s;++h)l[h].call(i,o,n,r)}(i,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];!function(t,e,i,o){if(e)t.apply(i,o);else for(var n=t.length,r=a(t,n),s=0;s<n;++s)r[s].apply(i,o)}(i,u,this,n)}return!0},i.prototype.on=i.prototype.addListener=function(t,e){return n(this,t,e,!1)},i.prototype.prependListener=function(t,e){return n(this,t,e,!0)},i.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,r(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,r(this,t,e)),this},i.prototype.removeListener=function(t,i){var o,n,r,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(o=n[t]))return this;if(o===i||o.listener&&o.listener===i)0==--this._eventsCount?this._events=new e:(delete n[t],n.removeListener&&this.emit("removeListener",t,o.listener||i));else if("function"!=typeof o){for(r=-1,s=o.length;s-- >0;)if(o[s]===i||o[s].listener&&o[s].listener===i){a=o[s].listener,r=s;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new e,this;delete n[t]}else!function(t,e){for(var i=e,o=i+1,n=t.length;o<n;i+=1,o+=1)t[i]=t[o];t.pop()}(o,r);n.removeListener&&this.emit("removeListener",t,a||i)}return this},i.prototype.off=function(t,e){return this.removeListener(t,e)},i.prototype.removeAllListeners=function(t){var i,o;if(!(o=this._events))return this;if(!o.removeListener)return 0===arguments.length?(this._events=new e,this._eventsCount=0):o[t]&&(0==--this._eventsCount?this._events=new e:delete o[t]),this;if(0===arguments.length){for(var n,r=Object.keys(o),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new e,this._eventsCount=0,this}if("function"==typeof(i=o[t]))this.removeListener(t,i);else if(i)do{this.removeListener(t,i[i.length-1])}while(i[0]);return this},i.prototype.listeners=function(t){var e,i=this._events;return i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(e):[]},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):s.call(t,e)},i.prototype.listenerCount=s,i.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var l={exports:{}};(function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var o,n,r,s;return s=function(){o=!1,n&&(r.apply(i,n),n=!1)},r=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(s,e),o=!0)},r}function l(t,e,i){var o=e[1],n=e[0],r=o-n;return t===o&&i?t:((t-n)%r+r)%r+n}function h(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function g(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,O=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function M(t){t&&O.call(window,t)}var k={extend:i,create:o,bind:n,lastId:r,stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:c,trim:u,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:y,indexOf:g,emptyImageUrl:v,requestFn:P,cancelFn:O,requestAnimFrame:C,cancelAnimFrame:M};function A(){}function E(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,r=o(n);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(E(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(o(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},A.include=function(t){return i(this.prototype,t),this},A.mergeOptions=function(t){return i(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var T={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},r=o,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(n)},_off:function(t,e,i){var o,n,r;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,r=o.length;n<r;n++){var s=o[n];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,r=o.length;n<r;n++)o[n].fn=h;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var r=n((function(){this.off(t,e,i).off(t,r,i)}),this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};T.addEventListener=T.on,T.removeEventListener=T.clearAllEventListeners=T.off,T.addOneTimeEventListener=T.once,T.fireEvent=T.fire,T.hasEventListeners=T.listens;var I=A.extend(T);function S(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var z=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function j(t,e,i){return t instanceof S?t:y(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function Z(t,e){return!t||t instanceof B?t:new B(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function R(t,e){return t instanceof N?t:new N(t,e)}function D(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof D?t:y(t)&&"object"!=typeof t[0]?3===t.length?new D(t[0],t[1],t[2]):2===t.length?new D(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new D(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new D(t,e,i)}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(t){return this.clone()._add(j(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(j(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new S(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new S(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(t){var e=(t=j(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=j(t)).x===this.x&&t.y===this.y},contains:function(t){return t=j(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},B.prototype={extend:function(t){return t=j(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new S((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new S(this.min.x,this.max.y)},getTopRight:function(){return new S(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof S?j(t):Z(t))instanceof B?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof D)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(F(t)||R(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new D(e.lat,e.lng),this._northEast=new D(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new N(new D(e.lat-o,e.lng-n),new D(i.lat+o,i.lng+n))},getCenter:function(){return new D((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new D(this.getNorth(),this.getWest())},getSouthEast:function(){return new D(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof D||"lat"in t?F(t):R(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=R(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},D.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return R([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new D(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new B(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new D(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new N(new D(r.lat-o,r.lng-n),new D(s.lat-o,s.lng-n))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(o)*Math.cos(n)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),q=6378137,V={R:q,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new S(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new D((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=q*Math.PI,new B([-U,-U],[U,U]))};function G(t,e,i,o){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new S((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,o,n,r,s,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,r=(s=t[i]).length;o<r;o++)l+=(o?"L":"M")+(a=s[o]).x+" "+a.y;l+=e?Et?"z":"x":""}return l||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=It("webkit"),nt=It("android"),rt=It("android 2")||It("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&It("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ht=!it&&It("chrome"),ct=It("gecko")&&!ot&&!lt&&!tt,ut=!ht&&It("safari"),pt=It("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,yt="MozPerspective"in $,gt=!window.L_DISABLE_3D&&(mt||_t||yt)&&!dt&&!pt,vt="undefined"!=typeof orientation||It("mobile"),bt=vt&&ot,wt=vt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=vt&<,Ct=vt&&ct,Mt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,kt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),At=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!Q("svg").createSVGRect),Tt=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var St={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:rt,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:yt,any3d:gt,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Ot,mobileGecko:Ct,retina:Mt,passiveEvents:kt,canvas:At,svg:Et,vml:Tt},zt=xt?"MSPointerDown":"pointerdown",jt=xt?"MSPointerMove":"pointermove",Bt=xt?"MSPointerUp":"pointerup",Zt=xt?"MSPointerCancel":"pointercancel",Nt={},Rt=!1;function Dt(t,e,i,o){return"touchstart"===e?Ut(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(jt,o,!1):"touchend"===e&&(t.removeEventListener(Bt,o,!1),t.removeEventListener(Zt,o,!1)),this}function Ut(t,e,i){var o=n((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),Vt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Rt||(document.addEventListener(zt,Wt,!0),document.addEventListener(jt,Ht,!0),document.addEventListener(Bt,qt,!0),document.addEventListener(Zt,qt,!0),Rt=!0)}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function qt(t){delete Nt[t.pointerId]}function Vt(t,e){for(var i in t.touches=[],Nt)t.touches.push(Nt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(jt,o,!1)}function Jt(t,e,i){var o=function(t){Vt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Bt,o,!1),t.addEventListener(Zt,o,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var o,n,r=!1,s=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,r=i>0&&i<=s,o=e}function l(t){if(r&&!n.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in n)a[s]=(i=n[s])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=l,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!kt&&{passive:!1}),t.addEventListener(Yt,l,!!kt&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!kt&&{passive:!1}),t.removeEventListener(Yt,i,!!kt&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function ce(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var r=ve(t);ge(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):ge(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function ge(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var o=e||new S(0,0);t.style[re]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,gt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new S(0,0)}if("onselectstart"in document)te=function(){ze(window,"selectstart",He)},ee=function(){Be(window,"selectstart",He)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function Me(){ze(window,"dragstart",He)}function ke(){Be(window,"dragstart",He)}function Ae(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ee(),oe=t,ne=t.style.outline,t.style.outline="none",ze(window,"keydown",Ee))}function Ee(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Be(window,"keydown",Ee))}function Te(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Se={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:he,create:ce,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ye,setClass:ge,getClass:ve,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Oe,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Me,enableImageDrag:ke,preventOutline:Ae,restoreOutline:Ee,getSizedParentNode:Te,getScale:Ie};function ze(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)Re(t,e[r],i,o);return this}var je="_leaflet_events";function Be(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,o);else{for(var a in t[je])De(t,a,t[je][a]);delete t[je]}return this}function Ze(){if(Lt)return!(it||ut)}var Ne={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Re(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):"");if(t[je]&&t[je][n])return this;var r=function(e){return i.call(o||t,e||window.event)},a=r;Lt&&0===e.indexOf("touch")?Dt(t,e,r,n):Pt&&"dblclick"===e&&!Ze()?Xt(t,r,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ne[e]||e,r,!!kt&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Ne[e],r=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[je]=t[je]||{},t[je][n]=r}function De(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):""),r=t[je]&&t[je][n];if(!r)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,n):Pt&&"dblclick"===e&&!Ze()?$t(t,n):"removeEventListener"in t?t.removeEventListener(Ne[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[je][n]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return Re(t,"wheel",Fe),this}function We(t){return ze(t,"mousedown touchstart dblclick",Fe),Re(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function qe(t){return He(t),Fe(t),this}function Ve(t,e){if(!e)return new S(t.clientX,t.clientY);var i=Ie(e),o=i.boundingClientRect;return new S((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var $e={on:ze,off:Be,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:qe,getMousePosition:Ve,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:ze,removeListener:Be},ti=I.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){M(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=I.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&>&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(gt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(gt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),r=(t instanceof S?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),s=this.containerPointToLatLng(n.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():R(t);var i=j(e.paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var r=o.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(s.add(a).divideBy(2).add(r),n),zoom:n}},fitBounds:function(t,e){if(!(t=R(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=j(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!gt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),r=this.getSize(),s=this._zoom;t=F(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=n.distanceTo(o)||1,c=1.42,u=c*c;function p(t){var e=(l*l-a*a+(t?-1:1)*u*u*h*h)/(2*(t?l:a)*u*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function y(t){return a*(f(_)/f(_+c*t))}function g(t){return a*(f(_)*m(_+c*t)-d(_))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/c,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,r=v(i)*w;i<=1?(this._flyToFrame=C(L,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(g(r)/h)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=R(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,R(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=j((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),r=this.project(n),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=Z([a.min.add(i),a.max.subtract(o)]);if(!h.contains(s)){this._enforcingBounds=!0;var c=r.subtract(s),u=j(s.x+c.x,s.y+c.y);(s.x<h.min.x||s.x>h.max.x)&&(u.x=r.x-c.x,c.x>0?u.x+=l.x-i.x:u.x-=l.x-o.x),(s.y<h.min.y||s.y>h.max.y)&&(u.y=r.y-c.y,c.y>0?u.y+=l.y-i.y:u.y-=l.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=e.divideBy(2).round(),s=o.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=R(t),i=j(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=Z(this.project(a,o),this.project(s,o)).getSize(),c=gt?this.options.zoomSnap:1,u=l.x/h.x,p=l.y/h.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(r,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new S(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(j(t),e)},layerPointToLatLng:function(t){var e=j(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return j(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return j(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(j(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Ve(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&>,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(Mt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new S(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new S(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Be:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!Xe(r,t))break;if(o.push(i),n)break}if(r===this._container)break;r=r.parentNode}return o.length||a||n||!Xe(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Ae(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var r=o[0];"contextmenu"===e&&r.listens(e,!0)&&He(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<o.length;l++)if(o[l].fire(e,s,!0),s.originalEvent._stopped||!1===o[l].options.bubblingMouseEvents&&-1!==g(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new S(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return Z([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),r=new B(o.subtract(n),o.add(n)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(o.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new B(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),r=o.max.subtract(t.max);return new S(this._rebound(n.x,-r.x),this._rebound(n.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=gt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ni=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=ce("div",e+"control-container",this._container);function o(o,n){t[o+n]=ce("div",e+o+" "+e+n,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var o=this._section=ce("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||ze(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=ce("a",t+"-toggle",e);n.href="#",n.title="Layers",Pt?(ze(n,"click",qe),ze(n,"click",this.expand,this)):ze(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=ce("div",t+"-base",o),this._separator=ce("div",t+"-separator",o),this._overlaysList=ce("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(n((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&n>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+s(this),o),this._layerControlInputs.push(e),e.layerId=s(t.layer),ze(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])&&this._map.removeLayer(n[r]);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])||this._map.addLayer(o[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ri(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=ce("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var r=ce("a",i,o);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),We(r),ze(r,"click",qe),ze(r,"click",n,this),ze(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var li=function(t){return new ai(t)},hi=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=ce("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=ce("div",e,i)),t.imperial&&(this._iScale=ce("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,n=3.2808399*t;n>5280?(i=this._getRoundNum(e=n/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),ci=function(t){return new hi(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=ai,oi.Scale=hi,oi.Attribution=ui,ni.layers=si,ni.zoom=li,ni.scale=ci,ni.attribution=pi;var di=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:T},_i=Pt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},gi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},vi=I.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(),Be(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(vi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(vi._dragging=this,this._preventOutline&&Ae(this._element),Me(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Te(this._element);this._startPoint=new S(e.clientX,e.clientY),this._parentScale=Ie(i),ze(document,gi[t.type],this._onMove,this),ze(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new S(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Oe(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,M(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),gi)Be(document,gi[t],this._onMove,this),Be(document,yi[t],this._onUp,this);ke(),ee(),this._moved&&this._moving&&(M(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,vi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Oi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ei(t,e,i,!0))}function xi(t,e,i){return Ei(t,e,i)}function Li(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Pi(t,o,e,0,i-1);var n,r=[];for(n=0;n<i;n++)o[n]&&r.push(t[n]);return r}function Pi(t,e,i,o,n){var r,s,a,l=0;for(s=o+1;s<=n-1;s++)(a=Ei(t[s],t[o],t[n],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Pi(t,e,i,o,r),Pi(t,e,i,r,n))}function Oi(t,e){for(var i=[t[0]],o=1,n=0,r=t.length;o<r;o++)Ai(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<r-1&&i.push(t[r-1]),i}function Ci(t,e,i,o,n){var r,s,a,l=o?fi:ki(t,i),h=ki(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=ki(s=Mi(t,e,r=l||h,i,n),i),r===l?(t=s,l=a):(e=s,h=a)}}function Mi(t,e,i,o,n){var r,s,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.max;return 8&i?(r=t.x+a*(c.y-t.y)/l,s=c.y):4&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):2&i?(r=c.x,s=t.y+l*(c.x-t.x)/a):1&i&&(r=h.x,s=t.y+l*(h.x-t.x)/a),new S(r,s,n)}function ki(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ai(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ei(t,e,i,o){var n,r=e.x,s=e.y,a=i.x-r,l=i.y-s,h=a*a+l*l;return h>0&&((n=((t.x-r)*a+(t.y-s)*l)/h)>1?(r=i.x,s=i.y):n>0&&(r+=a*n,s+=l*n)),a=t.x-r,l=t.y-s,o?a*a+l*l:new S(r,s)}function Ti(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ii(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ti(t)}var Si={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:Mi,_getBitCode:ki,_sqClosestPointOnSegment:Ei,isFlat:Ti,_flat:Ii};function zi(t,e,i){var o,n,r,s,a,l,h,c,u,p=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=ki(t[n],e);for(s=0;s<4;s++){for(c=p[s],o=[],n=0,r=(h=t.length)-1;n<h;r=n++)l=t[r],(a=t[n])._code&c?l._code&c||((u=Mi(l,a,c,e,i))._code=ki(u,e),o.push(u)):(l._code&c&&((u=Mi(l,a,c,e,i))._code=ki(u,e),o.push(u)),o.push(a));t=o}return t}var ji={clipPolygon:zi},Bi={project:function(t){return new S(t.lng,t.lat)},unproject:function(t){return new D(t.y,t.x)},bounds:new B([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752.314245179,bounds:new B([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,n=this.R_MINOR/i,r=Math.sqrt(1-n*n),s=r*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-s)/(1+s),r/2);return o=-i*Math.log(Math.max(a,1e-10)),new S(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,r=Math.sqrt(1-n*n),s=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new D(a*i,t.x*i/o)}},Ni={LonLat:Bi,Mercator:Zi,SphericalMercator:V},Ri=i({},H,{code:"EPSG:3395",projection:Zi,transformation:function(){var t=.5/(Math.PI*Zi.R);return J(t,.5,-t,.5)}()}),Di=i({},H,{code:"EPSG:4326",projection:Bi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Bi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});W.Earth=H,W.EPSG3395=Ri,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=Di,W.Simple=Fi;var Ui=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Hi=function(t,e){return new Wi(t,e)},qi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Vi=function(t,e){return new qi(t,e)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=j(o),r=j("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Mt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new vi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,r=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=Z(s.min._subtract(a).add(n),s.max._subtract(a).subtract(n));if(!l.contains(r)){var h=j((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(M(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Oe(e._icon),n=e._map.layerPointToLatLng(o);i&&Pe(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){M(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),r=!1;n!==this._shadow&&(this._removeShadow(),r=!0),n&&(_e(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),to=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new B(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===H.distance){var n=Math.PI/180,r=this._mRadius/H.R/n,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(r*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(isNaN(c)||0===c)&&(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-s.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var no=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,r=Ei,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],h=1,c=l.length;h<c;h++){var u=r(t,e=l[h-1],i=l[h],!0);u<o&&(o=u,n=r(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if((o+=i=(n=a[t]).distanceTo(r=a[t+1]))>e)return this._map.layerPointToLatLng([r.x-(s=(o-e)/i)*(r.x-n.x),r.y-s*(r.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ti(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ti(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new B;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new S(t,t);this._pxBounds=new B([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,r=t.length;if(t[0]instanceof D){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,r,s,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Ci(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[o].push(s[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(o=0,n=(s=(a=this._parts[i]).length)-1;o<s;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new no(t,e)}no._flat=Ii;var so=no.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,r,s,a,l=this._rings[0],h=l.length;if(!h)return null;for(r=s=a=0,t=0,e=h-1;t<h;e=t++)s+=((i=l[t]).x+(o=l[e]).x)*(n=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*n,r+=3*n;return this._map.layerPointToLatLng(0===r?l[0]:[s/r,a/r])},_convertLatLngs:function(t){var e=no.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof D&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){no.prototype._setLatLngs.call(this,t),Ti(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ti(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new S(e,e);if(t=new B(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,n=0,r=this._rings.length;n<r;n++)(o=zi(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,r,s,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(r=0,s=(l=(e=this._parts[n]).length)-1;r<l;s=r++)(i=e[r]).y>t.y!=(o=e[s]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||no.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new so(t,e)}var lo=qi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=y(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=ho(t,r);return s?(s.feature=yo(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function ho(t,e){var i,o,n,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!s)return null;switch(s.type){case"Point":return co(h,t,i=c(a),e);case"MultiPoint":for(n=0,r=a.length;n<r;n++)i=c(a[n]),l.push(co(h,t,i,e));return new qi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===s.type?0:1,c),new no(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===s.type?1:2,c),new so(o,e);case"GeometryCollection":for(n=0,r=s.geometries.length;n<r;n++){var u=ho({geometry:s.geometries[n],type:"Feature",properties:t.properties},e);u&&l.push(u)}return new qi(l);default:throw new Error("Invalid GeoJSON object.")}}function co(t,e,i,o){return t?t(e,i):new Qi(i,o&&o.markersInheritOptions&&o)}function uo(t){return new D(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],r=0,s=t.length;r<s;r++)o=e?po(t[r],e-1,i):(i||uo)(t[r]),n.push(o);return n}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function mo(t,e,i,o){for(var n=[],r=0,s=t.length;r<s;r++)n.push(e?mo(t[r],e-1,i,o):fo(t[r],o));return!e&&i&&n.push(n[0]),n}function _o(t,e){return t.feature?i({},t.feature,{geometry:e}):yo(e)}function yo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var go={toGeoJSON:function(t){return _o(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function vo(t,e){return new lo(t,e)}Qi.include(go),io.include(go),to.include(go),no.include({toGeoJSON:function(t){var e=!Ti(this._latlngs);return _o(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),so.include({toGeoJSON:function(t){var e=!Ti(this._latlngs),i=e&&!Ti(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),_o(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_o(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var r=yo(n);"FeatureCollection"===r.type?o.push.apply(o,r.features):o.push(r)}}})),i?_o(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var bo=vo,wo=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=R(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=n(this.fire,this,"load"),e.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new B(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Lo=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=n(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],r=0;r<i.length;r++)o.push(i[r].src);this._url=i.length>0?o:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=ce("source");a.src=this._url[s],e.appendChild(a)}}}});function Po(t,e,i){return new Lo(t,e,i)}var Oo=wo.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function Co(t,e,i){return new Oo(t,e,i)}var Mo=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(n(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof qi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=j(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),ko=Mo.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Mo.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){Mo.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=Mo.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",i),We(e),Ue(this._contentNode),ze(e,"contextmenu",Fe),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=ce("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",ze(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,n="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",_e(t,n)):ye(t,n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new S(this._containerLeft,-i-this._containerBottom);n._add(Oe(this._container));var r=t.layerPointToContainerPoint(n),s=j(this.options.autoPanPadding),a=j(this.options.autoPanPaddingTopLeft||s),l=j(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),c=0,u=0;r.x+o+l.x>h.x&&(c=r.x+o-h.x+l.x),r.x-c-a.x<0&&(c=r.x-a.x),r.y+i+l.y>h.y&&(u=r.y+i-h.y+l.y),r.y-u-a.y<0&&(u=r.y-a.y),(c||u)&&t.fire("autopanstart").panBy([c,u])}},_onCloseButtonClick:function(t){this._close(),qe(t)},_getAnchor:function(){return j(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ao=function(t,e){return new ko(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof ko||(t=new ko(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof ko?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new ko(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(qe(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Eo=Mo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Mo.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Mo.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Mo.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=ce("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,n=this._container,r=o.latLngToContainerPoint(o.getCenter()),s=o.layerPointToContainerPoint(t),a=this.options.direction,l=n.offsetWidth,h=n.offsetHeight,c=j(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=l,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=l+2*(c.x+u.x),i=h/2),t=t.subtract(j(e,i,!0)).add(c).add(u),ye(n,"leaflet-tooltip-right"),ye(n,"leaflet-tooltip-left"),ye(n,"leaflet-tooltip-top"),ye(n,"leaflet-tooltip-bottom"),_e(n,"leaflet-tooltip-"+a),Pe(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return j(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),To=function(t,e){return new Eo(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Eo?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Eo(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Io=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=j(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function So(t){return new Io(t)}Gi.Default=Ki;var zo=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:vt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof S?t:new S(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,r=i.length;n<r;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var r=Math.min(1,(t-n.loaded)/200);be(n.el,r),r<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),h(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new S(+n,+r);a.z=+s;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>o&&this._retainParent(n,r,s,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var r=2*e;r<2*e+2;r++){var s=new S(n,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<o&&this._retainChildren(n,r,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=Math.round(e);n=void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom?void 0:this._clampZoom(n),o&&!(this.options.updateWhenZooming&&n!==this._tileZoom)||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();gt?Le(t.el,n,o):Pe(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*o);return new B(n.subtract(r),n.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),r=n.getCenter(),s=[],a=this.options.keepBuffer,l=new B(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new S(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=n.min.y;u<=n.max.y;u++)for(var p=n.min.x;p<=n.max.x;p++){var d=new S(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new S(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&be(t,this.options.opacity),nt&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&C(n(this._tileReady,this,t,null,r)),Pe(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new S(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new B(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function jo(t){return new zo(t)}var Bo=zo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Mt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ze(i,"load",n(this._tileOnLoad,this,e,i)),ze(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Mt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=v,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",v),zo.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return zo.prototype._tileReady.call(this,t,e,i)}});function Zo(t,e){return new Bo(t,e)}var No=Bo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var n in e)n in this.options||(o[n]=e[n]);var r=(e=d(this,e)).detectRetina&&Mt?2:1,s=this.getTileSize();o.width=s.x*r,o.height=s.y*r,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Bo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=Z(i.project(e[0]),i.project(e[1])),n=o.min,r=o.max,s=(this._wmsVersion>=1.3&&this._crs===Di?[n.y,n.x,r.y,r.x]:[n.x,n.y,r.x,r.y]).join(","),a=Bo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new No(t,e)}Bo.WMS=No,Zo.wms=Ro;var Do=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Oe(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=n.multiplyBy(-i).add(o).add(n).subtract(s);gt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new B(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Do.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,ue(this._container),Be(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Mt?2:1;Pe(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Mt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Do.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new B,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=s[i].length;o<n;o++)l[o?"lineTo":"moveTo"]((r=s[i][o]).x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(_e(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(n((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return At?new Fo(t):null}var Wo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Ho={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Do.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wo("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Wo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?y(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Wo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},qo=Tt?Wo:Q,Vo=Do.extend({getEvents:function(){var t=Do.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=qo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Be(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){Do.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=qo("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return Et||Tt?new Vo(t):null}Tt&&Vo.include(Ho),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Uo(t)||Go(t)}});var Jo=so.extend({initialize:function(t,e){so.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}Vo.create=qo,Vo.pointsToPath=X,lo.geometryToLayer=ho,lo.coordsToLatLng=uo,lo.coordsToLatLngs=po,lo.latLngToCoords=fo,lo.latLngsToCoords=mo,lo.getFeature=_o,lo.asFeature=yo,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Be(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),Me(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:qe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new B(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ee(),ke(),Be(document,{contextmenu:qe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var Qo=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ei.addInitHook("addHandler","doubleClickZoom",Qo),ei.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xo=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new vi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=R(this._map.options.maxBounds);this._offsetLimit=Z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,r=(o+e+i)%t-e-i,s=Math.abs(n+i)<Math.abs(r+i)?n:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),r=i.easeLinearity,s=n.multiplyBy(r/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),l=Math.min(i.inertiaMaxSpeed,a),h=s.multiplyBy(l/a),c=l/(i.inertiaDeceleration*r),u=h.multiplyBy(-c/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C((function(){e.panBy(u,{duration:c,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xo),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $o=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Be(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Be(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=j(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}qe(t)}}});ei.addInitHook("addHandler","keyboard",$o),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=di.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Be(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n(this._performZoom,this),o),qe(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,n=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?n:-n))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ei.addInitHook("addHandler","scrollWheelZoom",tn),ei.mergeOptions({tap:!0,tapTolerance:15});var en=di.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new S(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(n((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),ze(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Be(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new S(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ut||ei.addInitHook("addHandler","tap",en),ei.mergeOptions({touchZoom:Pt&&!rt,bounceAtZoomLimits:!0});var on=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var a=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",on),ei.BoxZoom=Yo,ei.DoubleClickZoom=Qo,ei.Drag=Xo,ei.Keyboard=$o,ei.ScrollWheelZoom=tn,ei.Tap=en,ei.TouchZoom=on,t.version=e,t.Control=oi,t.control=ni,t.Browser=St,t.Evented=I,t.Mixin=mi,t.Util=k,t.Class=A,t.Handler=di,t.extend=i,t.bind=n,t.stamp=s,t.setOptions=d,t.DomEvent=$e,t.DomUtil=Se,t.PosAnimation=ti,t.Draggable=vi,t.LineUtil=Si,t.PolyUtil=ji,t.Point=S,t.point=j,t.Bounds=B,t.bounds=Z,t.Transformation=G,t.transformation=J,t.Projection=Ni,t.LatLng=D,t.latLng=F,t.LatLngBounds=N,t.latLngBounds=R,t.CRS=W,t.GeoJSON=lo,t.geoJSON=vo,t.geoJson=bo,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=qi,t.featureGroup=Vi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Lo,t.videoOverlay=Po,t.SVGOverlay=Oo,t.svgOverlay=Co,t.DivOverlay=Mo,t.Popup=ko,t.popup=Ao,t.Tooltip=Eo,t.tooltip=To,t.Icon=Gi,t.icon=Ji,t.DivIcon=Io,t.divIcon=So,t.Marker=Qi,t.marker=Xi,t.TileLayer=Bo,t.tileLayer=Zo,t.GridLayer=zo,t.gridLayer=jo,t.SVG=Vo,t.svg=Go,t.Renderer=Do,t.Canvas=Fo,t.canvas=Uo,t.Path=$i,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=no,t.polyline=ro,t.Polygon=so,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(l.exports);var h=l.exports;function c(t,e={},i){return new(h.Control.extend({onAdd(){const o=document.createElement("div"),n=t.onAdd(i);return o.classList.add("leaflet-control"),e.bar&&o.classList.add("leaflet-bar"),e.addClass&&o.classList.add(e.addClass),e.margin||e.bar||(o.style.marginBottom="0px",o.style.marginTop="0px",o.style.marginLeft="0px",o.style.marginRight="0px"),n&&o.appendChild(n),h.DomEvent.disableClickPropagation(o),o},onRemove(){t.onRemove()}}))}function u(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const n=void 0===i.replace||i.replace;e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((i=>{const r=-1!==o.indexOf(i);if(!n&&!r||n){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}}))}))}function p(t){return null!=t}function d(t){return"string"==typeof t?!!t:p(t)}function f(t,e,i=!1){let o=t;const n=e,r=Array.isArray(n);let s=r&&[]||{};return r&&Array.isArray(n)?i?(o=o||[],s=s.concat(o),n.forEach(((t,e)=>{void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=f(o[e],t,i):-1===o.indexOf(t)&&s.push(t)}))):s=n:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){s[t]=o[t]})),Object.keys(n).forEach((function(t){s[t]="object"==typeof n[t]&&n[t]&&"object"==typeof o[t]&&"object"==typeof n[t]?f(o[t],n[t],i):n[t]}))),s}function m(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function _(t,e=10){let i;function o(...n){o.clear(),i=setTimeout((()=>{i=null,t.apply(this,n)}),e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}const y=6371;function g(t){return{type:"Polygon",coordinates:[v(t)]}}function v(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const b=Math.PI/180,w=180/Math.PI;function x(t,e,i=10,o=6){const n=i/y*w,r=n/Math.cos(e*b),s=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),l=t+r*Math.cos(i),h=e+n*Math.sin(i);s.push([l,h])}return s}function P(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function O(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:C(t,e));return t===e}function C(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let n=0;n<i.length;n++){if(!O(t[i[n]],e[o[n]],t,e))return!1}return!0}function M(t){const e={};return Object.keys(t).forEach((i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=M(t[i])})),e}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function A(t){return t.replace(/([^:]\/)\/+/g,"$1")}function E(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}function T(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}const I={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},S={stroke:!1,opacity:1},z={};for(const L in I){const t=I[L],e=z[t]||[];e.push(L),z[t]=e}function j(t,e){return-1!==(z[e]||[]).indexOf(t)}function B(t){const e=new h.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((t=>e.addData(t))),e.getBounds()}function Z(t){return{getBounds:()=>function(t){return E(B(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=B(t).getCenter();return[i,e]}(t)}}var N=Object.defineProperty,R=(t,e,i)=>((t,e,i)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class D{constructor(t,e){if(this.map=t,this.options=e,R(this,"layer"),R(this,"pane","order-0"),void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}function F(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:n}=i;return{latLng:i,lngLat:[n,o],pixel:{left:e.x,top:e.y},source:t}}var U=Object.defineProperty,W=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,V=(t,e,i)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;function G({layer:t,source:e}){const i=e.target.feature;return((t,e)=>{for(var i in e||(e={}))H.call(e,i)&&V(t,i,e[i]);if(W)for(var i of W(e))q.call(e,i)&&V(t,i,e[i]);return t})({layer:t,feature:i,event:F(e),source:e},Z(i))}var J=Object.defineProperty,K=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,X=(t,e,i)=>e in t?J(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$=(t,e)=>{for(var i in e||(e={}))Y.call(e,i)&&X(t,i,e[i]);if(K)for(var i of K(e))Q.call(e,i)&&X(t,i,e[i]);return t},tt=(t,e,i)=>X(t,"symbol"!=typeof e?e+"":e,i);class et{constructor(t){tt(this,"layer"),tt(this,"_onclick"),tt(this,"_ondblclick"),tt(this,"_mouseout"),tt(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onDoubleClick:i,onLayerClick:o,onMouseOut:n,onMouseOver:r}=this.layer.options,s=e||o;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s($({selected:i},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),i&&(this._ondblclick=e=>{h.DomEvent.stopPropagation(e);const o=!!this.layer._getSelected(t);i($({selected:o},this._createMouseEvent(e)))},t.on("dblclick",this._ondblclick,this)),n&&(this._mouseout=t=>{n(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),r&&(this._mouseover=t=>{r(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return G({layer:this.layer,source:t})}}function it(t){return"[object Object]"===Object.prototype.toString.call(t)}function ot(t){return"function"==typeof t}function nt(t){return(e,i)=>{const o=e.map((t=>t()));return t(o,i)}}const rt={"!":nt((function([t]){return!t})),"!=":nt((function([t,e]){return t!==e})),"<":nt((function([t,e]){return t<e})),"<=":nt((function([t,e]){return t<=e})),"==":nt((function([t,e]){return t===e})),">":nt((function([t,e]){return t>e})),">=":nt((function([t,e]){return t>=e})),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),n=i.splice(-1,i.length%2)[0];for(let r=0;r<i.length-1;r+=2){if(i[r]()===o)return i[r+1]()}return n()}},st={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function at(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return lt(t);if("string"==typeof(e=t)&&e in st)return function(t){return lt(st[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function lt(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function ht(t,e,i,o,n){if("number"==typeof i&&"number"==typeof n)return i+(t-e)/(o-e)*(n-i);try{const r=at(i),s=at(n);return function(t){return`rgb(${t.join(",")})`}(r.map(((i,n)=>Math.ceil(ht(t,e,i,o,s[n])))))}catch(r){console.log(r)}throw new Error("Unsupported output type for linear interpolation.")}const ct={step:t=>{const[e,i,...o]=t,n=e();if("number"!=typeof n)return i();for(let r=0;r<o.length-2;r+=2){const t=o[r](),e=o[r+1](),i=o[r+2]();if(n>=t&&n<i)return e}return n>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const n=t();for(let r=0;r<i.length-2;r+=2){const t=i[r](),e=i[r+1](),s=i[r+2](),a=i[r+3]();if(o>=t&&o<=s&&"linear"===n[0])return ht(o,t,e,s,a)}throw new Error("Invalid interpolation type.")}};const ut={get:nt((function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null})),length:nt((([t])=>{if("string"==typeof t||Array.isArray(t))return t.length})),at:nt((function([t,e]){return e[t]})),has:nt((function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))})),in:nt((function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)})),"index-of":nt((function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)})),slice:nt((function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}))},pt={"+":nt((t=>t.reduce(((t,e)=>t+e),0))),"-":nt((t=>t.reduce(((t,e)=>t-e)))),"*":nt((t=>t.reduce(((t,e)=>t*e),1))),"/":nt((t=>t.reduce(((t,e)=>t/e)))),"%":nt((t=>t[0]%t[1])),"^":nt((t=>Math.pow(t[0],t[1]))),abs:nt((t=>Math.abs(t[0]))),acos:nt((t=>Math.acos(t[0]))),asin:nt((t=>Math.asin(t[0]))),atan:nt((t=>Math.atan(t[0]))),ceil:nt((t=>Math.ceil(t[0]))),cos:nt((t=>Math.cos(t[0]))),e:()=>Math.E,floor:nt((t=>Math.floor(t[0]))),ln:nt((t=>Math.log(t[0]))),ln2:()=>Math.LN2,log10:nt((t=>Math.log10(t[0]))),log2:nt((t=>Math.log2(t[0]))),max:nt((t=>Math.max(...t))),min:nt((t=>Math.min(...t))),pi:()=>Math.PI,round:nt((t=>Math.round(t[0]))),sin:nt((t=>Math.sin(t[0]))),sqrt:nt((t=>Math.sqrt(t[0]))),tan:nt((t=>Math.tan(t[0])))},dt={concat:nt((t=>t.reduce(((t,e)=>String(t)+String(e)),""))),downcase:nt((t=>String(t[0]).toLowerCase())),upcase:nt((t=>String(t[0]).toUpperCase()))},ft=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch(o){}};function mt(t){return(e,i)=>{for(const o of e){const e=ft(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}const _t={array:nt((t=>{const[e,i,o]=t;let n,r,s;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof i?(r=i,s=o):s=i):Array.isArray(e)&&(s=e),!Array.isArray(s))throw new Error("Expected an array");if(n&&!s.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(r&&s.length!==r)throw new Error(`Expected array of length ${r}`);return s})),boolean:nt(mt((t=>"boolean"==typeof t?t:void 0))),literal:nt((([t])=>t)),number:nt(mt((t=>"number"==typeof t?t:void 0))),object:nt(mt((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t))),string:nt(mt((t=>"string"==typeof t?t:void 0))),"to-boolean":nt(mt(Boolean)),"to-number":nt(mt(Number)),"to-string":nt(mt(String)),typeof:nt((([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every((t=>"number"==typeof t))?e="number":t.every((t=>"string"==typeof t))?e="string":t.every((t=>"boolean"==typeof t))&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t)))};var yt=Object.defineProperty,gt=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable,wt=(t,e,i)=>e in t?yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,xt=(t,e)=>{for(var i in e||(e={}))vt.call(e,i)&&wt(t,i,e[i]);if(gt)for(var i of gt(e))bt.call(e,i)&&wt(t,i,e[i]);return t};function Lt(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in Pt&&i.length>0}return!1}const Pt=xt(xt(xt(xt(xt(xt({},pt),_t),dt),ut),rt),ct);function Ot(t,e={}){const[i,...o]=t,n=Pt[i];if(n)return n(o.map((t=>()=>Lt(t)?Ot(t,e):t)),e);throw new Error(`Expression "${i}" is not supported.`)}var Ct=Object.defineProperty,Mt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Et=(t,e,i)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Tt=(t,e)=>{for(var i in e||(e={}))kt.call(e,i)&&Et(t,i,e[i]);if(Mt)for(var i of Mt(e))At.call(e,i)&&Et(t,i,e[i]);return t};function It(t){return e=>{const i=e.properties;return!!i&&Ot(t,i)}}const St=["iconSize","iconAnchor"];var zt=Object.defineProperty,jt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Nt=(t,e,i)=>e in t?zt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rt=(t,e)=>{for(var i in e||(e={}))Bt.call(e,i)&&Nt(t,i,e[i]);if(jt)for(var i of jt(e))Zt.call(e,i)&&Nt(t,i,e[i]);return t};function Dt(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(o,i?"i":"").exec(t)}const Ft={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>Dt(t,e),ilike:(t,e)=>Dt(t,e,!0)};function Ut(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function Wt(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(Ut(e)){const[i,o,n]=e,r=Ft[o];if(r){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,((o,r)=>(e=t[r],i.replace(r,n))));return r(e,o)}return r(t[i],n)}return!1}return Wt(t,e)},n=e.filter((t=>Array.isArray(t)));return"any"===i?n.some(o):n.every(o)}var Ht=Object.defineProperty,qt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,Jt=(t,e,i)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e)=>{for(var i in e||(e={}))Vt.call(e,i)&&Jt(t,i,e[i]);if(qt)for(var i of qt(e))Gt.call(e,i)&&Jt(t,i,e[i]);return t};function Yt(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find((e=>function(t,e){const i=Rt({},t.properties);return!!i&&(i.$id=t.id,Wt(i,e))}(t,e[0])));return o?Kt(Kt({},e),o[1]):e}}function Qt({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===St.indexOf(o)){const n=o,r=t[n];Lt(r)&&(e=!0,i[n]=It(r))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return Tt(Tt({},t),o)}}(t);if(i){const o=t=>$t({paint:i(t),defaultPaint:e});return o.paint=Xt({paint:t,defaultPaint:e}),o}return Xt({paint:t,defaultPaint:e})}function Xt({paint:t,defaultPaint:e}){var i;let o=Kt({},e);return o=Kt(Kt({},o),t),o.fill=null==(i=o.fill)||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function $t({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o=Kt({},e);if(ot(t)){const o=o=>{const n=$t({paint:t(o),defaultPaint:e,getPaintFunctions:i});return n.type=t.type,n};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>$t({paint:Yt(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);n&&(o=$t({paint:n,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=Qt({paint:t,defaultPaint:e})}return ot(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}var te=Object.defineProperty,ee=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,se=(t,e,i)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ae=(t,e)=>{for(var i in e||(e={}))ne.call(e,i)&&se(t,i,e[i]);if(oe)for(var i of oe(e))re.call(e,i)&&se(t,i,e[i]);return t};class le{constructor(t){var e;se(this,"layer"+"",e),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let i;const{layer:o,feature:n}=t;if(o&&n&&(ot(e)?i=e(n):it(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,n]of e){const e=this.layer.options.opacity;let r=t[n];p(e)&&-1!==n.toLowerCase().indexOf("opacity")&&(r=Number(r)*e),void 0!==r&&Object.defineProperty(i,o,{enumerable:!0,value:r})}return i}return S}_createDivIcon(t){const e=t,{html:i,rotate:o,className:n}=e,r=((t,e)=>{var i={};for(var o in t)ne.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&oe)for(var o of oe(t))e.indexOf(o)<0&&re.call(t,o)&&(i[o]=t[o]);return i})(e,["html","rotate","className"]),s=document.createElement("div");n&&(s.className=n),o&&(s.style.transform=`rotateZ(${o}deg)`),i&&(s.innerHTML=i);var a;return new h.DivIcon((a=ae({className:""},r),ee(a,ie({html:s}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,i)=>{const o=this._createDivIcon(t);return new h.Marker(i,{icon:o})}}else if("pin"===t.type)return(t,e)=>new h.Marker(e);return(e,i)=>new h.CircleMarker(i,this.preparePaint(ae(ae({},S),t)))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}var he=Object.defineProperty,ce=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,me=(t,e,i)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,_e=(t,e)=>{for(var i in e||(e={}))de.call(e,i)&&me(t,i,e[i]);if(pe)for(var i of pe(e))fe.call(e,i)&&me(t,i,e[i]);return t},ye=(t,e)=>ce(t,ue(e)),ge=(t,e,i)=>me(t,"symbol"!=typeof e?e+"":e,i);function ve({src:t,headers:e,withCredentials:i}){let o=()=>{};return[new Promise(((n,r)=>{const s=new XMLHttpRequest;s.open("GET",t),s.responseType="arraybuffer";for(const t in e)s.setRequestHeader(t,e[t]);i&&(s.withCredentials=i),s.onload=function(){const t=new Uint8Array(this.response),e=new Blob([t],{type:"image/png"}),i=(window.URL||window.webkitURL).createObjectURL(e);n(i)},s.onerror=r,s.send(),o=()=>{s.abort(),n("")}})),o]}var be=Object.defineProperty,we=(t,e,i)=>((t,e,i)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const xe=new class{constructor({concurrency:t=1,delay:e=0}={}){we(this,"queue",[]),we(this,"concurrency"),we(this,"activeCount",0),we(this,"timeoutId"),we(this,"delay"),we(this,"toAbort",[]),this.concurrency=t,this.delay=e}add(t,e){this.queue.push({promise:t,abort:e}),this.debouncedNext()}abort(){for(const t of this.toAbort)t();this.toAbort=[],this.queue=[],this._clearTimeout()}debouncedNext(){this._clearTimeout(),this.timeoutId=setTimeout((()=>this._next()),this.delay)}_clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}_next(){for(;this.activeCount<this.concurrency&&this.queue.length>0;){const{promise:t,abort:e}=this.queue.shift();this.activeCount++;let i,o=e;const n=t();Array.isArray(n)?(i=n[0],o=n[1]):i=n,o&&this.toAbort.push(o),i.finally((()=>{this.activeCount--,o&&(this.toAbort=this.toAbort.filter((t=>t!==o))),this.debouncedNext()}))}}}({concurrency:6,delay:200});var Le=Object.defineProperty,Pe=(t,e,i)=>((t,e,i)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oe extends h.ImageOverlay{constructor(t,e,i){super(t,e,i),Pe(this,"_aborter")}cancelLoad(){this._aborter&&(this._aborter(),this._aborter=void 0)}_initImage(){super._initImage();const{headers:t,withCredentials:e}=this.options,i=this._image,o=i.src;i.src="",xe.add((()=>{const[n,r]=ve({src:o,headers:t,withCredentials:e});return n.then((t=>{i.src=t})),this._aborter=r,n}))}}var Ce=Object.defineProperty,Me=(t,e,i)=>((t,e,i)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class ke extends h.Layer{constructor(t,e){super(e),Me(this,"defaultWmsParams",{request:"GetMap"}),Me(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,withCredentials:!1,viewPortBuffer:0,setViewDelay:100}),Me(this,"wmsParams"),Me(this,"_url"),Me(this,"_currentUrl"),Me(this,"_currentOverlay"),Me(this,"_loadedOverlay"),this._url=t;const i={},o={};let n;for(n in e)n in this.options?o[n]=e[n]:i[n]=e[n];h.Util.setOptions(this,o),this.wmsParams=h.Util.extend({},this.defaultWmsParams,i)}setParams(t){h.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:_(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e);this._loadedOverlay&&(this._loadedOverlay.cancelLoad(),this._loadedOverlay.off("load"),this._loadedOverlay=void 0);const o=new Oe(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers,withCredentials:this.options.withCredentials});o.addTo(this._map),this._loadedOverlay=o,o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._loadedOverlay=void 0,this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:n,maxZoom:r}=this.options;(n&&this._map.getZoom()<n||r&&this._map.getZoom()>r)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const n=this.options.crs||t.options.crs;if(n){const t=n.project(i.getNorthWest()),e=n.project(i.getSouthEast()),r={width:o.x,height:o.y};r.bbox=[t.x,e.y,e.x,t.y],h.Util.extend(this.wmsParams,r)}}getImageUrl(){const t=h.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var Ae=Object.defineProperty,Ee=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Se=(t,e,i)=>e in t?Ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ze=(t,e)=>{for(var i in e||(e={}))Te.call(e,i)&&Se(t,i,e[i]);if(Ee)for(var i of Ee(e))Ie.call(e,i)&&Se(t,i,e[i]);return t},je=(t,e,i)=>Se(t,"symbol"!=typeof e?e+"":e,i);class Be extends D{constructor(){super(...arguments),je(this,"layer")}addLayer(t){const e=t&&t.url;if(e){const i=(t=ze({transparent:!0},t)).updateWmsParams;if(this.layer=new ke(e,ze(ze(ze({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}}function Ze(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=_(((...t)=>{h.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img"),[n,r]=ve({src:i,withCredentials:this.options.withCredentials,headers:this.options.headers});return n.then((t=>{o.src=t,e(null,o)})),o.abort=r,(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const i in t)if(t[i].coords.z!==e){const e=t[i].el;e.onload=h.Util.falseFn,e.onerror=h.Util.falseFn,e.complete||(e.abort&&e.abort(),e.src=h.Util.emptyImageUrl,h.DomUtil.remove(e),delete t[i])}}}}je(Be,"queue",xe);const Ne=Ze(class extends h.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var Re=Object.defineProperty,De=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,qe=(t,e,i)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ve=(t,e)=>{for(var i in e||(e={}))We.call(e,i)&&qe(t,i,e[i]);if(Ue)for(var i of Ue(e))He.call(e,i)&&qe(t,i,e[i]);return t};class Ge extends D{addLayer(t){if(this.options=Object.assign(this.options,t),t){const i=t,{url:o}=i,n=((t,e)=>{var i={};for(var o in t)We.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Ue)for(var o of Ue(t))e.indexOf(o)<0&&He.call(t,o)&&(i[o]=t[o]);return i})(i,["url"]);if(o){const t=Ve({pane:this.pane,attribution:n.attribution,minZoom:n.minZoom,maxZoom:n.maxZoom},n.nativeOptions);let i;return n.subdomains&&(t.subdomains=n.subdomains),i=n.headers||n.withCredentials?new Ne(o,(e=Ve({},t),De(e,Fe({headers:n.headers,withCredentials:n.withCredentials,setViewDelay:n.setViewDelay})))):new h.TileLayer(o,t),i}}var e}updateLayer(){if(this.layer){const t=this.layer._url,e=(new Date).getTime(),i=t.includes("?")?"&":"?",o=t.replace(/(\?|&)timestamp=\d*/g,"")+i+`timestamp=${e}`;this.layer.setUrl(o),this.layer.redraw()}}}var Je=Object.defineProperty,Ke=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ti=(t,e,i)=>e in t?Je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const ei=Ze(class extends h.TileLayer.WMS{constructor(t,e){super(t,e)}});var ii=Object.defineProperty,oi=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,ri=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,li=(t,e,i)=>e in t?ii(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,hi=(t,e)=>{for(var i in e||(e={}))si.call(e,i)&&li(t,i,e[i]);if(ri)for(var i of ri(e))ai.call(e,i)&&li(t,i,e[i]);return t};function ci(t){return[[t[3],t[0]],[t[1],t[2]]]}var ui=Object.defineProperty,pi=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,mi=(t,e,i)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,_i=(t,e)=>{for(var i in e||(e={}))di.call(e,i)&&mi(t,i,e[i]);if(pi)for(var i of pi(e))fi.call(e,i)&&mi(t,i,e[i]);return t},yi=(t,e,i)=>mi(t,"symbol"!=typeof e?e+"":e,i);const gi=class t{constructor(){yi(this,"options",{target:"map"}),yi(this,"layerAdapters",t.layerAdapters),yi(this,"controlAdapters",t.controlAdapters),yi(this,"emitter",new i),yi(this,"map"),yi(this,"_resizeObserver"),yi(this,"_unselectCb",[]),yi(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),yi(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=_i({},t),this.options.target){const{zoom:t,center:e,maxZoom:i,minZoom:o,maxBounds:n,mapAdapterOptions:r}=this.options;this.map=this.options.map||new h.Map(this.options.target,_i({attributionControl:!1,zoomControl:!1,maxBounds:n?ci(n):void 0,maxZoom:i,minZoom:o,center:e&&[e[1],e[0]],zoom:t},r)),this._updateMinZoomForBounds(o),this._watchSizeChangeToUpdateMinZoom();const s=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},s.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:r,minZoom:s,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),r&&this.fitBounds(r),void 0!==n)if(n){const t=ci(n);i.setMaxBounds(t),this._updateMinZoomForBounds()}else i.setMaxBounds(null),this._updateMinZoomForBounds();void 0!==a&&i.setMaxZoom(a),void 0!==s&&this._updateMinZoomForBounds(s)}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,r={};i&&(r.maxZoom=i),n&&(r.padding=[n,n]),o&&(r.padding=o),this.map.fitBounds(ci(t),r)}}getLayerAdapter(e){return t.layerAdapters[e]}createControl(t,e){return c(t,e,this)}createButtonControl(t){return function(t,e){const i=document.createElement("a"),o=t.title||"";i.href="#",i.title=o,i.setAttribute("role","button"),i.setAttribute("aria-label",o),t.addClass&&i.classList.add(t.addClass),h.DomEvent.disableClickPropagation(i),h.DomEvent.on(i,"click",h.DomEvent.stop),t.html instanceof HTMLElement?i.appendChild(t.html):"string"==typeof t.html&&(i.innerHTML=t.html);const n=e=>{e.stopPropagation(),t.onClick()};return c({onAdd:()=>(void 0!==t.onClick&&i.addEventListener("click",n),i),onRemove(){const e=i.parentNode;e&&e.removeChild(i),void 0!==t.onClick&&i.removeEventListener("click",n)}},{bar:!0},e)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=F(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(){this._stopWatchSizeChangeToUpdateMinZoom();const t=this.getContainer();t&&this.map&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{this._updateMinZoomForBounds()})),this._resizeObserver.observe(t))}_stopWatchSizeChangeToUpdateMinZoom(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);t.on("movestart",(()=>{Be.queue.abort()})),t.on("zoomstart",(()=>{Be.queue.abort()}));for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,F(t))),t)}}_updateMinZoomForBounds(t){var e;const i=this.map;if(i){t=null!=t?t:i.getMinZoom();const o=h.latLngBounds(h.latLng(-90,-18e3),h.latLng(90,18e3)),n=null!=(e=i.options.maxBounds)?e:o;if(void 0!==n){i.setMinZoom(0);const e=i.getBoundsZoom(n,!0),o=t<e?e:t;i.options.minZoom=o,i.setMinZoom(o),i.getZoom()<o&&i.setZoom(o)}}}};yi(gi,"layerAdapters",{GEOJSON:class extends D{constructor(t,e){super(t,e),ge(this,"layer"),ge(this,"selected",!1),ge(this,"type"),ge(this,"_layers",[]),ge(this,"_events"),ge(this,"paint"),ge(this,"selectedPaint"),ge(this,"_selectedLayers",[]),ge(this,"_filteredLayers",[]),ge(this,"_filterFun"),ge(this,"_openedPopup",[]),ge(this,"_paint"),ge(this,"$updateTooltip",_((()=>{this.updateTooltip()}),300)),ge(this,"$unselect",(()=>{this.unselect()})),this._events=new et(this),this._paint=new le(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new h.FeatureGroup([],ye(_e({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>_e({target:this,feature:t.feature,layer:t},Z(t.feature))))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t(_e({target:this,feature:i,layer:n},Z(i)))?(e.addLayer(n),o.push(_e({target:this,feature:i,layer:n},Z(i)))):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>_e({feature:e,layer:t,visible:t&&!!t._map,target:this},Z(e))))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:r}=o;if(n&&r){t(n)&&(e.removeLayer(r),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let i;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?T(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?T(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=I[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>j(t.geometry.type,e)));else if("Feature"===t.type){if(!j(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>j(t.type,e))));return t}(t,o),t&&(i=this._getGeoJsonOptions(e,o))}new h.GeoJSON(t||void 0,i)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return E(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=_e(_e({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=_e(_e({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:i}=t,{label:o,labelField:n,labelOnHover:r}=this.options;if(i){let s;if(i.unbindTooltip(),e.properties&&n?s=e.properties[n]:o&&(s=o(_e(_e({target:this},t),Z(e)))),s){const t=!r;i.bindTooltip(String(s),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,i=arguments,o=function*(t,e={},i,o){var n,r;const{feature:s,layer:a}=t,{minWidth:l,autoPan:h,maxWidth:c,closeButton:u}=_e({minWidth:300},e),d=null!=u?u:!this.options.selectOnHover;let f;const m=[],_=t=>{m.push(t)},y=()=>{f&&this._removePopup(f)};let g;if(g=e.createPopupContent?yield e.createPopupContent(_e({layer:a,feature:s,target:this,type:i,close:y,onClose:_},Z(s))):e.popupContent,g&&a){const e={minWidth:l,autoPan:h,closeButton:d,closeOnClick:!1,autoClose:!1};if(p(c)&&(e.maxWidth=c),f=a.bindPopup(g,e),null==(r=null==(n=this.options.popupOptions)?void 0:n.unselectOnClose)||r){const t=a.getPopup();t&&t.once("remove",(()=>{y()}),this)}this._openedPopup.push([f,m,t]),f.openPopup(o)}},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null==(i=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||i,[,n,r]=this._openedPopup[o];for(const e of n)e(r);n.length=0,t&&this._unSelectLayer(r),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?_e(_e({},S),i(t)):ye(_e({},S),{type:"path"}))}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o=_e({target:this,feature:t,layer:e},Z(t));e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:r,selectable:s,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!p(a)||a,i.addLayer(e),s&&(l?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{n&&this._openPopup(_e({target:this,layer:e,feature:t},Z(t)),r,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){h.DomEvent.stopPropagation(t);const e=t.target,i=e.feature,o=_e({target:this,layer:e,feature:i},Z(i)),n=this._getSelected(e);n?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(n):this._selectLayer(o,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:n,popupOnSelect:r,popupOptions:s}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),r&&this._openPopup(t,s,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect(_e({type:e,layer:this,features:i},Z(i)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:i,labelOnHover:o}=this.options;this._addMapClickListener(),!i&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:Be,TILE:Ge,WMS:class extends D{addLayer(t){Object.assign(this.options,t);const e=t,{url:i}=e,o=((t,e)=>{var i={};for(var o in t)si.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&ri)for(var o of ri(t))e.indexOf(o)<0&&ai.call(t,o)&&(i[o]=t[o]);return i})(e,["url"]);if(i){const e=hi({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,transparent:!0},t.nativeOptions);let r;return r=o.headers||o.withCredentials?new ei(i,(n=hi({},e),oi(n,ni({headers:o.headers,withCredentials:o.withCredentials})))):new h.TileLayer.WMS(i,e),r}var n}},OSM:class extends Ge{addLayer(t){return super.addLayer((e=((t,e)=>{for(var i in e||(e={}))Xe.call(e,i)&&ti(t,i,e[i]);if(Qe)for(var i of Qe(e))$e.call(e,i)&&ti(t,i,e[i]);return t})({name:"OpenStreetMap",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),Ke(e,Ye({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),yi(gi,"controlAdapters",{ZOOM:h.Control.Zoom,ATTRIBUTION:class extends h.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}}),yi(gi,"Map",h.Map);let vi=gi;var bi=Object.defineProperty,wi=(t,e,i)=>((t,e,i)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class xi extends Error{constructor(){super(),wi(this,"name","CancelError"),Object.setPrototypeOf(this,xi.prototype)}}var Li=Object.defineProperty,Pi=(t,e,i)=>((t,e,i)=>e in t?Li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class Oi{constructor(t={}){this.options=t,Pi(this,"_promises",new Map)}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const i=e||t,o=this._promises.get(i);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(i,t),t.finally((()=>{this.remove(i)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const i=this.get(e=e||t.name);return i||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),i=this.add.bind(this);return function(o,n,r){const s=r.value;return t=t||n,r.value=function(...o){const n=e(t);if(n)return n;return i(s.apply(this,o),t)},r}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}var Ci=Object.defineProperty,Mi=(t,e,i)=>((t,e,i)=>e in t?Ci(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class ki extends Error{constructor(){super(),Mi(this,"name","TimeoutError"),Object.setPrototypeOf(this,ki.prototype)}}var Ai,Ei=Object.defineProperty,Ti=(t,e,i)=>((t,e,i)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const Ii=(t,e,i,o)=>{try{t(i(o))}catch(n){e(n)}};let Si=0;Ai=Symbol.toStringTag;const zi=class t{constructor(e,i){Ti(this,Ai),Ti(this,"id",Si++),Ti(this,"_isCanceled",!1),Ti(this,"_isPending",!0),Ti(this,"_promise"),Ti(this,"_cancelPromise"),Ti(this,"_cancelHandlers",[]),Ti(this,"_setCanceledCallback"),Ti(this,"_parentPromise"),Ti(this,"_children",[]),this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new xi)}));const o=[this._cancelPromise,new Promise(((i,o)=>e((e=>{e instanceof t?this.attach(e):this._isPending=!1,i(e)}),(t=>{this._isPending=!1,o(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];i&&o.push(new Promise(((t,e)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{e(new ki)}}),i)}))),this._promise=Promise.race(o)}static createControl(t){return new Oi(t)}static resolve(e){return new t((t=>t(e)))}static reject(e){return new t(((t,i)=>i(e)))}static all(e){return new t(((t,i)=>{Promise.all(e).then(t).catch(i)})).catch((t=>{if(t instanceof this.CancelError)for(const i of e){"cancel"in i&&i.cancel()}throw t}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(e,i){const o=new t(((t,o)=>{if(this._promise){const n=e=>{i?Ii(t,o,i,e):o(e)};this._promise.then((i=>{this._isCanceled?n(i):e?Ii(t,o,e,i):t(i)}),n)}}));return o._parentPromise=this,this._children.push(o),o}catch(t){return this._isCanceled&&t&&t(new xi),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new xi:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}};Ti(zi,"CancelError",xi),Ti(zi,"TimeoutError",ki),Ti(zi,"PromiseControl",Oi);let ji=zi;Object.setPrototypeOf(ji.prototype,Promise.prototype);const Bi={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'},Zi=12;var Ni=Object.defineProperty,Ri=(t,e,i)=>((t,e,i)=>e in t?Ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const Di=class t{constructor(e={}){var i;Ri(this,"cache",[]);const o=null!=(i=e.namespace)?i:"default";return t.instance[o]?t.instance[o]:(t.instance[o]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i){return this.add(t,e,i,!0)}add(t,e,i,o){const n=this._find(t,i);if(n)return n.value;{let n;n=e instanceof Function?e():e;const r=i&&JSON.parse(JSON.stringify(M(i))),s={key:t,value:n,props:r,options:r};return o&&!d(n)?n:(this.cache.push(s),n instanceof Promise?(n.catch((e=>{throw this.delete(t,i),e})),o&&n.then((e=>(d(e)||this.delete(t,i),e))),n):n)}}match(t,e){const i=this._find(t,e);if(i)return i.value}matchAll(t,e){return t?this.cache.filter((i=>this._filter(i,t,e))).map((t=>t.value)):this.cache.map((t=>t.value))}delete(t,e){let i=[];"string"==typeof t?i=this.cache.filter((i=>this._filter(i,t,e))):i.push(t);for(const o of i){const t=this.cache.indexOf(o);this.cache.splice(t,1)}}_find(t,e){return this.cache.find((i=>this._filter(i,t,e)))}_filter(t,e,i){if(t.key===e){if(i){return C(t.props||t.options||{},M(i))}return!0}return!1}};Ri(Di,"instance",{});let Fi=Di;var Ui="2.5.5",Wi=Object.defineProperty,Hi=(t,e,i)=>((t,e,i)=>e in t?Wi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class qi extends Error{constructor(t){super(),Hi(this,"name","NgwError"),Hi(this,"title"),Hi(this,"message"),Hi(this,"detail"),Hi(this,"exception"),Hi(this,"status_code"),Hi(this,"data"),Hi(this,"guru_meditation"),Object.assign(this,t),Object.setPrototypeOf(this,qi.prototype)}}var Vi=Object.defineProperty,Gi=(t,e,i)=>((t,e,i)=>e in t?Vi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ji extends qi{constructor(t){super(t),Gi(this,"name","ResourceNotFoundError"),Gi(this,"exception","nextgisweb.resource.exception.ResourceNotFound"),Object.setPrototypeOf(this,Ji.prototype)}}function Ki(t){return"[object Object]"===Object.prototype.toString.call(t)}const Yi=["description"];function Qi(t,e=""){e=e?e+"__":"";const i={};for(const[o,n]of Object.entries(t))if(-1===Yi.indexOf(o))if(Ki(n))if("owner_user"===o){const t=Qi(n,o);Object.assign(i,t)}else"parent"===o&&"id"in n&&(i.parent_id=n.id);else p(n)&&(i[e+o]=n);return i}var Xi=Object.defineProperty,$i=Object.defineProperties,to=Object.getOwnPropertyDescriptors,eo=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,no=(t,e,i)=>e in t?Xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ro=(t,e)=>{for(var i in e||(e={}))io.call(e,i)&&no(t,i,e[i]);if(eo)for(var i of eo(e))oo.call(e,i)&&no(t,i,e[i]);return t},so=(t,e,i)=>no(t,"symbol"!=typeof e?e+"":e,i);class ao{constructor({connector:t,cacheId:e}){so(this,"cache"),so(this,"connector"),this.connector=t,this.cache=new Fi({namespace:e})}getOne(t,e){const i=this.cache,o={},n=(r=ro({},e),$i(r,to({cache:!1})));var r;"string"==typeof t?o.keyname=t:"number"==typeof t?o.id=t:Ki(t)&&(void 0!==t.id?o.id=t.id:(t.keyname&&(o.keyname=t.keyname),t.display_name&&(o.display_name=t.display_name)));const s=()=>"string"==typeof t?this._fetchResourceBy({keyname:t},n):"number"==typeof t?this._fetchResourceById(t,n):Ki(t)?this._fetchResourceBy(t,n):ji.resolve(void 0);return(null==e?void 0:e.cache)?i.addFull("resource",s,o):s()}getOneOrFail(t,e){return this.getOne(t,e).then((t=>{if(t)return t;throw new Ji}))}getId(t,e){return"number"==typeof t?ji.resolve(t):"string"==typeof t||Ki(t)?this.getOne(t,e).then((t=>{if(t)return t.resource.id})):ji.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then((t=>{if(void 0===t)throw new Error;return t}))}getMany(t,e){return this._resourceCacheFilter(t).then((i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Qi(t)),this.connector.get("resource.search",e,ro({serialization:"full"},i)).then((t=>{const e=Array.isArray(t)?t:t.items;if(e)for(const i of e)this.cache.add("resource.item",ji.resolve(i),{id:i.resource.id});return e}))}return i}))}getParent(t,e){return this.getOne(t,e).then((t=>t?this.getOne(t.resource.parent.id,e):ji.resolve(void 0)))}getChildrenOf(t,e){return this.getIdOrFail(t).then((t=>this._getChildrenOf(t,e)))}update(t,e){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})}))}delete(t){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then((()=>{this._cleanResourceItemCache(t)}))}))}_getChildrenOf(t,e,i=[]){return this.connector.get("resource.collection",ro({cache:!0},e),{parent:t}).then((t=>{const o=[];for(const n of t)this.cache.add("resource.item",ji.resolve(n),{id:n.resource.id}),i.push(n),(null==e?void 0:e.recursive)&&n.resource.children&&o.push(this._getChildrenOf(n.resource.id,e,i));return o.length?ji.all(o).then((()=>i)):i}))}_cleanResourceItemCache(t){return e=this,i=null,o=function*(){const e=this.cache.all(),i=[];for(const o of e){const e=o.options&&o.options.id;["resource.item","resource"].includes(o.key)&&void 0!==e&&("number"==typeof e?e===t&&i.push(o):(yield this.getId(e))===t&&i.push(o))}for(const t of i)this.cache.delete(t)},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}_fetchResourceById(t,e){const i=()=>this.connector.get("resource.item",e,{id:t});return(null==e?void 0:e.cache)?this.cache.add("resource.item",i,{id:t}).catch((t=>{if(!(t instanceof Ji))throw t})):i()}_fetchResourceBy(t,e){return this.getMany(t,e).then((t=>t[0]))}_resourceCacheFilter(t){return ji.all(this.cache.matchAll("resource.item")).then((e=>(e.filter((e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:p(t.id)&&p(e.resource.id)?t.id===e.resource.id:C(t,e.resource)})),[])))}}const lo=[];function ho(t){lo.push(t)}var co=Object.defineProperty,uo=(t,e,i)=>((t,e,i)=>e in t?co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class po extends qi{constructor(t){super(t),uo(this,"name","InsufficientPermissionsError"),uo(this,"exception","nextgisweb.core.exception.InsufficientPermissions"),Object.setPrototypeOf(this,po.prototype)}}const fo=/\{ *([\w_-]+) *\}/g;function mo(t,e){return t.replace(fo,((t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o}))}var _o=Object.defineProperty,yo=(t,e,i)=>((t,e,i)=>e in t?_o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,e+"",i);class go extends Error{constructor(t){super(),yo(this,"name","NetworkError"),Object.setPrototypeOf(this,go.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}let vo;vo=(t,e,i={},o,n)=>{i.method=i.method||"GET";const r=new XMLHttpRequest;r.open(i.method||"GET",t,!0),"blob"===i.responseType&&(r.responseType=i.responseType);const s=()=>{try{return JSON.parse(r.responseText)}catch(t){return r.responseText}};r.onload=()=>{-1!==[401,403,404,422,500].indexOf(r.status)&&o(new qi(s())),((t=!1)=>{const n=t?o:e;"blob"===i.responseType?n(r.response):r.responseText?n(s()):o({message:""})})()},r.onerror=e=>{o(0===r.status?new go(t):e)},r.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const h in a){const t=a[h];"string"==typeof t&&r.setRequestHeader(h,t)}let l;if(void 0!==i.withCredentials&&(r.withCredentials=i.withCredentials),i.file){if(l=new FormData,l.append("file",i.file),i.data)for(const h in i.data)l.append(h,l[h])}else l=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;n&&n((()=>{r.abort()})),r.send(l)};var bo=Object.defineProperty,wo=Object.getOwnPropertySymbols,xo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Po=(t,e,i)=>e in t?bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Oo=(t,e)=>{for(var i in e||(e={}))xo.call(e,i)&&Po(t,i,e[i]);if(wo)for(var i of wo(e))Lo.call(e,i)&&Po(t,i,e[i]);return t},Co=(t,e,i)=>Po(t,"symbol"!=typeof e?e+"":e,i);let Mo=0;class ko{constructor(t){this.options=t,Co(this,"id",Mo++),Co(this,"emitter",new i),Co(this,"user"),Co(this,"resources"),Co(this,"cache"),Co(this,"withCredentials"),Co(this,"client",`NextGIS-NGW-Connector/${Ui}`),Co(this,"routeStr","/api/component/pyramid/route"),Co(this,"activeRequests",[]),Co(this,"requestTransform");const e=function(t){return lo.find((e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return C(e.options.auth,t.auth)}}))}(t);if(this.cache=new Fi({namespace:t.cacheId}),e)return e;{const{route:e,requestTransform:i,withCredentials:o}=this.options;e&&(this.routeStr=e),i&&(this.requestTransform=i),void 0!==o&&(this.withCredentials=o),this.resources=new ao({connector:this,cacheId:t.cacheId}),ho(this)}}static create(t){return new this(t)}clearCache(){this.cache.clean(),this.resources.cache.clean()}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,ho(this)}connect(){const t=this.options.auth;return this.cache.add("route",(()=>new ji(((e,i)=>{const o=()=>this.makeQuery(`${this.routeStr}?client=${this.client}`.toString(),{},{}).then((t=>{e(t)})).catch((t=>{i(t)}));if(t){const{login:e,password:n}=t;if(e&&n)return this._login({login:e,password:n}).then((()=>o())).catch((t=>i(t)))}return o()}))),{id:this.id,auth:t,baseUrl:this.options.baseUrl})}login(t,e){return this.logout(),ho(this),this._login(t,e)}logout(){this.abort(),function(t){const e=lo.indexOf(t);-1!==e&&lo.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.clearCache(),this.emitter.emit("logout")}getUserInfo(t,e){if(this.user&&this.user.id)return ji.resolve(this.user);t&&(this.options.auth=t);const i=Oo({headers:this.getAuthorizationHeaders(t)},e);return this.makeQuery("/api/component/auth/current_user",{},i)}getAuthorizationHeaders(t){const e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t,o=[e,i].map(encodeURIComponent).join(":");return window.btoa(o)}}abort(){for(const t of this.activeRequests)t.cancel();this.activeRequests=[]}getActiveApiRequests(){return[...this.activeRequests]}apiRequest(t,e={},i={}){var o,n;i=Oo({withCredentials:this.withCredentials},i);const{method:r,headers:s,withCredentials:a,responseType:l}=i,h=M(e=null!=(o=i.params)?o:e),c=()=>function(t){const e=t.params;return new ji(((i,o)=>t.connector.connect().then((n=>{let r=n&&n[t.name];if(r){r=[...r];let n=r.shift();if(r.length){const t={};for(let i=0;i<r.length;i++){const o=r[i];if(t[i]="{"+o+"}",void 0===e[o])throw new Error("`"+o+"` url api argument is not specified")}n&&(n=mo(n,t))}if(e){const t=[],i=e.paramList;Array.isArray(i)&&(delete e.paramList,i.forEach((e=>{t.push(`${e[0]}=${e[1]}`)})));for(const o in e)-1===r.indexOf(o)&&t.push(`${o}=${e[o]}`);t.length&&(n=n+"?"+t.join("&"))}n?i(t.connector.makeQuery(n,e,t.requestOptions)):o(new Error("request url is not set"))}else i(void 0)})).catch((t=>{o(t)}))))}({name:t,params:h,requestOptions:i,connector:this});return i.cache&&"GET"===r?this.cache.add(t,c,Oo({params:h},M({headers:s,withCredentials:a,responseType:l,baseUrl:this.options.baseUrl,userId:null==(n=this.user)?void 0:n.id}))):c()}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}makeQuery(t,e,i={}){if(t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=mo(t,e)),t=encodeURI(A(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}_loadData(t,e){if(e.responseType=e.responseType||"json",e.signal&&e.signal.aborted)return ji.reject(new ji.CancelError);const i=new ji(((i,o,n)=>{if(this.user&&((e=e||{}).headers=Oo(Oo({},this.getAuthorizationHeaders()),e.headers)),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}vo(t,i,e,o,n)})).then((t=>(this._cleanActiveRequests(i),t))).catch((t=>{if(this._cleanActiveRequests(i),t instanceof ji.CancelError);else{const e=this._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(()=>{i.cancel(),this._cleanActiveRequests(i)})),this.activeRequests.push(i),i}_login(t,e){return this.getUserInfo(t,e).then((t=>(this.user=t,this.emitter.emit("login",t),t))).catch((t=>{throw this.emitter.emit("login:error",t),t}))}_cleanActiveRequests(t){const e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)}_handleHttpError(t){if(t&&t instanceof qi){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new Ji(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new po(t)}return t}}Co(ko,"errors",{NgwError:qi,ResourceNotFoundError:Ji});var Ao=Object.defineProperty,Eo=Object.defineProperties,To=Object.getOwnPropertyDescriptors,Io=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,jo=(t,e,i)=>e in t?Ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bo=(t,e)=>{for(var i in e||(e={}))So.call(e,i)&&jo(t,i,e[i]);if(Io)for(var i of Io(e))zo.call(e,i)&&jo(t,i,e[i]);return t},Zo=(t,e)=>Eo(t,To(e));const No={srs:4326,geom_format:"geojson"};function Ro(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Do(t,e){const{extensions:i,geom:o,fields:n,srs:r,ilike:s,like:a}=e,l=i?i.join(","):"";"*"!==l&&(t.extensions=l),null!=n&&(t.fields=Array.isArray(n)?n.join(","):""),void 0!==o&&(t.geom=o?"yes":"no",o||(delete t.srs,delete t.geom_format)),p(s)?t.ilike=s:p(a)&&(t.like=a),p(r)&&(t.srs=r)}function Fo(t){const e=Wo(t);return ji.all(e).then((e=>{const i=[],o=[];for(const t of e)for(const e of t)i.includes(e.id)||(o.push(e),i.push(e.id));return t.offset||t.limit?o.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:o.length):o}))}function Uo(t){const[e,i,o]=t;let n="",r="";return[`${"id"!==e?"fld_":""}${String(e).trim().replace(/^(%?)(.+?)(%?)$/,((t,e,i,o)=>(n=e,r=o,i)))}__${i}`,n+o+r]}function Wo(t,e=[],i=[]){var o;const{filters:n}=t,r=null!=(o=t.paramList)?o:[],s="string"==typeof n[0]?n[0]:"all",a=n.filter((t=>Array.isArray(t)));if("any"===s)for(const l of a)Ut(l)?e.push(qo(Zo(Bo({},t),{paramList:[...i,...r,Uo(l)]}))):Wo(Zo(Bo({},t),{filters:l}),e,[...i]);else if("all"===s){const o=[],n=[];for(const t of a)Ut(t)?o.push(Uo(t)):n.push(t);if(n.length)for(const r of n)Wo(Zo(Bo({},t),{filters:r}),e,[...i,...o]);else e.push(qo(Zo(Bo({},t),{paramList:[...i,...r,...o]})))}return e}function Ho(t){return`POLYGON((${t.map((([t,e])=>{const[i,o]=P(t,e).map((t=>Math.round(1*(t+Number.EPSILON))/1));return i+" "+o})).join(", ")}))`}function qo(t){const e=Bo({},No),{limit:i,cache:o,signal:n,offset:r,orderBy:s,paramList:a,connector:l,geomFormat:h,intersects:c,resourceId:u}=t;if(i?i!==Number.POSITIVE_INFINITY&&(e.limit=i):e.limit=7e3,r&&(e.offset=r),h&&(e.geom_format=h),Do(e,t),s&&(e.order_by=s.join(",")),Array.isArray(c)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}(c)?v(c):c;e.intersects=Ho(t)}else"string"==typeof c&&(e.intersects=c);a&&(e.paramList=a);const p=Bo({id:u},e);return l.get("feature_layer.feature.collection",{cache:o,signal:n},p)}var Vo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,Xo=(t,e,i)=>e in t?Vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$o=(t,e)=>{for(var i in e||(e={}))Yo.call(e,i)&&Xo(t,i,e[i]);if(Ko)for(var i of Ko(e))Qo.call(e,i)&&Xo(t,i,e[i]);return t},tn=(t,e)=>Go(t,Jo(e));function en(t){const e=$o({},No);Do(e,t);const i=$o({id:t.resourceId,fid:t.featureId},e);return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},i).then((e=>tn($o({},e),{toGeojson:()=>e.geom?ji.resolve(Ro(e)):en(tn($o({},t),{geom:!0,fields:null,extensions:null})).then((t=>{const i=t.geom;return Ro(tn($o({},e),{geom:i}))}))})))}var on=Object.defineProperty,nn=(t,e,i)=>((t,e,i)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class rn{constructor(t){this.options=t,nn(this,"name"),nn(this,"resourceId"),nn(this,"item"),nn(this,"_extent"),this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(){return this._extent?ji.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((t=>{const{minLat:e,minLon:i,maxLat:o,maxLon:n}=t.extent,r=[i,e,n,o];return this._extent=r,r}))}geoJson(){return this.item.geom?ji.resolve(Ro(this.item)):en({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((t=>(this.item.geom=t.geom,Ro(this.item))))}}function sn(t,e,i,o){return!!hn(t,e,i,cn)}function an(t,e,i,o){return hn(t,e,i,un)}function ln(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function hn(t,e=(t=>!!t),i="children",o,n){return o(t,"function"==typeof e?e:t=>Wt(t,e),i)}function cn(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(e(t))return t;const o=ln(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){const t=cn(n[r],e,i,o);if(t)return t}}function un(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{e(t)&&o.push(t);const r=ln(t,i);r&&(n=r)}for(let r=0;r<n.length;r++)n[r]&&un(n[r],e,i,o);return o}function pn(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(!e(t))return!1;const o=ln(t,i);o&&(n=o)}for(let r=0;r<n.length;r++)if(n[r]){if(!pn(n[r],e,i,o))return!1}return!0}var dn=Object.defineProperty,fn=(t,e,i)=>((t,e,i)=>e in t?dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class mn{constructor(t){fn(this,"item"),fn(this,"_children",[]),fn(this,"_parent"),this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?an(e,t,(t=>t.tree.getParent())):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return hn(this._children,t,(t=>t.tree.getChildren()),cn)}every(t){return!!hn(this._children,t,(t=>t.tree.getChildren()),pn)}some(t){return sn(this._children,t,(t=>t.tree.getChildren()))}all(t){return this.getDescendants(t)}getDescendants(t){return an(this._children,t,(t=>t.tree.getChildren()))}getChildren(){return[...this._children]}}var _n=Object.defineProperty,yn=(t,e,i)=>((t,e,i)=>e in t?_n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class gn{constructor(t,e,o){yn(this,"options"),yn(this,"emitter",new i),yn(this,"name"),yn(this,"item"),yn(this,"_blocked",!1),yn(this,"_container"),yn(this,"_value"),yn(this,"_removeEventsListener"),this.item=e,this.options=Object.assign({},o),this.name=t,this._value=this.getProperty()}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach((i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})}))}}_calculateBlockedStatus(t){const e=t.some((t=>{var e;const i=null==(e=t.properties)?void 0:e.property(this.name);return!!i&&!i.get()}));return e}}var vn=Object.defineProperty,bn=Object.getOwnPropertySymbols,wn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Ln=(t,e,i)=>e in t?vn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pn=(t,e)=>{for(var i in e||(e={}))wn.call(e,i)&&Ln(t,i,e[i]);if(bn)for(var i of bn(e))xn.call(e,i)&&Ln(t,i,e[i]);return t};const On=class t extends gn{constructor(e,i,o){super(e,i,Pn(Pn({},t.options),o)),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every((t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()}))}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1,this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach((e=>this._blockChild(e,t)))}unblockChild(t){this.item.tree.getChildren().forEach((e=>this._unBlockChild(e,t)))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const n=i[o],r=n.properties&&n.properties.property(this.name);r&&r.set(t,Pn(Pn({},e),{propagation:!0,bubble:!1}))}}}};Ln(On,"options"+"",{hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"});let Cn=On;var Mn=Object.defineProperty,kn=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Tn=(t,e,i)=>e in t?Mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,In=(t,e,i)=>Tn(t,"symbol"!=typeof e?e+"":e,i);const Sn=class t{constructor(t,e){this.item=t,In(this,"options",{}),In(this,"_properties",{}),In(this,"_propertiesList",[]),e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach((t=>t.update()))}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map((t=>this._properties[t]))}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i=((t,e)=>{for(var i in e||(e={}))An.call(e,i)&&Tn(t,i,e[i]);if(kn)for(var i of kn(e))En.call(e,i)&&Tn(t,i,e[i]);return t})({},t);this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(e){const i=e.handler;return!i&&e.type?"boolean"===e.type?t.handlers.CheckProperty:t.handlers.BaseProperty:i}};In(Sn,"handlers",{CheckProperty:Cn});let zn=Sn;var jn=Object.defineProperty,Bn=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Rn=(t,e,i)=>e in t?jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Dn=(t,e,i)=>Rn(t,"symbol"!=typeof e?e+"":e,i);let Fn=0;class Un{constructor(t){Dn(this,"options",{}),Dn(this,"properties"),Dn(this,"tree"),Dn(this,"id",Fn),Fn+=1,this.options=((t,e)=>{for(var i in e||(e={}))Zn.call(e,i)&&Rn(t,i,e[i]);if(Bn)for(var i of Bn(e))Nn.call(e,i)&&Rn(t,i,e[i]);return t})({},t),this.tree=new mn(this)}initProperties(){this.properties=new zn(this,this.options.properties)}}var Wn=Object.defineProperty,Hn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,Gn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Kn=(t,e,i)=>e in t?Wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Yn=(t,e)=>{for(var i in e||(e={}))Gn.call(e,i)&&Kn(t,i,e[i]);if(Vn)for(var i of Vn(e))Jn.call(e,i)&&Kn(t,i,e[i]);return t},Qn=(t,e)=>Hn(t,qn(e));function Xn(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,n=t.extent_right;if(e&&i&&o&&n){const t=[i,e,n,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function $n({resourceId:t,connector:e,cache:i=!0}){return e.get("layer.extent",{cache:i},{id:t}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}function tr(t){return t.connector.getResource(t.resourceId).then((e=>{if(e)return er(e,t.connector,t)}))}function er(t,e,i){if(t.webmap)return ji.resolve(Xn(t.webmap));{const o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((t=>{if(t)return $n(Qn(Yn({},i),{resourceId:t.resource.id,connector:e}))})):$n(Qn(Yn({},i),{resourceId:o.id,connector:e}))}}var ir=Object.defineProperty,or=(t,e,i)=>((t,e,i)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),nr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class rr{constructor(){or(this,"item"),or(this,"connector"),or(this,"_extent")}getExtent(){return nr(this,null,(function*(){return this.getBounds()}))}getBounds(t){return nr(this,null,(function*(){return this._extent?this._extent:this.item?(this._extent=yield er(this.item,this.connector,t),this._extent):void 0}))}}var sr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ar(t,e){return sr(this,null,(function*(){const i=t.resource,o=i;let{keyname:n,resourceId:r}=t;if(i&&("string"==typeof i?n=i:r="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:yield ar(i,e)),!r&&n){const t=yield e.getResource(n);t&&(r=t.resource.id)}return r}))}const lr={tms:"TILE"};var hr=Object.defineProperty,cr=Object.getOwnPropertySymbols,ur=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,dr=(t,e,i)=>e in t?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,fr=(t,e)=>{for(var i in e||(e={}))ur.call(e,i)&&dr(t,i,e[i]);if(cr)for(var i of cr(e))pr.call(e,i)&&dr(t,i,e[i]);return t},mr=(t,e,i)=>dr(t,"symbol"!=typeof e?e+"":e,i);const _r="https://qms.nextgis.com";function yr(t,e=_r,i={}){let o;if("webMap"in t){const n=t,{webMap:r,url:s}=n,a=((t,e)=>{var i={};for(var o in t)ur.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&cr)for(var o of cr(t))e.indexOf(o)<0&&pr.call(t,o)&&(i[o]=t[o]);return i})(n,["webMap","url"]);o=r,s&&(e=s),a&&(i=a)}else o=t;e||(e=_r);class n{constructor(t,e){mr(this,"qms"),mr(this,"options"),mr(this,"map"),this.map=t;const o=fr(fr({},i),e);this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}addLayer(t){return i=this,r=null,s=function*(){if(!this.qms&&t.qmsId)try{this.qms=yield function(t){return new Promise(((e,i)=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(4===o.readyState&&200===o.status&&o.responseText)try{e(JSON.parse(o.responseText))}catch(t){i(t)}},o.open("GET",A(t),!0),o.send()}))}(e+"/api/v1/geoservices/"+t.qmsId)}catch(a){console.error(a)}const i=this.qms;if(i){const e=lr[i.type||"tms"],a=o.mapAdapter.layerAdapters[e];if(a&&(r=n,s=a,["showLayer","hideLayer"].forEach((t=>{const e=Object.getOwnPropertyDescriptor(s.prototype,t);e&&Object.defineProperty(r.prototype,t,e)})),"TILE"===e)){if(t=fr(fr({order:0,maxZoom:o.options.maxZoom,minZoom:o.options.minZoom},this.options),function(t){const e=("https:"===location.protocol?"https":"http")+"://";let i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}(i)),i.origin_url){const[e,o]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,((t,i)=>("string"==typeof i&&i.split(",").forEach((t=>e.push(t))),"{s}"))),e]}(i.origin_url);o.length&&(t.subdomains=o,t.url=e)}return this.options=t,new a(this.map,t).addLayer(t)}}var r,s},new Promise(((t,e)=>{var o=t=>{try{a(s.next(t))}catch(i){e(i)}},n=t=>{try{a(s.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,n);a((s=s.apply(i,r)).next())}));var i,r,s}}return n}var gr=Object.defineProperty,vr=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable,xr=(t,e,i)=>e in t?gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Lr=(t,e)=>{for(var i in e||(e={}))br.call(e,i)&&xr(t,i,e[i]);if(vr)for(var i of vr(e))wr.call(e,i)&&xr(t,i,e[i]);return t},Pr=(t,e,i)=>xr(t,"symbol"!=typeof e?e+"":e,i);class Or{constructor(t){Pr(this,"options",{url:"https://qms.nextgis.com"}),Pr(this,"url"),this.options=Lr(Lr({},this.options),t),this.url=this.options.url}getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return yr({webMap:t,url:this.url})}}Pr(Or,"utils",{createQmsAdapter:yr});var Cr=Object.defineProperty,Mr=Object.defineProperties,kr=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertySymbols,Er=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Sr=Reflect.get,zr=(t,e,i)=>e in t?Cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jr=(t,e)=>{for(var i in e||(e={}))Tr.call(e,i)&&zr(t,i,e[i]);if(Ar)for(var i of Ar(e))Ir.call(e,i)&&zr(t,i,e[i]);return t},Br=(t,e)=>Mr(t,kr(e)),Zr=(t,e,i)=>Sr(Er(t),i,e),Nr=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function Rr(t){let e;for(e in t){const i=t[e];if(k(i)){const o=i;if(p(o.year)&&p(o.month)&&p(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach((t=>{i.push(t)})),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}var Dr=Object.defineProperty,Fr=Object.defineProperties,Ur=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertySymbols,Hr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Vr=(t,e,i)=>e in t?Dr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Gr=(t,e)=>{for(var i in e||(e={}))Hr.call(e,i)&&Vr(t,i,e[i]);if(Wr)for(var i of Wr(e))qr.call(e,i)&&Vr(t,i,e[i]);return t},Jr=(t,e)=>Fr(t,Ur(e));function Kr(t){const e=t.filters;return e?Fo(Jr(Gr({},t),{filters:e})).then((i=>{var o;return(null!=(o=t.clientFilterValidate)?o:Yr(e))&&(i=i.filter((t=>Wt(Rr(Jr(Gr({},t.fields),{id:t.id})),e)))),i})):qo(t)}function Yr(t){if("any"===t[0])return!0;for(let e=1;e<t.length;e++){const i=t[e];if("[object Array]"===Object.prototype.toString.call(i)){if(Yr(i))return!0}}return!1}function Qr(t){return function(t){return Kr(t).then((t=>{const e=[];return t.forEach((t=>{e.push(Ro(t))})),e}))}(t).then((t=>({type:"FeatureCollection",features:t})))}const Xr=["fields","intersects","limit","orderBy","strategy"];function $r(t){const e={};return Xr.forEach((i=>{const o=t[i];void 0!==o&&(e[i]=o)})),e}var ts=Object.defineProperty,es=Object.defineProperties,is=Object.getOwnPropertyDescriptors,os=Object.getOwnPropertySymbols,ns=Object.getPrototypeOf,rs=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,as=Reflect.get,ls=(t,e,i)=>e in t?ts(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,hs=(t,e)=>{for(var i in e||(e={}))rs.call(e,i)&&ls(t,i,e[i]);if(os)for(var i of os(e))ss.call(e,i)&&ls(t,i,e[i]);return t},cs=(t,e)=>es(t,is(e)),us=(t,e,i)=>ls(t,"symbol"!=typeof e?e+"":e,i),ps=(t,e,i)=>as(ns(t),i,e),ds=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function fs(t){return ds(this,null,(function*(){var e,o;const{item:n,webMap:r,Adapter:s,connector:a,layerOptions:l,addLayerOptionsPriority:h}=t,c=null==h||h,u=l,p=s||l.Adapter||r.mapAdapter.layerAdapters.GEOJSON,d=[];let f,m,y=!1;const g=yield ar(u,a);(null==(o=null==(e=u.adapterOptions)?void 0:e.popupOptions)?void 0:o.fromProperties)&&(u.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}}));else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,n));const v=(t,e)=>ds(this,null,(function*(){return w(),f={filters:t,options:e},m=Qr(hs({resourceId:g,filters:t,connector:a,cache:!0},e)),yield m}));let b=!1;const w=()=>{m&&(m.cancel(),m=void 0)};class x extends p{constructor(){super(...arguments),us(this,"emitter",new i),us(this,"__onMapMove"),us(this,"__onMapMoveStart"),us(this,"__enableMapMoveListener"),us(this,"__disableMapMoveListener")}addLayer(t){return ds(this,null,(function*(){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==u.id&&(t.id=u.id),n&&n.vector_layer&&(t.type=Ys[n.vector_layer.geometry_type]),u.adapterOptions&&(t=c?hs(hs({},u.adapterOptions),t):hs(hs({},t),u.adapterOptions)),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const o=t.strategy||void 0;this.options.strategy=o;const r=ps(x.prototype,this,"addLayer").call(this,t);let s;return f={filters:t.propertiesFilter,options:$r(t)},e&&(s=this.updateLayer()),i&&s&&(yield s),o&&o.startsWith("BBOX")&&!y&&this._addBboxEventListener(),r}))}getExtent(){return this.getBounds()}getBounds(){return ds(this,null,(function*(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?tr({connector:a,resourceId:n.resource.id}):ps(x.prototype,this,"getBounds")?ps(x.prototype,this,"getBounds").call(this):void 0}))}beforeRemove(){b=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,w()}getCount(){return function({connector:t,resourceId:e,cache:i=!0}){return t.get("feature_layer.feature.count",{cache:i},{id:e}).then((t=>t.total_count))}({connector:a,resourceId:g,cache:!0})}updateLayer(t){return ds(this,null,(function*(){var e;if(t=t||f||{},null==(e=this.options.strategy)?void 0:e.startsWith("BBOX")){yield r.onLoad("create"),t.options=t.options||{},t.options.intersects=r.getBounds();const{minZoom:e,maxZoom:i}=this.options,o=r.getZoom();if(void 0!==o){if(void 0!==e&&o<e)return;if(void 0!==i&&o>i)return;if(y)return}}if(!b){try{this.emitter.emit("preupdate",t),r._emitLayerEvent("layer:preupdate",u.id||"",t);const e=yield v(t.filters,cs(hs({},t.options),{srs:this.options.srs}));let i=e;const o=yield this.getCount();if("BBOX+"===this.options.strategy){i={type:"FeatureCollection",features:[]};for(const t of e.features)-1===d.indexOf(String(t.id))&&(d.push(String(t.id)),i.features.push(t));y=void 0!==o&&d.length>=o,yield r.addLayerData(this,i)}else y=void 0!==o&&e.features.length>=o,yield r.setLayerData(this,e);this.emitter.emit("updated",e),r._emitLayerEvent("layer:updated",u.id||"",{data:e,newData:i,isFull:y})}catch(i){if(i instanceof Error&&"CancelError"!==i.name)throw i}ps(x.prototype,this,"updateLayer")&&ps(x.prototype,this,"updateLayer").call(this)}}))}propertiesFilter(t,e){return ds(this,null,(function*(){if(w(),this.filter&&y)this.filter((e=>{const i=e.feature&&e.feature.properties&&Rr(hs({},e.feature.properties));return!i||Wt(i,t)}));else if(this.setData){this.clearLayer&&this.clearLayer();const i=yield v(t,cs(hs({},e),{srs:this.options.srs}));this.setData(i)}}))}removeFilter(){f=void 0,this.propertiesFilter([]),this.filter&&this.filter((()=>!0))}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},r.emitter.on("layer:show",this.__enableMapMoveListener),r.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&r.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&r.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=_((()=>this.updateLayer())),this.__onMapMoveStart=w,r.emitter.on("movestart",this.__onMapMoveStart),r.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&r.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&r.emitter.removeListener("movestart",this.__onMapMoveStart)}}return x}))}var ms=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function _s({options:t,webMap:e,baseUrl:i}){var o;let n,r=t.adapter||"IMAGE";const s=e&&e.getLayerAdapters(),a=t.resource,l=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===r){if(!s||s.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const n=e+"/api/component/render/image",r={resource:t};return i&&(r.nd=i),{url:n,resourceId:t,headers:o,params:r,updateWmsParams:e=>(i&&(e.nd=i),Ks(e,t))}}({resourceId:a,headers:t.headers,nd:l,baseUrl:i});r="TILE"}if("WMS"===r){n=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:n,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===r)return n=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!=(o=t.simplification)?o:6),{url:n,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===r)return n=i+`/api/resource/${a}/terrain_provider`,{url:n,adapter:r};if("MODEL_3D"===r)return n=i+`/api/component/model_3d/${a}/data.glb`,{url:n};if("TILE"===r)return n=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+l,{url:n,adapter:r}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}var ys=Object.defineProperty,gs=Object.defineProperties,vs=Object.getOwnPropertyDescriptors,bs=Object.getOwnPropertySymbols,ws=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,Ls=(t,e,i)=>e in t?ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ps=(t,e)=>{for(var i in e||(e={}))ws.call(e,i)&&Ls(t,i,e[i]);if(bs)for(var i of bs(e))xs.call(e,i)&&Ls(t,i,e[i]);return t},Os=(t,e)=>gs(t,vs(e)),Cs=(t,e,i)=>Ls(t,"symbol"!=typeof e?e+"":e,i),Ms=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ks(t){return Ms(this,arguments,(function*({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.cls;let r=t.adapter||n&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[n]||"IMAGE";if(void 0!==r&&(t.adapter=r),"IMAGE"===r){const t=e.getLayerAdapters();!t||t.IMAGE||(r="TILE")}const s=e.mapAdapter.layerAdapters[r];if(s){const n=yield ar(t,i);return class extends s{constructor(r,s){super(r,s),this.map=r,Cs(this,"item",o),Cs(this,"resourceId",n);const a=_s({options:t,webMap:e,baseUrl:i.options.baseUrl||""});if(a){const e=Os(Ps(Ps({},a),t.adapterOptions),{params:{resource:n},layers:a.layers||String(n),resourceId:n});t.adapterOptions&&p(t.adapterOptions.setViewDelay)&&(e.setViewDelay=t.adapterOptions.setViewDelay),this.options=Ps(Ps({},this.options),e)}}addLayer(t){return super.addLayer(Ps(Ps({},this.options),t))}getLegend(t){return Ms(this,null,(function*(){const e=yield i.get("render.legend_symbols",Ps({params:{id:n},cache:!0},t)),o=this.options.id;if(void 0!==o){return[{layerId:o,legend:e.map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}return[]}))}getIdentificationIds(){return Ms(this,null,(function*(){if(this.item){if("MVT"===r)return[this.item.resource.id];const t=this.item.resource.parent.id;if(p(t))return[t]}return[]}))}}}throw new Error(r+" not supported yet. Only TILE")}))}var As=Object.defineProperty,Es=Object.defineProperties,Ts=Object.getOwnPropertyDescriptors,Is=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,zs=Object.prototype.propertyIsEnumerable,js=(t,e,i)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Bs=(t,e)=>{for(var i in e||(e={}))Ss.call(e,i)&&js(t,i,e[i]);if(Is)for(var i of Is(e))zs.call(e,i)&&js(t,i,e[i]);return t},Zs=(t,e)=>Es(t,Ts(e)),Ns=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Rs={},Ds=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Fs(t){return Ns(this,arguments,(function*({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.id,r=yield i.getResourceChildren(n),s=r&&r[0];if(s)return Us(Zs(Bs({},t),{resource:s.resource.id}),e,i)}))}function Us(t,e,i){return Ns(this,null,(function*(){let o,n;const r=t.adapter,s=yield ar(t,i);if(s){const a=t.resource;if(n=a&&a.resource&&void 0!==a.resource.id?a:yield i.getResource(s),!n)throw"Resource item is not found";{const a=n.resource.cls,l={layerOptions:Zs(Bs({},t),{resource:s}),connector:i,webMap:e,item:n};if(-1!==Ds.indexOf(a))if("webmap"===a)o=function(t){return ms(this,arguments,(function*({layerOptions:t,webMap:e,connector:i}){const o=yield ar(t,i);return class extends Ta{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}}))}(l);else if("vector_layer"===a||"postgis_layer"===a){const e=l.layerOptions.adapterOptions||{};if(e.type=e.type||n.vector_layer&&Ys[n.vector_layer.geometry_type],l.layerOptions.adapterOptions=e,t.adapterOptions=l,void 0!==r&&"GEOJSON"!==r){if("MVT"!==r)return Fs(l);o=ks(l)}else o=fs(l)}else{if("raster_layer"===a)return Fs(l);if("basemap_layer"===a)o=function(t){return Nr(this,arguments,(function*({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer,{qms:o,url:n}=i;if(o&&"string"==typeof o){const e=JSON.parse(o);return Promise.resolve(Or.utils.createQmsAdapter(t,void 0,{qms:e,baselayer:!0}))}if(n){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{constructor(t,e){super(t,Br(jr({},e),{baselayer:!0,order:0}))}addLayer(e){return Nr(this,null,(function*(){var o,r,s;return Zr(t.prototype,this,"addLayer").call(this,Br(jr({},e),{url:n,minZoom:null!=(o=i.z_min)?o:e.minZoom,maxZoom:null!=(r=i.z_max)?r:e.maxZoom,attribution:null!=(s=i.copyright_text)?s:e.attribution}))}))}}return t}}}}))}(l);else if("GEOJSON"===r){const e=yield i.getResource(n.resource.parent.id);if(e){const i=Zs(Bs({},t),{resource:n.resource.parent.id});o=fs(Zs(Bs({},l),{item:e,layerOptions:i}))}}else o=ks(l)}else{if(!Rs[a])throw`Resource class '${a}' not yet supported.`;{const t=Rs[a];let e;e=r&&"function"!=typeof e?t[r]:t,e&&(o=e(l))}}}}if(o)return o.then((t=>{if(t){const e=t;return n&&(e.prototype.item=n,e.prototype.resourceId=n.resource.id,e.prototype.connector=i),u(e,[rr],{replace:!1}),e}}))}))}var Ws=Object.defineProperty,Hs=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,Vs=Object.prototype.propertyIsEnumerable,Gs=(t,e,i)=>e in t?Ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Js=(t,e)=>{for(var i in e||(e={}))qs.call(e,i)&&Gs(t,i,e[i]);if(Hs)for(var i of Hs(e))Vs.call(e,i)&&Gs(t,i,e[i]);return t};function Ks(t,e){const{bbox:i,width:o,height:n,nd:r}=t;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:o+","+n,timestamp:Date.now(),nd:null!=r?r:200}}const Ys={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let Qs;function Xs(t,e=0){const i=e,o=function(){if(void 0===Qs){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),Qs=e}return Qs}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t,n=function(t){return Math.log(t/256)/Math.LN2}(o);return n}var $s=Object.defineProperty,ta=Object.defineProperties,ea=Object.getOwnPropertyDescriptors,ia=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,na=Object.prototype.propertyIsEnumerable,ra=(t,e,i)=>e in t?$s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,sa=(t,e)=>{for(var i in e||(e={}))oa.call(e,i)&&ra(t,i,e[i]);if(ia)for(var i of ia(e))na.call(e,i)&&ra(t,i,e[i]);return t},aa=(t,e)=>ta(t,ea(e)),la=(t,e,i)=>ra(t,"symbol"!=typeof e?e+"":e,i),ha=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const ca=class t extends Un{constructor(e,o,n,r,s,a){if(super(sa(sa({},t.options),n)),this.webMap=e,la(this,"item"),la(this,"connector"),la(this,"layer"),la(this,"emitter",new i),la(this,"_rootDescendantsCount",0),r&&(this.connector=r),s&&this.tree.setParent(s),this.item=o,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),a||this._init(o)}static create(e,i,o,n,r){return ha(this,null,(function*(){const s=new t(e,i,o,n,r,!0);return yield s._init(i),s}))}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}getLegend(t){return ha(this,null,(function*(){var e;const i=null==(e=this.layer)?void 0:e.id;if(void 0!==i){const e=this.connector;if(e){return[{layerId:i,legend:(yield e.get("render.legend_symbols",sa({params:{id:this.item.resourceId},cache:!0},t))).map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}}return[]}))}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o=aa(sa({visibility:!1,name:t.display_name},this.options),{params:{resource:this.item.resourceId,item:this.item}});if(this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,aa(sa({updateWmsParams:t.updateWmsParams},this.options),{url:t.url,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable}))}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return Xs(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor(this.webMap,t,this.options,this.connector,this);this.tree.addChild(e)}}return Promise.resolve()}initLayerItem(e){const i=this.getItemOptions(e),o=t=>{e._layer=t,this.layer=t;this.properties.get("visibility")&&this.properties.set("visibility",!0),void 0!==i.opacity&&this.webMap.setLayerOpacity(t,i.opacity)};let n;if("layer"===e.item_type)n=e.adapter||e.layer_adapter.toUpperCase();else if(t.GetAdapterFromLayerType[e.item_type]){n=(0,t.GetAdapterFromLayerType[e.item_type])(e,i,this.webMap,this.connector)}return n?this.webMap.addLayer(n,i).then((t=>{o(t)})):e._layer?Promise.resolve(o(e._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,n=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,r=[e,o].filter(Boolean),s=[i,n].filter(Boolean);return{minZoom:r.length?Math.max(...r):void 0,maxZoom:s.length?Math.min(...s):void 0}}_init(t){this.initItem(t).then((()=>{this.emitter.emit("init")}))}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}};la(ca,"GetAdapterFromLayerType",{}),la(ca,"options",{properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return sn(t.item,(t=>"layer_enabled"in t&&t.layer_enabled),(t=>t.children));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends gn{getProperty(){const t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce(((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)}),1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]});let ua=ca;var pa=Object.defineProperty,da=Object.getOwnPropertySymbols,fa=Object.prototype.hasOwnProperty,ma=Object.prototype.propertyIsEnumerable,_a=(t,e,i)=>e in t?pa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ya=(t,e)=>{for(var i in e||(e={}))fa.call(e,i)&&_a(t,i,e[i]);if(da)for(var i of da(e))ma.call(e,i)&&_a(t,i,e[i]);return t},ga=(t,e,i)=>_a(t,"symbol"!=typeof e?e+"":e,i),va=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));function ba(t){return e=this,i=arguments,o=function*({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:n="first-show-adapter"}){const r=function(t){return va(this,arguments,(function*({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){ga(this,"options",{}),ga(this,"layer",[]),ga(this,"_removed",!1),ga(this,"_creatingInProgress",!1)}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}showLayer(){return va(this,null,(function*(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)yield t.showLayer(e);else yield this.loadLayer()}))}hideLayer(){return va(this,null,(function*(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)yield t.hideLayer(e)}))}loadLayer(){return va(this,null,(function*(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const n=yield o(this);if(n){const o=new n(t.mapAdapter.map,ya({},e)),r=yield o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=r,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&(yield t.showLayer(o)),this._creatingInProgress=!1}}return this.layer}))}}}))}({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=n+"-"+i.resource_id},createAdapter:()=>Us({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)});return r},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}var wa=Object.defineProperty,xa=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Ca=Object.prototype.propertyIsEnumerable,Ma=(t,e,i)=>e in t?wa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ka=(t,e)=>{for(var i in e||(e={}))Oa.call(e,i)&&Ma(t,i,e[i]);if(Pa)for(var i of Pa(e))Ca.call(e,i)&&Ma(t,i,e[i]);return t},Aa=(t,e,i)=>Ma(t,"symbol"!=typeof e?e+"":e,i),Ea=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class Ta{constructor(t,e){this.map=t,this.options=e,Aa(this,"layer"),Aa(this,"NgwWebmapItem",ua),Aa(this,"pixelRadius",10),Aa(this,"resourceId"),Aa(this,"webmapClassName","webmap"),Aa(this,"emitter",new i),Aa(this,"_extent"),Aa(this,"response"),Aa(this,"_webmapBaselayersIds",[]),Aa(this,"_lastActiveBaselayer");const o=e.resourceId;if(Array.isArray(o)?(this.resourceId=o[0],this.options.id=o[1]):this.resourceId=o,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}addLayer(t){return Ea(this,null,(function*(){var e,i;this.options=ka(ka({},this.options),t),this.layer=yield this._getWebMapLayerItem();const o=null==(i=null==(e=this.response)?void 0:e.webmap)?void 0:i.extent_constrained;return this.options.useExtentConstrained&&this._extent&&o&&this.options.webMap.setView({maxBounds:this._extent}),this.layer}))}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((e=>{"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response}showLayer(){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)}))}hideLayer(){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)}))}setOpacity(t){return Ea(this,null,(function*(){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)}))}getExtent(){return this.getBounds()}getBounds(){const t=this.response&&this.response.webmap;if(t)return Xn(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id}fetchBookmarks(){const t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((i=>{var o;const n=null==(o=i.feature_layer)?void 0:o.fields.find((t=>t.label_field)),r=n&&n.keyname;return Kr({connector:e,resourceId:t,geom:!1,fields:r?[r]:void 0}).then((i=>{const o=[];for(const n of i){const i=new rn({item:n,resourceId:t,labelField:r,connector:e});o.push(i)}return o}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}getLegend(){return Ea(this,null,(function*(){const t=[];let e=this.getDependLayers();e=e.sort(((t,e)=>e.id-t.id));for(const i of e){const e=yield i.getLegend();t.push(...e)}return t}))}getIdentificationIds(){return Ea(this,null,(function*(){const t=[];let e=this.getDependLayers();return e=e.sort(((t,e)=>e.id-t.id)),e.forEach((e=>{const i=e.item,o=i.style_parent_id;if(void 0!==o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}})),t}))}_getWebMapLayerItem(){return Ea(this,null,(function*(){if(!this.resourceId)return;const t=yield this.getWebMapConfig(this.resourceId);return t&&t.root_item?new Promise((e=>{const i=this.options.connector,o=(null==i?void 0:i.options.auth)?i.getAuthorizationHeaders():void 0,n=i.withCredentials,r=(s=ka({},this.options),xa(s,La({withCredentials:n,headers:o,drawOrderEnabled:t.draw_order_enabled})));var s;const a=new this.NgwWebmapItem(this.options.webMap,t.root_item,r,i);a.emitter.on("init",(()=>{e(a)}))})):void 0}))}getWebMapConfig(t){return Ea(this,null,(function*(){const e=yield this.options.connector.getResource(t);if(e){this.response=e;const t=e[this.webmapClassName];if(this._setupBaselayers(e),t)return this._extent=[t.extent_left,t.extent_bottom,t.extent_right,t.extent_top],this._updateItemsParams(t.root_item,this.options.webMap,e),t}}))}_setupBaselayers(t){var e;const i=this.options.webMap;if(null==(e=this.options.useBasemap)||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)ba({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then((t=>{const n=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:"webmap-baselayer"+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:n}).then((t=>{t.id&&this._webmapBaselayersIds.push(t.id)}))}))}_updateItemsParams(t,e,i){if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((t=>this._updateItemsParams(t,e,i)))),"root"===t.item_type&&(t.display_name=i.resource.display_name);else if("layer"===t.item_type){const i=A(this.options.connector.options.baseUrl+"/api/component/render/image"),o=t.layer_style_id;t.url=i,t.resourceId=o,t.updateWmsParams=t=>Ks(t,o);const n=_s({options:{adapter:t.layer_adapter.toUpperCase(),resource:o},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=ka(ka({},t),n)}return t}}var Ia=Object.defineProperty,Sa=Object.getOwnPropertySymbols,za=Object.prototype.hasOwnProperty,ja=Object.prototype.propertyIsEnumerable,Ba=(t,e,i)=>e in t?Ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Za=(t,e)=>{for(var i in e||(e={}))za.call(e,i)&&Ba(t,i,e[i]);if(Sa)for(var i of Sa(e))ja.call(e,i)&&Ba(t,i,e[i]);return t},Na=(t,e,i)=>Ba(t,"symbol"!=typeof e?e+"":e,i);class Ra{constructor(t){if(this.options=t,Na(this,"url"),Na(this,"connector"),Na(this,"webMap"),this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new ko({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){Rs[t]=e}onLoadSync(t){return e=this,i=null,o=function*(){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return yield t.addLayer(Ta,Za({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},e))}}},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends Ta{constructor(t,i){super(t,i=Js(Js({},e),i))}};var e}}var Da=Object.defineProperty,Fa=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,Wa=Object.prototype.propertyIsEnumerable,Ha=(t,e,i)=>e in t?Da(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,qa=(t,e,i)=>Ha(t,"symbol"!=typeof e?e+"":e,i);class Va{constructor(t){qa(this,"id"),qa(this,"label"),qa(this,"layerId"),qa(this,"parent"),qa(this,"fields"),qa(this,"geom"),qa(this,"extensions"),qa(this,"connector"),qa(this,"_item"),qa(this,"_geojson"),qa(this,"_resource"),qa(this,"_extent");const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?ji.resolve(this._item):en(((t,e)=>{for(var i in e||(e={}))Ua.call(e,i)&&Ha(t,i,e[i]);if(Fa)for(var i of Fa(e))Wa.call(e,i)&&Ha(t,i,e[i]);return t})({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then((t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t)))}resource(){return this._resource?ji.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((t=>(this._resource=t,this._resource.feature_layer)))}getBounds(){return this._extent?ji.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0}){return i.get("feature_layer.feature.item_extent",{cache:o},{id:t,fid:e}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}({connector:this.connector,featureId:this.id,resourceId:this.layerId})}geojson(){return this._geojson?ji.resolve(this._geojson):this.identify().then((t=>t.toGeojson().then((t=>(this._geojson=t,t)))))}}function Ga(t){return en(t).then((t=>Ro(t)))}var Ja=Object.defineProperty,Ka=Object.defineProperties,Ya=Object.getOwnPropertyDescriptors,Qa=Object.getOwnPropertySymbols,Xa=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,tl=(t,e,i)=>e in t?Ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,el=(t,e)=>{for(var i in e||(e={}))Xa.call(e,i)&&tl(t,i,e[i]);if(Qa)for(var i of Qa(e))$a.call(e,i)&&tl(t,i,e[i]);return t},il=(t,e)=>Ka(t,Ya(e));function ol(t,e=!1){const i=[],o=[];for(const r in t){const t=Number(r);isNaN(t)||i.push(t)}const n=t.resources;n&&i.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)));for(let r=0;r<i.length;r++){const n=i[r],s=t[n];if("features"in s){const t=nl(s.features,Number(n),e);if(t.length&&(o.push(...t),!e))break}}return o}function nl(t,e,i){const o=[];for(const n of t){if(o.push({featureId:n.id,resourceId:e,feature:n}),!i)break}return o}function rl(t){const{geom:e,signal:i,cache:o,layers:n}=t,r="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null==(e=t.geometry)?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map((([t,e])=>{const[i,o]=P(t,e);return`${i} ${o}`})).join(",")}))`}(e);if(!r)throw new Error("Not valid geometry format to make intersection");return t.connector.post("feature_layer.identify",{data:{geom:r,srs:3857,layers:n},signal:i,cache:o})}function sl(t,e){return i=this,o=null,n=function*(){var i;const o=yield t.get("pyramid.settings",null,{component:"pyramid"});if(o&&o.company_logo&&o.company_logo.enabled){const r=document.createElement("a");r.style.position="absolute",r.style.bottom="0",r.style.right="0",r.style.padding=null!=(i=null==e?void 0:e.padding)?i:"10px",r.className="ngw-map-logo",e&&e.cssClass&&(r.className+=" "+e.cssClass);const s=new Image;s.style.maxHeight="100px",s.style.maxWidth="100px",s.src="";try{const e=yield t.get("pyramid.company_logo",{responseType:"blob"}),i=(window.URL||window.webkitURL).createObjectURL(e);s.src=i}catch(n){console.warn(n)}return null!==o.company_logo.link&&""!==o.company_logo.link.trim()&&(r.href=o.company_logo.link,r.target="_blank",-1!==o.company_logo.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),r.appendChild(s),r}},new Promise(((t,e)=>{var r=t=>{try{a(n.next(t))}catch(i){e(i)}},s=t=>{try{a(n.throw(t))}catch(i){e(i)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((n=n.apply(i,o)).next())}));var i,o,n}var al=Object.defineProperty,ll=(t,e,i)=>((t,e,i)=>e in t?al(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class hl{constructor(){ll(this,"backspace",8),ll(this,"tab",9),ll(this,"enter",13),ll(this,"shift",16),ll(this,"ctrl",17),ll(this,"alt",18),ll(this,"pause/break",19),ll(this,"caps_lock",20),ll(this,"escape",27),ll(this,"page_up",33),ll(this,"page_down",34),ll(this,"end",35),ll(this,"home",36),ll(this,"left_arrow",37),ll(this,"up_arrow",38),ll(this,"right_arrow",39),ll(this,"down_arrow",40),ll(this,"insert",45),ll(this,"delete",46),ll(this,"left_window_key",91),ll(this,"right_window_key",92),ll(this,"select_key",93),ll(this,"numpad_0",96),ll(this,"numpad_1",97),ll(this,"numpad_2",98),ll(this,"numpad_3",99),ll(this,"numpad_4",100),ll(this,"numpad_5",101),ll(this,"numpad_6",102),ll(this,"numpad_7",103),ll(this,"numpad_8",104),ll(this,"numpad_9",105),ll(this,"multiply",106),ll(this,"add",107),ll(this,"subtract",109),ll(this,"decimal_point",110),ll(this,"divide",111),ll(this,"f1",112),ll(this,"f2",113),ll(this,"f3",114),ll(this,"f4",115),ll(this,"f5",116),ll(this,"f6",117),ll(this,"f7",118),ll(this,"f8",119),ll(this,"f9",120),ll(this,"f10",121),ll(this,"f11",122),ll(this,"f12",123),ll(this,"num_lock",144),ll(this,"scroll_lock",145),ll(this,"semi-colon",186),ll(this,"equal_sign",187),ll(this,",",188),ll(this,"-",189),ll(this,".",190),ll(this,"/",191),ll(this,"`",192),ll(this,"[",219),ll(this,"\\",220),ll(this,"]",221),ll(this,"'",222)}}var cl=Object.defineProperty,ul=(t,e,i)=>((t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);var pl=Object.defineProperty,dl=(t,e,i)=>((t,e,i)=>e in t?pl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class fl{constructor(t,e){this.webMap=t,dl(this,"name"),dl(this,"event"),dl(this,"value"),e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}var ml=Object.defineProperty,_l=(t,e,i)=>((t,e,i)=>e in t?ml(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class yl extends fl{constructor(){super(...arguments),_l(this,"name","center"),_l(this,"event","moveend")}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}var gl=Object.defineProperty,vl=(t,e,i)=>((t,e,i)=>e in t?gl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class bl extends fl{constructor(){super(...arguments),vl(this,"name","zoom"),vl(this,"event","zoomend")}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}var wl=Object.defineProperty,xl=(t,e,i)=>((t,e,i)=>e in t?wl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ll=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));let Pl=0;const Ol={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},Cl=class t{constructor(e){xl(this,"options",Ol),xl(this,"emitter",new i),xl(this,"keys",t.keys),xl(this,"mapAdapter"),xl(this,"runtimeParams",[]),xl(this,"getPaintFunctions",t.getPaintFunctions),xl(this,"mapState",[yl,bl]),xl(this,"id",Pl++),xl(this,"_initMapState",{}),xl(this,"_starterKits"),xl(this,"_mapState",[]),xl(this,"_extent"),xl(this,"_eventsStatus",{}),xl(this,"_coordFromMapClickPromise"),xl(this,"_mapEvents",{}),this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=f(Ol||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}create(){return Ll(this,null,(function*(){return this.getEventStatus("create")||(yield this._setInitMapState(this.mapState),yield this._setupMap(),this._emitStatusEvent("create",this)),this}))}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:g(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&p(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),p(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return function(t){const[e,i,o,n]=t,r=e<o&&i<n;if(!r){console.log("Error: The extent coordinates are not in the correct order."),console.log(`Received extent: [${e}, ${i}, ${o}, ${n}]`);const t=[Math.min(e,o),Math.min(i,n),Math.max(e,o),Math.max(n,i)];console.log(`Expected order: [${t.join(", ")}]`)}const s=e>=-180&&o<=180,a=i>=-90&&n<=90;s&&a||console.log("Warning: The coordinates may not be within valid geographic ranges.")}(t),t.every((t=>p(t)))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},n=null==(i=this.mapAdapter.isLoaded)||i;this.mapAdapter.map&&n?o():this.mapAdapter.emitter.once("create",(()=>{o()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new ji(((t,e,i)=>{const o=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(o),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",r),this._coordFromMapClickPromise=void 0},r=e=>{n(),m(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",r),i(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}_addLayerProviders(){return Ll(this,null,(function*(){}))}_onLoadSync(){return Ll(this,null,(function*(){}))}_setupMap(){return Ll(this,null,(function*(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return yield this.mapAdapter.create(this.options),this._zoomToInitialExtent(),yield this._addLayerProviders(),yield this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}))}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),p(t.maxzoom)&&(this.options.zoom=t.maxzoom),p(t.minzoom)&&(this.options.zoom=t.minzoom),p(t.maxzoom)&&p(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&(this.fitBounds(i),void 0!==e&&this.setZoom(e))}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((i=>{i.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}};xl(Cl,"keys",new class{constructor(){ul(this,"keyCodeAlias",new hl),ul(this,"keys",{}),ul(this,"_windowOnFocus"),ul(this,"_keysPressed"),ul(this,"_keysReleased"),this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}}),xl(Cl,"getPaintFunctions");let Ml=Cl;function kl(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}const Al={polygon:"path",line:"path",point:"circle"},El={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function Tl(t){if(t.data){const e=El[function(t){let e;e="FeatureCollection"===t.type?kl(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?kl(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&it(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":Al[e]),t.type=t.type||e}return t}var Il=Object.defineProperty,Sl=Object.defineProperties,zl=Object.getOwnPropertyDescriptors,jl=Object.getOwnPropertySymbols,Bl=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable,Nl=(t,e,i)=>e in t?Il(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rl=(t,e)=>{for(var i in e||(e={}))Bl.call(e,i)&&Nl(t,i,e[i]);if(jl)for(var i of jl(e))Zl.call(e,i)&&Nl(t,i,e[i]);return t},Dl=(t,e)=>Sl(t,zl(e)),Fl=(t,e,i)=>Nl(t,"symbol"!=typeof e?e+"":e,i),Ul=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));class Wl extends Ml{constructor(t){super(t),Fl(this,"_layersIdCounter",1),Fl(this,"_layersOrderCounter",1),Fl(this,"_baselayers",[]),Fl(this,"_layers",{}),Fl(this,"_selectedLayers",[]);const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}fitLayer(t,e){return Ul(this,null,(function*(){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=yield o.call(i);t&&this.fitBounds(t,e)}}))}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const i=this._layers[e];i&&t.push(i)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}addBaseLayer(t,e){return Ul(this,null,(function*(){return yield this.addLayer(t,Dl(Rl({},e),{baselayer:!0}),void 0)}))}addLayer(t){return Ul(this,arguments,(function*(t,e={},i){var o,n;const r=this._layersIdCounter++,s=p(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=yield t);const l=e;this._updateGeoJsonOptions(l);const h=null==(o=(e=Rl({id:String(r),order:s},e)).visibility)||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options=Rl(Rl({},e),t.options),t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),yield this.onMapLoad(),t.map=this.mapAdapter.map;const o=yield t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(r),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!=(n=t.options.order)?n:s,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,l.filter&&this.filterLayer(t,l.filter),e.baselayer&&this._baselayers.push(i),h&&(yield this.showLayer(i)));const c=e.opacity;void 0!==c&&c<=1&&this.setLayerOpacity(t,c);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=yield u.call(t);e&&(yield this.fitBounds(e))}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")}))}addLayerFromAsyncAdapter(t,e,i){return Ul(this,null,(function*(){const o=i||void 0!==e.order?e.order:this.reserveOrder(),n=t(),r=yield n;return r?this.addLayer(r,e,o):Promise.reject("No adapter")}))}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}getLegend(t){return Ul(this,null,(function*(){const e=[];for(const i of this.orderedLayers())i.getLegend&&e.push(i.getLegend(t));return(yield Promise.all(e)).flat()}))}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=Tl(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",Dl(Rl({},e),{url:t}))}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",Dl(Rl({},e),{url:i}))}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),n=void 0!==e?e:!(o&&o.options.visibility),r=void 0!==i.silent&&i.silent,s=t=>Ul(this,null,(function*(){const e=String(t.id),i=n?"layer:show":"layer:hide";if(r||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)yield this.hideLayer(t)}t.showLayer?yield t.showLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.showLayer(t.layer)),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?yield t.hideLayer.call(t,t.layer):void 0!==t.layer&&(yield this.mapAdapter.hideLayer(t.layer));t.options.visibility=n,r||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))}));return o?this.onMapLoad().then((()=>s(o))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null==(e=i.options.labelVisibility)||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||Wt(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let n=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(i)),n){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(t,e,i){const o=String(t);if(p(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}_onLayerClick(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}))}_onLayerDoubleClick(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:dblclick",t.layer.id||"",t),Promise.resolve(t)}))}_onLayerSelect(t){return Ul(this,null,(function*(){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}))}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onDoubleClick:n,onLayerClick:r,onMouseOut:s,onMouseOver:a}=t,l=o||r,h=n||r;t.onClick=t=>(l&&l(t),this._onLayerClick(t)),t.onDoubleClick=t=>(h&&h(t),this._onLayerDoubleClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),p(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;a&&a(t),p(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const c=e||i;t.onSelect=t=>(c&&c(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=$t({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=$t({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}var Hl=Object.defineProperty,ql=(t,e,i)=>((t,e,i)=>e in t?Hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Vl=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Gl=class t extends Wl{constructor(){super(...arguments),ql(this,"_loadControlQueue",{"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]}),ql(this,"_isControlLoading",{"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1})}addControl(t,e,i){return Vl(this,null,(function*(){let o;if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,i):t,o)return new Promise((t=>{this._setControlQueue(e,(()=>Vl(this,null,(function*(){const i=yield o,n=this.mapAdapter.addControl(i,e);t(n)}))))}))}))}createControl(t,e){return Vl(this,null,(function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}))}createButtonControl(t){return Vl(this,null,(function*(){if(yield this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}))}createToggleControl(t){return Vl(this,null,(function*(){return yield this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div");let o=!1;e.getStatus?o=e.getStatus():e.status&&(o=e.status);const n=e.title||"",r=e.html;function s(){n&&(i.title="string"==typeof n?n:o?n.on:n.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function l(){r&&("string"==typeof r||r instanceof HTMLElement?a(r):a(o?r.on:r.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach((t=>{e?i.classList.add(t):i.classList.remove(t)}))}function c(){e.addClassOn&&h(e.addClassOn,o),e.addClassOff&&h(e.addClassOff,!o)}s(),l(),e.addClass&&h(e.addClass,!0),c();const u=t=>{void 0!==t&&(o=t),l(),s(),c()},p=t=>{if(o=void 0!==t?t:!o,e.onClick){const t=e.onClick(o);Promise.resolve(t).then((()=>u())).catch((()=>o=!o))}else u()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=u,d}(this.mapAdapter.createButtonControl,t):void 0}))}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(e,i){const o=this.mapAdapter.controlAdapters[e];if(o)return new o(i);{const o=t.controls[e];if(o)return o(this,i)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}_applyControls(t){return Vl(this,null,(function*(){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];yield e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}))}};ql(Gl,"controls",{CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)});let Jl=Gl;const Kl={};var Yl=Object.getOwnPropertySymbols,Ql=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable,$l=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),th=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())})),eh=(t,e,i)=>(e=t[$l("asyncIterator")])?e.call(t):(t=t[$l("iterator")](),e={},i=(i,o)=>(o=t[i])&&(e[i]=e=>new Promise(((i,n,r)=>(e=o.call(t,e),r=e.done,Promise.resolve(e.value).then((t=>i({value:t,done:r})),n))))),i("next"),i("return"),e);class ih extends Jl{constructor(t){super(t),this._addControls(),Kl[this.id]=this}static get(t){return function(t){return Kl[t]}(t)}_addLayerProviders(){return th(this,null,(function*(){try{for(var t,e,i,o=eh(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.getLayerAdapters){const e=yield t.getLayerAdapters.call(t);if(e)try{for(var n,r,s,a=eh(e);n=!(r=yield a.next()).done;n=!1){const t=r.value,e=yield t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}catch(r){s=[r]}finally{try{n&&(r=a.return)&&(yield r.call(a))}finally{if(s)throw s[0]}}}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}}))}_onLoadSync(){return th(this,null,(function*(){try{for(var t,e,i,o=eh(this._starterKits);t=!(e=yield o.next()).done;t=!1){const t=e.value;if(t.onLoadSync)try{yield t.onLoadSync.call(t,this)}catch(n){console.error(n)}}}catch(e){i=[e]}finally{try{t&&(e=o.return)&&(yield e.call(o))}finally{if(i)throw i[0]}}}))}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const o=i,{position:n}=o,r=((t,e)=>{var i={};for(var o in t)Ql.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&Yl)for(var o of Yl(t))e.indexOf(o)<0&&Xl.call(t,o)&&(i[o]=t[o]);return i})(o,["position"]);this.addControl(e,n||"top-left",r)})),this._emitStatusEvent("controls:create")}}var oh=Object.defineProperty,nh=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,sh=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,lh=Object.prototype.propertyIsEnumerable,hh=(t,e,i)=>e in t?oh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ch=(t,e)=>{for(var i in e||(e={}))ah.call(e,i)&&hh(t,i,e[i]);if(sh)for(var i of sh(e))lh.call(e,i)&&hh(t,i,e[i]);return t},uh=(t,e)=>nh(t,rh(e));function ph(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(uh(ch({},i),{resource:e}));else if(Array.isArray(e)){const[n,r]=e;t.push(ch(uh(ch({},i),{resource:n,id:r}),o))}else"object"==typeof e&&t.push(ch(ch(ch({},i),e),o))}var dh=Object.defineProperty,fh=Object.defineProperties,mh=Object.getOwnPropertyDescriptors,_h=Object.getOwnPropertySymbols,yh=Object.prototype.hasOwnProperty,gh=Object.prototype.propertyIsEnumerable,vh=(t,e,i)=>e in t?dh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;const bh={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};function wh(t){const e=[new Or];var i;return t.starterKits&&t.starterKits.forEach((t=>{e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new ko({baseUrl:t.baseUrl||"",auth:t.auth,withCredentials:t.withCredentials}),(t=f(bh,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Ra({connector:t.connector,auth:t.auth})),i=((t,e)=>{for(var i in e||(e={}))yh.call(e,i)&&vh(t,i,e[i]);if(_h)for(var i of _h(e))gh.call(e,i)&&vh(t,i,e[i]);return t})({},t),t=fh(i,mh({starterKits:e,create:!1}))}var xh=Object.defineProperty,Lh=Object.defineProperties,Ph=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,Ch=Object.getPrototypeOf,Mh=Object.prototype.hasOwnProperty,kh=Object.prototype.propertyIsEnumerable,Ah=Reflect.get,Eh=(t,e,i)=>e in t?xh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Th=(t,e)=>{for(var i in e||(e={}))Mh.call(e,i)&&Eh(t,i,e[i]);if(Oh)for(var i of Oh(e))kh.call(e,i)&&Eh(t,i,e[i]);return t},Ih=(t,e)=>Lh(t,Ph(e)),Sh=(t,e,i)=>Eh(t,"symbol"!=typeof e?e+"":e,i),zh=(t,e,i)=>Ah(Ch(t),i,e),jh=(t,e,i)=>new Promise(((o,n)=>{var r=t=>{try{a(i.next(t))}catch(e){n(e)}},s=t=>{try{a(i.throw(t))}catch(e){n(e)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,s);a((i=i.apply(t,e)).next())}));const Bh=class t extends ih{constructor(t){super(wh(t)),Sh(this,"emitter",new i),Sh(this,"connector"),Sh(this,"_ngwLayers",{}),Sh(this,"$$selectFromNgwRaster"),Sh(this,"$$selectFromNgwVector"),Sh(this,"_promises",{select:[],identify:[]}),t.connector&&(this.connector=t.connector),this._createWebMap().then((()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}addControl(e,i,o){return jh(this,null,(function*(){return yield this.onLoad("controls:create"),zh(t.prototype,this,"addControl").call(this,e,i,o)}))}addNgwLayer(t){return jh(this,null,(function*(){yield this.onMapLoad();const{keyname:e,resourceId:i}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const o=t.resource;if(!e&&!i&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(p(this.options.baseUrl))try{p(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},p(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay));const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),void 0!==i.withCredentials&&(t.withCredentials=i.withCredentials),Us(t,e,i)}(t,this,this.connector),i=Th(Th({visibility:!0},t),t.adapterOptions),o=yield this.addLayer(e,i),n=o&&this.getLayerId(o);if(o&&n&&(this._ngwLayers[n]={layer:o,resourceId:o.resourceId},o.options.name=o.options.name||o.item&&o.item.resource.display_name,o.options.baselayer)){if(this.getActiveBaseLayer())return o}return o}catch(n){const t=k(o)&&"id"in o?o.id:e||i||o;console.error(`Can't add NGW layer ${t}.`,n)}}))}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return en(Th({connector:this.connector},t))}fetchNgwLayerItems(t){return Kr(Th({connector:this.connector},t))}fetchNgwLayerFeature(t){return Ga(Th({connector:this.connector},t))}fetchNgwLayerFeatures(t){return Qr(Th({connector:this.connector},t))}fetchIdentifyItem(t,e){const i=function(t){const{connector:e,identify:i}=t,o=ol(i);return o&&o.length?en(el(el({connector:e},t.requestOptions),o[0])):ji.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",i),i}fetchIdentifyGeoJson(t,e=!1){const i=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const r in i){const t=Number(r);if(!isNaN(t)){const t=i[r];if("features"in t){const e=t.features.find((t=>t.geom));if(e&&e.geom){const t=e.geom;return ji.resolve(Ro(il(el({},e),{geom:t})))}}}}const n=ol(i);return n&&n.length?Ga(el(il(el({},o),{connector:e}),n[0])):ji.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return i&&"then"in i?(this._addPromise("identify",i),i):ji.resolve(i)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,e)}getNgwLayers(){return jh(this,null,(function*(){return yield this.onLoad(),this._ngwLayers}))}getNgwLayerByResourceId(t){return jh(this,null,(function*(){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=yield i.layer.getIdentificationIds();if(e&&e.some((e=>e===t)))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find((e=>e.item&&e.item.style_parent_id===t));if(e)return e.layer}}}))}fitLayer(e,i){return jh(this,null,(function*(){let o;o="string"==typeof e||"number"==typeof e?String(o):e.id;const n=o&&this._ngwLayers[o];if(n)if(n.layer.getBounds){const t=yield n.layer.getBounds();t&&this.fitBounds(t,i)}else{let t;if(n.layer.item)t=n.layer.item;else{const e=n.resourceId;t=yield this.connector.getResource(e)}t&&tr({resourceId:t.resource.id,connector:this.connector}).then((t=>{t&&this.fitBounds(t,i)}))}else zh(t.prototype,this,"fitLayer").call(this,"number"==typeof e?String(e):e,i)}))}zoomToLayer(t){return jh(this,null,(function*(){return this.fitLayer(t)}))}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach((t=>{const e=this._promises[t];e&&(e.forEach((t=>t.cancel())),this._promises[t]=[])}))}selectFromNgwRaster(t){return jh(this,null,(function*(){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort(((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1));for(const t of o){const o=t.layer,n="function"==typeof o.getIdentificationIds&&o.getIdentificationIds,r=null==(e=o.options.interactive)||e;n&&o.options.selectable&&r&&this.isLayerVisible(o)&&i.push(n.call(o))}const n=Promise.all(i),r=yield n,s=[];for(const t of r)t&&s.push(...t);if(!s.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,l=this.getCenter();let h=this.getZoom();if(h=void 0!==h?h:20,!l||!h)return void this._emitStatusEvent("ngw:select",null);const c=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(l,h,a);let u;if(this.options.highlightIdentification){const e=this.options.highlightIdentification,i="number"==typeof e?e:1e3,[o,n]=t.lngLat;u={type:"Polygon",coordinates:[x(o,n,c)]};const r=yield this.addGeoJsonLayer({data:{type:"Feature",geometry:u}});i!==1/0&&setTimeout((()=>{this.removeLayer(r)}),i)}const p=function(t,e){m(t);const[i,o]=t.lngLat,{geom:n,radius:r,signal:s,cache:a}=e,l=null!=n?n:x(i,o,r);return rl(il(el({},e),{geom:l,signal:s,cache:a}))}(t,{layers:s,connector:this.connector,radius:c,geom:u}).then((e=>{const i=Ih(Th({},e),{resources:s,sourceType:"raster",event:t}),o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o}));return this._addPromise("select",p),p}))}_addPromise(t,e){const i=this._promises[t];if(i&&-1===i.indexOf(e)){const t=()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(t),e.catch(t),i.push(e)}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}_createWebMap(){return jh(this,null,(function*(){yield this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&ph(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),ph(t,o,{},i)}for(const o of t)try{yield this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}))}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,[i]:{featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]}};return this._emitStatusEvent("ngw:select",this._prepareToIdentify(Ih(Th({},e),{resources:[i],sourceType:"vector"}))),e}}}_prepareToIdentify(t){return Ih(Th({},t),{getIdentifyItems:()=>ol(t,!0).map((t=>new Va({feature:t.feature,connector:this.connector})))})}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}_whiteLabel(){return jh(this,null,(function*(){const t=this.getContainer();if(t){const e=yield sl(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}}))}};Sh(Bh,"getIcon",(function(t={}){var e,i,o,n,r,s;const a=null!=(e=t.shape)?e:"circle",l=null!=(i=t.color)?i:"blue",h=null!=(o=t.strokeColor)?o:"white",c=null!=(n=t.size)?n:Zi,u=null!=(r=t.rotate)?r:0,p=null!=(s=t.anchor)?s:[c/2,c/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||Bi[a]||"circle",m="string"==typeof f?f:f(t),_=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const n=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${n} -${n} ${Zi+i} ${Zi+i}"\n >${o}</svg>`}({width:c,height:c,stroke:d,content:m}));return _.setAttribute("width",String(c)),_.setAttribute("height",String(c)),_.setAttribute("fill",l),d&&(_.setAttribute("stroke",h),_.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[c,c],iconAnchor:p,html:(new XMLSerializer).serializeToString(_),rotate:u,svg:_}}));let Zh=Bh;var Nh=Object.defineProperty,Rh=Object.defineProperties,Dh=Object.getOwnPropertyDescriptors,Fh=Object.getOwnPropertySymbols,Uh=Object.prototype.hasOwnProperty,Wh=Object.prototype.propertyIsEnumerable,Hh=(t,e,i)=>e in t?Nh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;delete h.Icon.Default.prototype._getIconUrl,h.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class qh extends Zh{constructor(t){var e,i;e=((t,e)=>{for(var i in e||(e={}))Uh.call(e,i)&&Hh(t,i,e[i]);if(Fh)for(var i of Fh(e))Wh.call(e,i)&&Hh(t,i,e[i]);return t})({},t),i={mapAdapter:new vi},super(t=Rh(e,Dh(i)))}static create(t){return e=this,i=null,o=function*(){return new qh(t).onLoad()},new Promise(((t,n)=>{var r=t=>{try{a(o.next(t))}catch(e){n(e)}},s=t=>{try{a(o.throw(t))}catch(e){n(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);a((o=o.apply(e,i)).next())}));var e,i,o}}return window&&!window.NgwMap&&(window.NgwMap=qh),qh}();
|
|
2
2
|
//# sourceMappingURL=ngw-leaflet.global.prod.js.map
|